busybox: don't fix GPT tables when partition scheme is MBR

This commit is contained in:
chewitt 2018-09-07 07:57:03 +01:00 committed by Christian Hewitt
parent a3c73c3370
commit e0b3dbf010

View File

@ -48,8 +48,11 @@ if [ -e /storage/.please_resize_me ] ; then
echo "Please do not reboot or turn off your @DISTRONAME@ device!" echo "Please do not reboot or turn off your @DISTRONAME@ device!"
echo "" echo ""
# fix any minor issues, such as gpt header not at end of disk # identify the partition scheme, and if gpt fix minor issues such as gpt header not at end of disk
StartProgress spinner "Checking layout... " "sgdisk -e $DISK &>/dev/null" SCHEME=$(blkid -s PTTYPE -o value $DISK)
if [ "$SCHEME" = "gpt" ]; then
StartProgress spinner "Checking layout... " "sgdisk -e $DISK &>/dev/null"
fi
StartProgress spinner "Deleting /storage... " "parted -s -m $DISK rm 2 &>/dev/null" StartProgress spinner "Deleting /storage... " "parted -s -m $DISK rm 2 &>/dev/null"
StartProgress spinner "Creating /storage... " "parted -s -m $DISK unit b mkpart primary $PART_START 100% &>/dev/null" StartProgress spinner "Creating /storage... " "parted -s -m $DISK unit b mkpart primary $PART_START 100% &>/dev/null"