This commit is contained in:
rootzoll 2025-01-19 00:20:25 +01:00
parent 9f6fd1339c
commit 8656d2179f
2 changed files with 10 additions and 7 deletions

View File

@ -787,9 +787,15 @@ if [ "${scenario}" != "ready" ] ; then
# put flag file into old system
touch /home/admin/systemcopy.flag
# TODO: disable old system boot
sudo umount /dev/mmcblk0p1
sudo parted --script /dev/mmcblk0 rm 1
# disable old system boot
echo "# disable old system boot" >> ${logFile}
/home/admin/config.scripts/blitz.data.sh kill-boot ${installDevice} # TODO: blitz.data.sh status needs add installDevice
if [ $? -eq 1 ]; then
echo "FAIL: blitz.data.sh kill-boot \"${installDevice}\" failed" >> ${logFile}
/home/admin/_cache.sh set state "error"
/home/admin/_cache.sh set message "blitz.data.sh kill-boot failed"
exit 1
fi
# reboot so that new system can start
/home/admin/_cache.sh set state "reboot"

View File

@ -937,7 +937,6 @@ if [ "$1" = "kill-boot" ]; then
partitionNumber=""
for partNumber in $(parted -s "/dev/${device}" print | grep "^ *[0-9]" | awk '{print $1}'); do
partitionPath="/dev/${device}${separator}${partNumber}"
echo "# checking ${partitionPath}"
if blkid "${partitionPath}" | grep -q "TYPE=\"vfat\"" && \
parted "/dev/${device}" print | grep "^ *${partNumber}" | grep -q "boot\|esp\|lba"; then
bootPartition="${device}${separator}${partNumber}"
@ -958,9 +957,7 @@ if [ "$1" = "kill-boot" ]; then
fi
# make sure boot partition is not mounted
echo "# unmounting boot partition (${bootPartition}) (${partitionNumber})"
exit 1
echo "# killing boot partition (${bootPartition})"
umount "/dev/${bootPartition}" 2>/dev/null
parted --script "/dev/${device}" rm "${partitionNumber}"
if [ $? -ne 0 ]; then