]> code.ossystems Code Review - openembedded-core.git/commitdiff
initramfs-framework: support dropping into shell on failure
authorPatrick Ohly <patrick.ohly@intel.com>
Mon, 7 Sep 2015 11:16:38 +0000 (13:16 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 12 Sep 2015 21:47:20 +0000 (22:47 +0100)
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@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/initrdscripts/initramfs-framework/init

index e8f4713b521d3ff9b378a37b58a8568b27bc7686..9291ad5c219299ffd84ffada3b2ce064ad3e10a9 100755 (executable)
@@ -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