Skip to content

setup-disk: increase default boot partition size from 100 to 512 MiB

Jakub Jirutka requested to merge jirutka/alpine-conf:setup-disk-boot-size into master

Consider my laptop with linux-lts on UEFI with Secure Boot:

System.map-lts.....4 MiB
initramfs-lts.....36 MiB
vmlinuz-lts........8 MiB
linux-lts.efi.....44 MiB (signed Unified Kernel Image)
linux-lts.efi.bak 44 MiB (backup of the previous)
Total............136 MiB

256 MiB might be enough, but what if the user wants to experiment with more kernel variants? It would be still too tight. On the other side, if the user has only 1 GiB disk (e.g. ncopa uses 1GiB images for testing), then even 256 MiB would be too much.

Originally, I just increased the default to 512 MiB, but ncopa pointed out that it's too much for small disks and he personally uses 1GiB disks (images) for testing. For this reason, I chose a more sophisticated approach that takes into account the size of the disk.

  • 512 MiB if disk > 8 GiB
  • 264 MiB if disk > 2 GiB
  • 160 MiB otherwise

And the size is never lower than the approximate minimal allowed size of the FAT32 filesystem for the disk's block size (32 MiB for 512 bytes blocks, 260 MiB for 4096 bytes blocks).

Issue reported by Andrey Maslyuk andrey@maslyuk.net (via email).

Edited by Jakub Jirutka

Merge request reports

Loading