[oe-commits] Patrick Ohly : initramfs-framework: support dropping into shell on failure

git at git.openembedded.org git at git.openembedded.org
Wed Sep 9 21:58:31 UTC 2015


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

Author: Patrick Ohly <patrick.ohly at intel.com>
Date:   Mon Sep  7 13:16:38 2015 +0200

initramfs-framework: support dropping into shell on failure

When the init_fatal_sh boot parameter is present (i.e. used without
value) and a fatal problem occurs inside the initramfs-module, a shell
will be started instead of looping forever.

Useful for debugging.

Interestingly enough, the code was already indented to support such an
if check...

Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/recipes-core/initrdscripts/initramfs-framework/init | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/init b/meta/recipes-core/initrdscripts/initramfs-framework/init
index e8f4713..9291ad5 100755
--- a/meta/recipes-core/initrdscripts/initramfs-framework/init
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/init
@@ -58,9 +58,13 @@ fatal() {
     echo $1 >/dev/console
     echo >/dev/console
 
+    if [ -n "bootparam_init_fatal_sh" ]; then
+        sh
+    else
 	while [ "true" ]; do
 		sleep 3600
 	done
+    fi
 }
 
 # Variables shared amoung modules



More information about the Openembedded-commits mailing list