package/mender-grubenv: fix installing on non-efi platforms
authorAdam Duskett <aduskett@gmail.com>
Thu, 13 May 2021 02:00:52 +0000 (19:00 -0700)
committerYann E. MORIN <yann.morin.1998@free.fr>
Sat, 15 May 2021 12:53:09 +0000 (14:53 +0200)
Currently, mender-grubenv unconditionally installs files from the
$(TARGET_DIR)/boot/EFI directory to the $(BINARIES_DIR)/efi-part.
This fails on systems that are not building grub against EFI.

Add a check in mender-grubenv.mk to ensure the files are copied to the correct
location if EFI is not selected.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/mender-grubenv/mender-grubenv.mk

index ade0f4c0ed50f86531f2901d66e5680bd62401bb..f06dbbe35ca36ce8caa2f9cd4f35105e23d9b583 100644 (file)
@@ -55,11 +55,20 @@ define MENDER_GRUBENV_INSTALL_TARGET_CMDS
 endef
 
 # Overwrite the default grub2 config files with the ones in this package.
+ifeq ($(BR2_TARGET_GRUB2_I386_PC)$(BR2_TARGET_GRUB2_ARM_UBOOT),y)
+define MENDER_GRUBENV_INSTALL_IMAGES_CMDS
+       mkdir -p $(BINARIES_DIR)/boot-part/grub
+       cp -dpfr $(TARGET_DIR)/boot/grub/grub.cfg \
+               $(TARGET_DIR)/boot/grub/mender_grubenv* \
+               $(BINARIES_DIR)/boot-part/grub
+endef
+else
 define MENDER_GRUBENV_INSTALL_IMAGES_CMDS
        mkdir -p $(BINARIES_DIR)/efi-part/EFI/BOOT
        cp -dpfr $(TARGET_DIR)/boot/EFI/BOOT/grub.cfg \
                $(TARGET_DIR)/boot/EFI/BOOT/mender_grubenv* \
                $(BINARIES_DIR)/efi-part/EFI/BOOT
 endef
+endif
 
 $(eval $(generic-package))