[ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab
stty sane
echo "made it to the rootfs!"
-strstr "$CMDLINE" "rd.shell" && sh -i
+if strstr "$CMDLINE" "rd.shell"; then
+ strstr "$(setsid --help)" "control" && CTTY="-c"
+ setsid $CTTY sh -i
+fi
echo "Powering down."
mount -n -o remount,ro /
poweroff -f
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
mount dmesg ifconfig dhclient mkdir cp ping dhclient \
- umount strace less
+ umount strace less setsid
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
[ -f ${_terminfodir}/l/linux ] && break
done