On 01/15/2014 07:27 PM, krzysztof.m.syw...@intel.com wrote:
From: Krzysztof Sywula <krzysztof.m.syw...@intel.com>

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.syw...@intel.com>
---
  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() {

I once sent out a patch to remove the '-c /dev/console' because this is busybox specific.
What if util-linux gets installed in the initramfs?

Could you please state what the benefit is with this option? Maybe in the comment? The disadvantage is obvious, because if you have util-linux in initramfs, the 'switch_root' command doesn't support that option, and the 'switch_root' command would always fail.

Best Regards,
Chen Qi
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to