x86: fix grub-bios-setup fail during sysupgrade
[openwrt/staging/jow.git] / target / linux / x86 / image / Makefile
index 7864dfa1f80e0fb50c10820019edf06732f89af6..7a474e7a6eb8f1803e5cd9ec7c7f787f821b353e 100644 (file)
@@ -49,6 +49,9 @@ BOOTOPTS:=$(call qstrip,$(CONFIG_GRUB_BOOTOPTS))
 define Build/combined
        $(CP) $(KDIR)/$(KERNEL_NAME) $@.boot/boot/vmlinuz
        -$(CP) $(STAGING_DIR_ROOT)/boot/. $@.boot/boot/
+       $(CP) $(STAGING_DIR_IMAGE)/grub2/boot.img $@.boot/boot/grub/
+       $(CP) $(STAGING_DIR_IMAGE)/grub2/$(if $(filter $(1),efi),gpt,$(GRUB2_VARIANT))-core.img \
+               $@.boot/boot/grub/core.img
        $(if $(filter $(1),efi),
                $(INSTALL_DIR) $@.boot/efi/boot
                $(CP) $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_x86_64),x64,ia32).efi $@.boot/efi/boot/