[source] x86: fix GRUB_ROOT for Xen subtarget

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 19 02:45:39 PST 2016


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

commit 81e3c022e017be76d4f3eaf67cfd7ddba09e85be
Author: Wilfried Klaebe <w+lede-project at chaos.in-kiel.de>
AuthorDate: Fri Nov 11 15:50:00 2016 +0200

    x86: fix GRUB_ROOT for Xen subtarget
    
    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 at chaos.in-kiel.de>
    [Jo-Philipp Wich: fixed and rebased patch from FS#264, added subject]
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 target/linux/x86/image/Makefile | 6 ++++++
 target/linux/x86/image/grub.cfg | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
index a210c90..99887cb 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile
@@ -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 \
diff --git a/target/linux/x86/image/grub.cfg b/target/linux/x86/image/grub.cfg
index f1a577c..acca036 100644
--- a/target/linux/x86/image/grub.cfg
+++ b/target/linux/x86/image/grub.cfg
@@ -3,7 +3,7 @@
 
 set default="0"
 set timeout="@TIMEOUT@"
-set root='(hd0,msdos1)'
+set root='(@ROOT@)'
 
 menuentry "LEDE" {
 	linux /boot/vmlinuz @CMDLINE@ noinitrd



More information about the lede-commits mailing list