From c0a0f2536ce0029f8beaac8485a87f5e66468ee5 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 25 Sep 2022 15:30:30 +0800 Subject: [PATCH] arm64: grub cfg: some improvements - Ensure /boot/efi is created before mounting ESP. - Delete already existing "LFS" boot entry in efivar. - Umount /sys/firmware/efi/efivars after running efibootmgr (or it causing troubles in "umount /sys"). - Mention "-e 3" which is needed for some UEFI implementation. --- chapter10/grub.xml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/chapter10/grub.xml b/chapter10/grub.xml index 8550c2bc9..6dcde599a 100644 --- a/chapter10/grub.xml +++ b/chapter10/grub.xml @@ -25,7 +25,9 @@ If you've installed GRUB for UEFI with optional dependencies following BLFS, you should skip this page, and config GRUB with UEFI support using the instructions provided in - the BLFS page. + the BLFS page, + but replace --target=x86_64-efi with + --target=arm64-efi for the ARM64 system. If your system does not support UEFI or you don't want to use it, @@ -99,7 +101,8 @@ /boot/efi (in the chroot), mount it now: -mount /boot/efi +mkdir -pv /boot/efi +mount /boot/efi The path to the device node is intentionally omitted in the @@ -171,10 +174,16 @@ variable for the newly installed boot loader. Install efibootmgr, then run the following commands: + mount -v -t efivarfs efivarfs /sys/firmware/efi/efivars -efibootmgr -c -L LFS -l \EFI\BOOT\BOOTAA64.EFI -d /dev/sda +efibootmgr -B -L LFS || true +efibootmgr -c -L LFS -l \EFI\BOOT\BOOTAA64.EFI -d /dev/sda +umount /sys/firmware/efi/efivars + Replace /dev/sda with the device node of the - hard drive where you are installing GRUB into. + hard drive where you are installing GRUB into. For some UEFI + firmwares, option may be needed for the + efibootmgr -c command.