diff options
author | Paul Spooren <mail@aparcar.org> | 2020-03-20 00:10:54 -1000 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2020-03-21 10:36:00 +0000 |
commit | 5a5df62d95f52892c9a24fe1216796a2a903e544 (patch) | |
tree | 14cdfab3e4fb023d23e58f352f542a86b551a216 /target | |
parent | e6e1e12dc3230bdadf74485dbf47beb52570920c (diff) | |
download | upstream-5a5df62d95f52892c9a24fe1216796a2a903e544.tar.gz upstream-5a5df62d95f52892c9a24fe1216796a2a903e544.tar.bz2 upstream-5a5df62d95f52892c9a24fe1216796a2a903e544.zip |
x86/grub2: move grub2 image creation to package
Let the grub2 package take care of creating installable grub2 images,
this will allow creating grub2 images without first calling x86 image
generation recipe. Also as side effect, since those images are now
shared, it'll reduce the number of calling grub-mkimage.
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[rebase, adjusted commit title]
Signed-off-by: Paul Spooren <mail@aparcar.org>
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/x86/image/Makefile | 30 | ||||
-rw-r--r-- | target/linux/x86/image/grub-early.cfg | 1 |
2 files changed, 8 insertions, 23 deletions
diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index 373f2396b7..4e090bcf07 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -9,8 +9,7 @@ include $(INCLUDE_DIR)/image.mk export PATH=$(TARGET_PATH):/sbin -GRUB2_MODULES = biosdisk boot chain configfile ext2 linux ls part_msdos reboot serial test vga -GRUB2_MODULES_ISO = biosdisk boot chain configfile iso9660 linux ls part_msdos reboot serial test vga +GRUB2_VARIANT = GRUB_TERMINALS = GRUB_SERIAL_CONFIG = GRUB_TERMINAL_CONFIG = @@ -19,8 +18,9 @@ GRUB_CONSOLE_CMDLINE = USE_ATKBD = generic 64 ifneq ($(strip $(foreach subtarget,$(USE_ATKBD),$(CONFIG_TARGET_x86_$(subtarget)))),) - GRUB2_MODULES += at_keyboard - GRUB2_MODULES_ISO += at_keyboard + GRUB2_VARIANT := generic +else + GRUB2_VARIANT := legacy endif ifneq ($(CONFIG_GRUB_CONSOLE),) @@ -63,14 +63,9 @@ ifneq ($(CONFIG_GRUB_IMAGES),) rm -fR $(KDIR)/root.grub $(KDIR)/grub2 $(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)/root.grub/boot/grub/core.img \ - -O i386-pc \ - -c ./grub-early.cfg \ - $(GRUB2_MODULES) - $(CP) $(STAGING_DIR_HOST)/lib/grub/i386-pc/*.img $(KDIR)/root.grub/boot/grub/ + $(CP) $(STAGING_DIR_HOST)/lib/grub/i386-pc/*.img \ + $(STAGING_DIR_HOST)/lib/grub/grub2-$(strip $(GRUB2_VARIANT))/core.img \ + $(KDIR)/grub2/ echo '(hd0) $(BIN_DIR)/$(IMG_COMBINED)-$(1).img' > $(KDIR)/grub2/device.map sed \ -e 's#@SERIAL_CONFIG@#$(strip $(GRUB_SERIAL_CONFIG))#g' \ @@ -98,16 +93,7 @@ define Image/Build/iso rm -fR $(KDIR)/root.grub $(KDIR)/grub2 $(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 \ - -c ./grub-early.cfg \ - $(GRUB2_MODULES_ISO) - cat \ - $(STAGING_DIR_HOST)/lib/grub/i386-pc/cdboot.img \ - $(KDIR)/grub2/eltorito.img \ + $(STAGING_DIR_HOST)/lib/grub/grub2-iso/eltorito.img \ > $(KDIR)/root.grub/boot/grub/eltorito.img sed \ -e 's#@SERIAL_CONFIG@#$(strip $(GRUB_SERIAL_CONFIG))#g' \ diff --git a/target/linux/x86/image/grub-early.cfg b/target/linux/x86/image/grub-early.cfg deleted file mode 100644 index 4a5b5a6092..0000000000 --- a/target/linux/x86/image/grub-early.cfg +++ /dev/null @@ -1 +0,0 @@ -configfile (hd0,msdos1)/boot/grub/grub.cfg |