summaryrefslogtreecommitdiff
path: root/setup-disk.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-18 18:16:45 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-18 19:40:28 +0000
commit10480664171a28d0b64670f4941bdc32e8a355ee (patch)
tree9287f96854c4ee14d3cbed0ca7ca8a6a72b413c9 /setup-disk.in
parent83209a9785d3136f376cbe2f96c7603a2d2a8141 (diff)
downloadalpine-conf-10480664171a28d0b64670f4941bdc32e8a355ee.zip
setup-disk: use smaller ESP partition for UEFI
Grub's efi files are just a few MB, so we can reduce the size of the ESP. We also enforce FAT32, which requires minimum 32MB. Apparently many UEFI firmware implementations only support FAT32. https://wiki.osdev.org/EFI_System_Partition#Format
Diffstat (limited to 'setup-disk.in')
-rw-r--r--setup-disk.in7
1 files changed, 4 insertions, 3 deletions
diff --git a/setup-disk.in b/setup-disk.in
index b14bbe9..200393d 100644
--- a/setup-disk.in
+++ b/setup-disk.in
@@ -905,8 +905,9 @@ setup_boot_dev() {
bootdev=/dev/md0
fi
case "$BOOTFS" in
- btrfs) mkfs_args="";;
- ext4) mkfs_args="$mkfs_args -O ^64bit";; # pv-grub does not support 64bit
+ vfat) mkfs_args="-F 32";; # UEFI firmware often only support FAT32
+ btrfs) mkfs_args="";;
+ ext4) mkfs_args="$mkfs_args -O ^64bit";; # pv-grub does not support 64bit
esac
mkfs.$BOOTFS $MKFS_OPTS_BOOT $mkfs_args $bootdev
BOOT_DEV="$bootdev"
@@ -1462,7 +1463,7 @@ fi
if is_efi || [ -n "$USE_EFI" ]; then
USE_EFI=1
DISKLABEL=gpt
- BOOT_SIZE=${BOOT_SIZE:-512}
+ BOOT_SIZE=${BOOT_SIZE:-36} # UEFI needs fat32, which needs minimum 32MB
BOOTFS=vfat
: ${BOOTLOADER:=grub}
fi