mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-07-06 05:26:35 +02:00
just remove boot
This commit is contained in:
@ -990,15 +990,30 @@ if [ "$1" = "kill-boot" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# make sure boot partition is not mounted
|
# remove boot flags from partition
|
||||||
echo "# killing boot partition (${bootPartition})"
|
echo "# removing boot flags from partition ${bootPartition}"
|
||||||
umount "/dev/${bootPartition}" 2>/dev/null
|
|
||||||
parted --script "/dev/${device}" rm "${partitionNumber}"
|
# check and remove boot flag
|
||||||
if [ $? -ne 0 ]; then
|
if parted "/dev/${device}" print | grep "^ *${partitionNumber}" | grep -q "boot"; then
|
||||||
echo "error='failed to remove boot partition'"
|
parted --script "/dev/${device}" set "${partitionNumber}" boot off
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check and remove esp flag
|
||||||
|
if parted "/dev/${device}" print | grep "^ *${partitionNumber}" | grep -q "esp"; then
|
||||||
|
parted --script "/dev/${device}" set "${partitionNumber}" esp off
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check and remove lba flag
|
||||||
|
if parted "/dev/${device}" print | grep "^ *${partitionNumber}" | grep -q "lba"; then
|
||||||
|
parted --script "/dev/${device}" set "${partitionNumber}" lba off
|
||||||
|
fi
|
||||||
|
|
||||||
|
# verify flags are removed
|
||||||
|
if parted "/dev/${device}" print | grep "^ *${partitionNumber}" | grep -q "boot\|esp\|lba"; then
|
||||||
|
echo "error='failed to remove boot flags'"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "# OK - boot partition removed"
|
echo "# OK - boot flags removed"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user