[source] target/linux/x86/image: add explicit prefix to grub-mkimage command

LEDE Commits lede-commits at lists.infradead.org
Tue Dec 20 07:32:28 PST 2016


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/81a2f9d6f8612e5f0f440a9690a711d1c2d3fbc5

commit 81a2f9d6f8612e5f0f440a9690a711d1c2d3fbc5
Author: Alexandru Ardelean <ardeleanalex at gmail.com>
AuthorDate: Wed Nov 23 10:27:55 2016 +0200

    target/linux/x86/image: add explicit prefix to grub-mkimage command
    
    In the latest version of grub-mkimage, the prefix option is mandatory.
    Not supplying it fails with:
    ```
    Prefix not specified (use the -p option).
    ```
    
    In grub-2.02-beta2 a DEFAULT_DIRECTORY was defined
    in `include/grub/osdep/hostfile_unix.h` as:
    ```
     #if defined (__NetBSD__)
     /* NetBSD uses /boot for its boot block.  */
     # define DEFAULT_DIRECTORY  "/"GRUB_DIR_NAME
     #else
     # define DEFAULT_DIRECTORY  "/"GRUB_BOOT_DIR_NAME"/"GRUB_DIR_NAME
     #endif
    ```
    
    Where:
    * GRUB_BOOT_DIR_NAME == boot
    * GRUB_DIR_NAME == grub
    
    This was used if the -p option was omitted.
    
    Signed-off-by: Alexandru Ardelean <ardeleanalex at gmail.com>
---
 target/linux/x86/image/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
index 99887cb..965737a 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile
@@ -68,6 +68,7 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
 	$(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2
 	$(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
 	grub-mkimage \
+		-p /boot/grub \
 		-d $(STAGING_DIR_HOST)/lib/grub/i386-pc \
 		-o $(KDIR)/grub2/core.img \
 		-O i386-pc \
@@ -106,6 +107,7 @@ define Image/Build/iso
 	$(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2
 	$(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
 	grub-mkimage \
+		-p /boot/grub \
 		-d $(STAGING_DIR_HOST)/lib/grub/i386-pc \
 		-o $(KDIR)/grub2/eltorito.img \
 		-O i386-pc \



More information about the lede-commits mailing list