dracut/0012-test-TEST-30-ISCSI-add-rd.shell-to-client-root.patch
Harald Hoyer e09d6b8a2a dracut-038-14.git20140724
- fixed lvm modules issues
Resolves: rhbz#1118890
 fixed vlan issues
- fixed prelink for FIPS
- new rd.route parameter
- more ARM modules
2014-07-24 14:44:21 +02:00

32 lines
982 B
Diff

From ece72160cedbe47b973a7925d5e2f5adc409a849 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 22 Jul 2014 14:22:21 +0200
Subject: [PATCH] test/TEST-30-ISCSI: add rd.shell to client root
---
test/TEST-30-ISCSI/client-init.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/test/TEST-30-ISCSI/client-init.sh b/test/TEST-30-ISCSI/client-init.sh
index e78db27..b3e2ee1 100755
--- a/test/TEST-30-ISCSI/client-init.sh
+++ b/test/TEST-30-ISCSI/client-init.sh
@@ -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