]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
flash-image: Use grub-install to install GRUB in EFI mode
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 7 Jun 2018 21:18:32 +0000 (22:18 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 14 Jul 2018 12:43:51 +0000 (13:43 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/flash-images

index 900f526fb86b19d1e22f63ecb3bb94aaf977f8eb..3fe1444b9383924141c07a97b2629220376fda3d 100644 (file)
@@ -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"
@@ -213,15 +205,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