Fix partitioning for pre-existing boot partitions
This commit is contained in:
parent
578e77235a
commit
dd991a91b3
1 changed files with 17 additions and 1 deletions
|
@ -36,17 +36,33 @@ done;
|
|||
bootDisk="${BOOT_DISK:-"${disks[1]}"}";
|
||||
swapDisk="${SWAP_DISK:-"${disks[2]}"}";
|
||||
linuxDisk="${LINUX_DISK:-"${disks[3]}"}";
|
||||
labels=("$SWAP_LABEL" "$OS_LABEL");
|
||||
|
||||
if ! isTruthy "$SKIP_FORMAT_EFI"
|
||||
then
|
||||
mkfs.fat -F 32 -n "$BOOT_LABEL" "$bootDisk";
|
||||
labels+=("$BOOT_LABEL");
|
||||
fi
|
||||
|
||||
mkswap -L "$SWAP_LABEL" "$swapDisk";
|
||||
mkfs.ext4 -L "$OS_LABEL" -F "$linuxDisk";
|
||||
|
||||
for label in ${labels[*]};
|
||||
do
|
||||
while true;
|
||||
do
|
||||
[ -b "/dev/disk/by-label/$label" ] && break;
|
||||
done;
|
||||
done
|
||||
|
||||
mount "/dev/disk/by-label/$OS_LABEL" "$OS_MOUNT_ROOT";
|
||||
mount --mkdir "/dev/disk/by-label/$BOOT_LABEL" "$OS_MOUNT_ROOT/boot";
|
||||
|
||||
if ! isTruthy "$SKIP_FORMAT_EFI"
|
||||
then
|
||||
bootDisk="/dev/disk/by-label/$BOOT_LABEL";
|
||||
fi
|
||||
|
||||
mount --mkdir "$bootDisk" "$OS_MOUNT_ROOT/boot";
|
||||
swapon "/dev/disk/by-label/$SWAP_LABEL";
|
||||
|
||||
if command -v extraMounts
|
||||
|
|
Loading…
Reference in a new issue