From b0005b60ebeed1af1e4f24410fee6c9676cd5729 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 7 Jun 2018 22:18:32 +0100 Subject: [PATCH] flash-image: Use grub-install to install GRUB in EFI mode Signed-off-by: Michael Tremer --- lfs/flash-images | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/lfs/flash-images b/lfs/flash-images index f033042e15..67972a8404 100644 --- a/lfs/flash-images +++ b/lfs/flash-images @@ -84,14 +84,6 @@ endif S_BOOT := $(shell echo $$(( 262144 - $(S_OFFSET) ))) S_ROOT := 2477600 -ifeq "$(BUILD_ARCH)" "x86_64" - EFI_ARCH = x64 -endif - -ifeq "$(BUILD_ARCH)" "i586" - EFI_ARCH = ia32 -endif - PADDING = 100 # MB ifeq "$(EFI)" "1" @@ -215,15 +207,15 @@ ifeq "$(BOOTLOADER)" "grub" grub-install --force --recheck --no-floppy --target=i386-pc \ --root-directory=$(MNThdd) $(DEVICE) +ifeq "$(EFI)" "1" + # Install GRUB for EFI + grub-install --target=$(BUILD_ARCH)-efi --removable --no-nvram \ + --boot-directory=$(MNThdd)/boot --efi-directory=$(MNThdd)/boot/efi +endif + # restore orginal defaults mv -f $(MNThdd)/etc/default/grub.backup $(MNThdd)/etc/default/grub rm -f $(MNThdd)/etc/grub.d/11_linux_scon - -ifeq "$(EFI)" "1" - mkdir -pv $(MNThdd)/boot/efi/EFI/boot - cp -vf $(MNThdd)/boot/efi/EFI/ipfire/grub-efi/grub.efi \ - $(MNThdd)/boot/efi/EFI/boot/boot$(EFI_ARCH).efi -endif endif # Set ramdisk mode to automatic -- 2.39.5