x86: fix GRUB_ROOT for Xen subtarget
authorWilfried Klaebe <w+lede-project@chaos.in-kiel.de>
Fri, 11 Nov 2016 13:50:00 +0000 (15:50 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 19 Nov 2016 10:45:29 +0000 (11:45 +0100)
Change grub's root device to xen/xvda,msdos1 for the x86_xen_domu
target so that it will boot without further changes.

Signed-off-by: Wilfried Klaebe <w+lede-project@chaos.in-kiel.de>
[Jo-Philipp Wich: fixed and rebased patch from FS#264, added subject]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
target/linux/x86/image/Makefile
target/linux/x86/image/grub.cfg

index a210c902e58c29e2e020f352a2761d7ee7c5ed0b..99887cb32b723bb35cf6257c3543b0c06984be1c 100644 (file)
@@ -15,6 +15,7 @@ GRUB_TERMINALS =
 GRUB_SERIAL_CONFIG =
 GRUB_TERMINAL_CONFIG =
 GRUB_CONSOLE_CMDLINE =
+GRUB_ROOT = hd0,msdos1
 
 USE_ATKBD = generic 64
 
@@ -46,6 +47,10 @@ ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(SIGNATURE)-02)
 
 GRUB_TIMEOUT:=$(call qstrip,$(CONFIG_GRUB_TIMEOUT))
 
+ifneq ($(CONFIG_TARGET_x86_xen_domu),)
+  GRUB_ROOT = xen/xvda,msdos1
+endif
+
 ifneq ($(CONFIG_GRUB_IMAGES),)
 
   BOOTOPTS:=$(call qstrip,$(CONFIG_GRUB_BOOTOPTS))
@@ -75,6 +80,7 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
                -e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \
                -e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \
                -e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \
+               -e 's#@ROOT@#$(GRUB_ROOT)#g' \
                ./grub.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg
        PADDING="$(CONFIG_TARGET_IMAGES_PAD)" SIGNATURE="$(SIGNATURE)" PATH="$(TARGET_PATH)" ./gen_image_generic.sh \
                $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \
index f1a577cdd7ca418f9b822efbebc2b2ac27d46e32..acca036a2e52d5ac89b07f2e78b3f0b8d3b646c8 100644 (file)
@@ -3,7 +3,7 @@
 
 set default="0"
 set timeout="@TIMEOUT@"
-set root='(hd0,msdos1)'
+set root='(@ROOT@)'
 
 menuentry "LEDE" {
        linux /boot/vmlinuz @CMDLINE@ noinitrd