TEST-20-NFS:client-init.sh: add shell on rd.shell

master
Harald Hoyer 2014-08-01 13:15:05 +02:00
parent ba7dab6dba
commit 28d03673f9
1 changed files with 7 additions and 3 deletions

View File

@ -7,14 +7,18 @@ CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
strstr() { [ "${1##*"$2"*}" != "$1" ]; }

stty sane
strstr "$CMDLINE" "rd.shell" && sh -i
if strstr "$CMDLINE" "rd.shell"; then
[ -c /dev/watchdog ] && echo -n 'V' > /dev/watchdog
strstr "$(setsid --help)" "control" && CTTY="-c"
setsid $CTTY sh -i
fi

echo "made it to the rootfs! Powering down."

while read dev fs fstype opts rest; do
[ "$fstype" != "nfs" -a "$fstype" != "nfs4" ] && continue
echo "nfs-OK $dev $fstype $opts" > /dev/sda
break
done < /proc/mounts
#echo 'V' > /dev/watchdog
#sh -i
>/dev/watchdog
poweroff -f