Blame 0016-TEST-20-NFS-client-init.sh-add-shell-on-rd.shell.patch
|
Harald Hoyer |
89f6fa |
From 28d03673f9aa76b041ce9a41a82a632d5399d8d1 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
89f6fa |
From: Harald Hoyer <harald@redhat.com>
|
|
Harald Hoyer |
89f6fa |
Date: Fri, 1 Aug 2014 13:15:05 +0200
|
|
Harald Hoyer |
89f6fa |
Subject: [PATCH] TEST-20-NFS:client-init.sh: add shell on rd.shell
|
|
Harald Hoyer |
89f6fa |
|
|
Harald Hoyer |
89f6fa |
---
|
|
Harald Hoyer |
89f6fa |
test/TEST-20-NFS/client-init.sh | 10 +++++++---
|
|
Harald Hoyer |
89f6fa |
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
Harald Hoyer |
89f6fa |
|
|
Harald Hoyer |
89f6fa |
diff --git a/test/TEST-20-NFS/client-init.sh b/test/TEST-20-NFS/client-init.sh
|
|
Harald Hoyer |
89f6fa |
index a16db3c..a1c4590 100755
|
|
Harald Hoyer |
89f6fa |
--- a/test/TEST-20-NFS/client-init.sh
|
|
Harald Hoyer |
89f6fa |
+++ b/test/TEST-20-NFS/client-init.sh
|
|
Harald Hoyer |
89f6fa |
@@ -7,14 +7,18 @@ CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
|
Harald Hoyer |
89f6fa |
strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
|
Harald Hoyer |
89f6fa |
|
|
Harald Hoyer |
89f6fa |
stty sane
|
|
Harald Hoyer |
89f6fa |
-strstr "$CMDLINE" "rd.shell" && sh -i
|
|
Harald Hoyer |
89f6fa |
+if strstr "$CMDLINE" "rd.shell"; then
|
|
Harald Hoyer |
89f6fa |
+ [ -c /dev/watchdog ] && echo -n 'V' > /dev/watchdog
|
|
Harald Hoyer |
89f6fa |
+ strstr "$(setsid --help)" "control" && CTTY="-c"
|
|
Harald Hoyer |
89f6fa |
+ setsid $CTTY sh -i
|
|
Harald Hoyer |
89f6fa |
+fi
|
|
Harald Hoyer |
89f6fa |
+
|
|
Harald Hoyer |
89f6fa |
echo "made it to the rootfs! Powering down."
|
|
Harald Hoyer |
89f6fa |
+
|
|
Harald Hoyer |
89f6fa |
while read dev fs fstype opts rest; do
|
|
Harald Hoyer |
89f6fa |
[ "$fstype" != "nfs" -a "$fstype" != "nfs4" ] && continue
|
|
Harald Hoyer |
89f6fa |
echo "nfs-OK $dev $fstype $opts" > /dev/sda
|
|
Harald Hoyer |
89f6fa |
break
|
|
Harald Hoyer |
89f6fa |
done < /proc/mounts
|
|
Harald Hoyer |
89f6fa |
-#echo 'V' > /dev/watchdog
|
|
Harald Hoyer |
89f6fa |
-#sh -i
|
|
Harald Hoyer |
89f6fa |
>/dev/watchdog
|
|
Harald Hoyer |
89f6fa |
poweroff -f
|