GRUB2: How do you build it? How do you use it?
1) Building
(i) Build and install efivar, efibootmgr and fuse2 packages.
(ii) Build grub2
MBR booting:
./configure --prefix=/usr
grub-install gets you /usr/lib/grub/i386-pc.
UEFI booting
./configure --prefix=/usr --sysconfdir=/etc --enable-grub-mount -with-platform=efi -target=x86_64 -enable-grub-mkfont
grub-install --target=x86_64-efi --efi-directory=/boot/efi --removable --boot-directory=/boot/efi/EFI --bootloader-id=grub /dev/sda
for this you will have created /dev/sda1
vfat (fat32) formated partition of about
100 M whith flags boot,esp and mounted on /boot/efi
TROUBLESHOOTING
- EFI variables are not supported on this system.
grub-install: error: efibootmgr failed to register the boot entry
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
- unknown file system
tune2fs -l /dev/sdxy will report metadata_csum_seed.
Resolved with
tune2fs -O ^metadata_csum_seed /dev/sdxy