]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
TEST-20-NFS:client-init.sh: add shell on rd.shell
authorHarald Hoyer <harald@redhat.com>
Fri, 1 Aug 2014 11:15:05 +0000 (13:15 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 1 Aug 2014 11:15:05 +0000 (13:15 +0200)
test/TEST-20-NFS/client-init.sh

index a16db3ceb576b50362248bdf93da25b893a6147a..a1c45909ea66e24d20efab6de0cc136c2d014da6 100755 (executable)
@@ -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