]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test/TEST-30-ISCSI: add rd.shell to client root
authorHarald Hoyer <harald@redhat.com>
Tue, 22 Jul 2014 12:22:21 +0000 (14:22 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 22 Jul 2014 12:22:21 +0000 (14:22 +0200)
test/TEST-30-ISCSI/client-init.sh

index e78db274ae9bf24fc7cef2f5896030f2099b3d93..b3e2ee15dd90038088569d6872b41a8683e1815d 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/sh
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
 exec >/dev/console 2>&1
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
+CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
 export TERM=linux
 export PS1='initramfs-test:\w\$ '
 stty sane
@@ -11,4 +13,8 @@ while read dev fs fstype opts rest; do
     break
 done < /proc/mounts
 #sh -i
+if strstr "$CMDLINE" "rd.shell"; then
+       strstr "$(setsid --help)" "control" && CTTY="-c"
+       setsid $CTTY sh -i
+fi
 poweroff -f