From 754e3c916514b2ce13d7a61c4975448b97307b99 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Mon, 23 Oct 2023 13:11:49 -0400 Subject: [PATCH] bin/reboot: intercept reboot call when in DEBUG mode to type 'r' to go to recovery shell instead of rebooting Signed-off-by: Thierry Laurion --- initrd/bin/reboot | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/initrd/bin/reboot b/initrd/bin/reboot index 30f6b7d8..030a7ea6 100755 --- a/initrd/bin/reboot +++ b/initrd/bin/reboot @@ -3,6 +3,15 @@ TRACE "Under /bin/reboot" +if [ "$CONFIG_DEBUG_OUTPUT" = "y" ];then + #Generalize user prompt to continue reboot or go to recovery shell + read -p "Press any key to continue reboot or 'r' to go to recovery shell: " -n 1 -r + echo + if [[ $REPLY =~ ^[Rr]$ ]]; then + recovery "Reboot call bypassed to go into recovery shell to debug" + fi +fi + # Shut down TPM if [ "$CONFIG_TPM" = "y" ]; then tpmr shutdown