summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2012-02-07 19:19:55 +0100
committerHarald Hoyer <harald@redhat.com>2012-02-07 19:44:03 +0100
commit59feafc6c7e3f02ce0584871b179a41b28844654 (patch)
tree2eb0455115c3667dfd81ce9f8c76ff65c3cc0829
parent5ccc88a74236aa88b1691d6a9f895535ce20270a (diff)
downloaddracut-59feafc6c7e3f02ce0584871b179a41b28844654.tar.gz
dracut-59feafc6c7e3f02ce0584871b179a41b28844654.tar.bz2
dracut-59feafc6c7e3f02ce0584871b179a41b28844654.zip
use "openvt" for emergency shell
-rw-r--r--dracut.conf.d/fedora.conf.example2
-rwxr-xr-xmodules.d/99base/init2
-rwxr-xr-xmodules.d/99shutdown/shutdown2
3 files changed, 5 insertions, 1 deletions
diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example
index 92dd9671..45063c66 100644
--- a/dracut.conf.d/fedora.conf.example
+++ b/dracut.conf.d/fedora.conf.example
@@ -7,4 +7,4 @@ omit_dracutmodules+=" dash "
stdloglvl=3
prefix=/run/initramfs
realinitpath="/usr/lib/systemd/systemd"
-install_items+=" vi /etc/virc ps grep cat rm "
+install_items+=" vi /etc/virc ps grep cat rm openvt "
diff --git a/modules.d/99base/init b/modules.d/99base/init
index f8d52f70..9e189da0 100755
--- a/modules.d/99base/init
+++ b/modules.d/99base/init
@@ -64,6 +64,8 @@ emergency_shell()
_ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
[ -c "$_ctty" ] || _ctty=/dev/tty1
setsid sh -i -l 0<$_ctty 1>$_ctty 2>&1
+ elif [ -n "$(command -v openvt)" ] && ! getarg "console=" >/dev/null 2>&1 && getargbool 1 "rd.openvt" ; then
+ openvt -f -c 1 -w -s -l -- sh
else
sh -i -l 0<$_ctty 1>$_ctty 2>&1
fi
diff --git a/modules.d/99shutdown/shutdown b/modules.d/99shutdown/shutdown
index 019a451a..64937fa7 100755
--- a/modules.d/99shutdown/shutdown
+++ b/modules.d/99shutdown/shutdown
@@ -36,6 +36,8 @@ emergency_shell()
_ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
[ -c "$_ctty" ] || _ctty=/dev/tty1
setsid sh -i -l 0<$_ctty 1>$_ctty 2>&1
+ elif [ -n "$(command -v openvt)" ] && ! getarg "console=" >/dev/null 2>&1 && getargbool 1 "rd.openvt" ; then
+ openvt -f -c 1 -w -s -l -- sh
else
sh -i -l 0<$_ctty 1>$_ctty 2>&1
fi