Make different partitions for BIOS and UEFI
This commit is contained in:
parent
535e8ce953
commit
57e63b05de
36
install.sh
36
install.sh
@ -145,14 +145,31 @@ partition() {
|
|||||||
[ -f /bin/parted ] || download_parted
|
[ -f /bin/parted ] || download_parted
|
||||||
|
|
||||||
echo -n "Partitioning drive..."
|
echo -n "Partitioning drive..."
|
||||||
|
if [ $UEFI -eq 0 ]; then
|
||||||
|
# Legacy
|
||||||
|
parted --script "$DRIVE_TARGET" \
|
||||||
|
mklabel msdos \
|
||||||
|
mkpart swap linux-swap 0% 4GiB \
|
||||||
|
mkpart root ext4 4GiB 100%
|
||||||
|
echo "done"
|
||||||
|
else
|
||||||
|
# EFI
|
||||||
parted --script "$DRIVE_TARGET" \
|
parted --script "$DRIVE_TARGET" \
|
||||||
mklabel gpt \
|
mklabel gpt \
|
||||||
mkpart swap ext4 1MiB 4GiB \
|
mkpart swap linux-swap 0% 4GiB \
|
||||||
mkpart boot ext4 4GiB 5Gib \
|
mkpart boot fat32 4GiB 5Gib \
|
||||||
mkpart root ext4 5GiB 100%
|
mkpart root ext4 5GiB 100% \
|
||||||
[ $UEFI -eq 0 ] && parted --script "$DRIVE_TARGET" set 2 bios_grub on
|
set 2 esp on
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
|
echo -n "Configuring BOOT partition..."
|
||||||
|
quiet mkfs.fat -F 32 "$DRIVE_TARGET"2
|
||||||
|
fatlabel "$DRIVE_TARGET"2 BOOT
|
||||||
|
mkdir /mnt/boot
|
||||||
|
mount "$DRIVE_TARGET"2 /mnt/boot
|
||||||
|
echo "done"
|
||||||
|
fi
|
||||||
|
|
||||||
echo -n "Configuring SWAP partition..."
|
echo -n "Configuring SWAP partition..."
|
||||||
quiet mkswap -L SWAP "$DRIVE_TARGET"1
|
quiet mkswap -L SWAP "$DRIVE_TARGET"1
|
||||||
quiet swapon "$DRIVE_TARGET"1
|
quiet swapon "$DRIVE_TARGET"1
|
||||||
@ -162,17 +179,6 @@ partition() {
|
|||||||
quiet mkfs.ext4 -L ROOT "$DRIVE_TARGET"3
|
quiet mkfs.ext4 -L ROOT "$DRIVE_TARGET"3
|
||||||
quiet mount "$DRIVE_TARGET"3 /mnt
|
quiet mount "$DRIVE_TARGET"3 /mnt
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
echo -n "Configuring BOOT partition..."
|
|
||||||
if [ $UEFI -eq 1 ]; then
|
|
||||||
quiet mkfs.fat -F 32 "$DRIVE_TARGET"2
|
|
||||||
fatlabel "$DRIVE_TARGET"2 BOOT
|
|
||||||
else
|
|
||||||
quiet mkfs.ext4 -L BOOT "$DRIVE_TARGET"2
|
|
||||||
fi
|
|
||||||
mkdir /mnt/boot
|
|
||||||
mount "$DRIVE_TARGET"2 /mnt/boot
|
|
||||||
echo "done"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
install_base() {
|
install_base() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user