Patchwork [2/6] mkefidisk: Always specify a root= kernel parameter

login
register
mail settings
Submitter Darren Hart
Date March 19, 2013, 10:15 p.m.
Message ID <a45eaa0d5966fbb833744e2e3a85125312b2e0ea.1363731212.git.dvhart@linux.intel.com>
Download mbox | patch
Permalink /patch/46507/
State Accepted
Commit c38da2675bfd0c0c4e78cf65ef48295c75f6f16e
Headers show

Comments

Darren Hart - March 19, 2013, 10:15 p.m.
The current script only replaces an existing root= kernel parameter
which can result images created without a root= paremeter, even though
the script expects a target rootfs parameter.

Rather than replacing the root= parameter, delete the root= parameter if
it exists, then append an appropriate root= parameter.

Fixes [YOCTO 4035] mkefidisk.sh forgets to add root= parameter

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Koen Kooi <koen@dominion.thruhere.net>
---
 scripts/contrib/mkefidisk.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index 701a4d0..c68c224 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -250,8 +250,10 @@  sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
 sed -i "/initrd /d" $GRUBCFG
 # Delete any LABEL= strings
 sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
-# Replace the ramdisk root with the install device and include other options
-sed -i "s@ root=[^ ]*@ root=$TARGET_ROOTFS rw $ROOTWAIT quiet@" $GRUBCFG
+# Replace the ramdisk root (if any) with the install device and include other
+# kernel parameters
+sed -i "s@ root=[^ ]*@ @" $GRUBCFG
+sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS rw $ROOTWAIT quiet @" $GRUBCFG
 
 # Provide a startup.nsh script for older firmware with non-standard boot
 # directories and paths.