From 0eb1f692169f6b833315896f65bdc9587e52624d Mon Sep 17 00:00:00 2001 From: MrChromebox Date: Wed, 16 Sep 2020 16:46:22 -0500 Subject: [PATCH] functions/recovery: loop recovery shell when exited (#835) Currently, exiting the recovery shell results in a kernel panic, necessitating a hard reset / power cycle. As this is less than ideal, drop the exec and add a loop to restart the shell. Addresses issue #833 Tested under qemu-coreboot-fbwhiptail Signed-off-by: Matt DeVillier --- initrd/etc/functions | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/initrd/etc/functions b/initrd/etc/functions index a5935f61..03559d5a 100755 --- a/initrd/etc/functions +++ b/initrd/etc/functions @@ -25,14 +25,20 @@ recovery() { if [ "$CONFIG_TPM" = y ]; then tpm extend -ix 4 -ic recovery fi - echo >&2 "!!!!! Starting recovery shell" - sleep 1 - if [ -x /bin/setsid ]; then - exec /bin/setsid -c /bin/ash - else - exec /bin/ash - fi + while [ true ] + do + echo >&2 "!!!!! Starting recovery shell" + sleep 1 + + if [ -x /bin/setsid ]; then + /bin/setsid -c /bin/ash + else + /bin/ash + fi + # clear screen + printf "\033c" + done } pause_recovery() {