aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Erdmann <dywi@mailerd.de>2015-03-02 21:08:32 +0100
committerAndre Erdmann <dywi@mailerd.de>2019-04-27 18:43:56 +0200
commita6979ab2ef49d833f0be6c39f54e36c30d7d6a4b (patch)
tree4a7b14350a40fef8a04fb8e4f57198a27b1bd2eb
parentfunctions.sh: "<cmd> $(eval echo...)" => "eval <cmd>" (diff)
downloadbetter-initramfs-a6979ab2ef49d833f0be6c39f54e36c30d7d6a4b.tar.xz
better-initramfs-a6979ab2ef49d833f0be6c39f54e36c30d7d6a4b.zip
functions.sh, rescueshell: use cttyhack if available
This allows to bypass the hardcoded shell on /dev/tty1 if console= is not given on the cmdline.
-rwxr-xr-xsourceroot/functions.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/sourceroot/functions.sh b/sourceroot/functions.sh
index 79ce366..fff79cf 100755
--- a/sourceroot/functions.sh
+++ b/sourceroot/functions.sh
@@ -53,6 +53,8 @@ rescueshell() {
ewarn "If you wish resume booting process, run 'resume-boot'."
if [ "$console" ] && [ -c "/dev/${console}" ]; then
setsid sh -c "exec sh --login </dev/"${console}" >/dev/${console} 2>&1"
+ elif command -v cttyhack 1>/dev/null 2>&1; then
+ setsid cttyhack sh --login
elif [ -c '/dev/tty1' ]; then
setsid sh -c 'exec sh --login </dev/tty1 >/dev/tty1 2>&1'
else