mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-27 20:16:22 +02:00
add kill
This commit is contained in:
@@ -787,9 +787,15 @@ if [ "${scenario}" != "ready" ] ; then
|
|||||||
# put flag file into old system
|
# put flag file into old system
|
||||||
touch /home/admin/systemcopy.flag
|
touch /home/admin/systemcopy.flag
|
||||||
|
|
||||||
# TODO: disable old system boot
|
# disable old system boot
|
||||||
sudo umount /dev/mmcblk0p1
|
echo "# disable old system boot" >> ${logFile}
|
||||||
sudo parted --script /dev/mmcblk0 rm 1
|
/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
|
# reboot so that new system can start
|
||||||
/home/admin/_cache.sh set state "reboot"
|
/home/admin/_cache.sh set state "reboot"
|
||||||
|
@@ -937,7 +937,6 @@ if [ "$1" = "kill-boot" ]; then
|
|||||||
partitionNumber=""
|
partitionNumber=""
|
||||||
for partNumber in $(parted -s "/dev/${device}" print | grep "^ *[0-9]" | awk '{print $1}'); do
|
for partNumber in $(parted -s "/dev/${device}" print | grep "^ *[0-9]" | awk '{print $1}'); do
|
||||||
partitionPath="/dev/${device}${separator}${partNumber}"
|
partitionPath="/dev/${device}${separator}${partNumber}"
|
||||||
echo "# checking ${partitionPath}"
|
|
||||||
if blkid "${partitionPath}" | grep -q "TYPE=\"vfat\"" && \
|
if blkid "${partitionPath}" | grep -q "TYPE=\"vfat\"" && \
|
||||||
parted "/dev/${device}" print | grep "^ *${partNumber}" | grep -q "boot\|esp\|lba"; then
|
parted "/dev/${device}" print | grep "^ *${partNumber}" | grep -q "boot\|esp\|lba"; then
|
||||||
bootPartition="${device}${separator}${partNumber}"
|
bootPartition="${device}${separator}${partNumber}"
|
||||||
@@ -958,9 +957,7 @@ if [ "$1" = "kill-boot" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# make sure boot partition is not mounted
|
# make sure boot partition is not mounted
|
||||||
echo "# unmounting boot partition (${bootPartition}) (${partitionNumber})"
|
echo "# killing boot partition (${bootPartition})"
|
||||||
exit 1
|
|
||||||
|
|
||||||
umount "/dev/${bootPartition}" 2>/dev/null
|
umount "/dev/${bootPartition}" 2>/dev/null
|
||||||
parted --script "/dev/${device}" rm "${partitionNumber}"
|
parted --script "/dev/${device}" rm "${partitionNumber}"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
Reference in New Issue
Block a user