[oe-commits] Krzysztof Sywula : initrdscripts: add $CMDLINE to init-live switch_root

git at git.openembedded.org git at git.openembedded.org
Thu Jan 16 12:07:37 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 5a2f4feeaac4f9278fa0cf808c2f495f0c19324f
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=5a2f4feeaac4f9278fa0cf808c2f495f0c19324f

Author: Krzysztof Sywula <krzysztof.m.sywula at intel.com>
Date:   Wed Jan 15 11:27:04 2014 +0000

initrdscripts: add $CMDLINE to init-live switch_root

init-live.sh: $CMDLINE variable should be provided to switch_root
to let user specify runlevel on grub command line.
Feeding with -c /dev/console as well as busybox switch_root enables that option.

Signed-off-by: Krzysztof Sywula <krzysztof.m.sywula at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-core/initrdscripts/files/init-live.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index bd259b9..7e27f91 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -89,7 +89,10 @@ boot_live_root() {
     mount -n --move /dev ${ROOT_MOUNT}/dev
 
     cd $ROOT_MOUNT
-    exec switch_root $ROOT_MOUNT /sbin/init
+
+    # busybox switch_root supports -c option
+    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init $CMDLINE ||
+        fatal "Couldn't switch_root, dropping to shell"
 }
 
 fatal() {



More information about the Openembedded-commits mailing list