]> git.ipfire.org Git - people/ms/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>
Thu, 7 Jun 2018 21:18:32 +0000 (22:18 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/flash-images

index f033042e1593e3105e7550d1f8c7493ab054f1df..67972a840452ac46be40e477500f0878433735b1 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"
@@ -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