summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2019-03-31 16:41:12 -0600
committerAaron Ball <nullspoon@oper.io>2019-03-31 16:41:12 -0600
commit42c4949feddb2c7b126cd41d345d79600df05a61 (patch)
tree0ed997a84ac43cc87a59416bd28e235d36255456
parent08d69e6d5b1d529f91745419065d4a2879b717af (diff)
downloadmkinitramfs-42c4949feddb2c7b126cd41d345d79600df05a61.tar.gz
mkinitramfs-42c4949feddb2c7b126cd41d345d79600df05a61.tar.xz
init:Add debug shell and auto reboot on failure to decrypt root
-rwxr-xr-xinit9
1 files changed, 6 insertions, 3 deletions
diff --git a/init b/init
index d1e6f57..66b0ddc 100755
--- a/init
+++ b/init
@@ -99,9 +99,12 @@ setup_encrypted() {
# Notify user and wait for input on failure
if [ "$?" -gt 0 ]; then
- echo "An error was detected mounting the encrypted root." >&2
- echo "Pausing. Press enter to continue." >&2
- read
+ # Ensure decryption was successful, it not, drop to debug shell and reboot once done.
+ printf 'ERROR: Could not decrypt device\n' >&2
+ printf 'Dropping to debug shell (will automatically reboot on exit).\n' >&2
+ /bin/bash --norc
+ printf 'Rebooting\n' >&2
+ init 6
fi
# Probe the new crypto device for an additional partition table

Generated by cgit