dracut/0016-TEST-20-NFS-client-init.sh-add-shell-on-rd.shell.patch
Harald Hoyer 89f6faed2b dracut-038-30.git20140815
- git snapshot
2014-08-15 13:59:08 +02:00

36 lines
1.1 KiB
Diff

From 28d03673f9aa76b041ce9a41a82a632d5399d8d1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 1 Aug 2014 13:15:05 +0200
Subject: [PATCH] TEST-20-NFS:client-init.sh: add shell on rd.shell
---
test/TEST-20-NFS/client-init.sh | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/test/TEST-20-NFS/client-init.sh b/test/TEST-20-NFS/client-init.sh
index a16db3c..a1c4590 100755
--- a/test/TEST-20-NFS/client-init.sh
+++ b/test/TEST-20-NFS/client-init.sh
@@ -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