For that first 16MB partition it would be nice to use GPT type EF02
(BIOS boot partition) so partitioning tools will see that it is
partition for bootloaders.

I created test 512MB disk and created some partitions by hand:

gdisk:
Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048           34815   16.0 MiB    EF02  BIOS boot partition
   2           34816          165887   64.0 MiB    EF00  EFI system partition
   3          165888          690175   256.0 MiB   8300  Linux filesystem
   4          690176          915455   110.0 MiB   8E00  Linux LVM

parted:
Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  17.8MB  16.8MB               BIOS boot partition   bios_grub
 2      17.8MB  84.9MB  67.1MB               EFI system partition  boot, esp
 3      84.9MB  353MB   268MB                Linux filesystem
 4      353MB   469MB   115MB                Linux LVM             lvm

Parted is a tool from MBR era and it's support GPT is poor that's why
it has 'Flags' column with 'what parted thinks it is'.


This way part1/ef02 is not formatted, part2/ef00 is vfat (never
mind which variant) and rest of partitions are formatted to whatever
filesystem OS wants.

Separate /boot/ is handy if user wants to have / on LVM (crypted or
not) as this allows 'OS loader' (grub-efi in Debian) to load kernel,
initramfs (and dtb if needed) from /boot and start the OS.


And for our sanity we pretend that whatever firmware system is using
(edk2, u-boot, barebox, etc.) it knows how to load 'OS loader' EFI
binary from EF00 partition. For Debian it means grub2-efi.

If hardware does not handle EFI variables (so we can not store
BootOrder vars) then /efi/boot/bootaa64.efi should be written as this
is default name for OS loader in EFI/aarch64 world.

Reply via email to