test/TEST-30-ISCSI: add rd.shell to client root
parent
54b68829b6
commit
ece72160ce
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
exec >/dev/console 2>&1
|
exec >/dev/console 2>&1
|
||||||
|
strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||||||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||||||
export TERM=linux
|
export TERM=linux
|
||||||
export PS1='initramfs-test:\w\$ '
|
export PS1='initramfs-test:\w\$ '
|
||||||
stty sane
|
stty sane
|
||||||
|
@ -11,4 +13,8 @@ while read dev fs fstype opts rest; do
|
||||||
break
|
break
|
||||||
done < /proc/mounts
|
done < /proc/mounts
|
||||||
#sh -i
|
#sh -i
|
||||||
|
if strstr "$CMDLINE" "rd.shell"; then
|
||||||
|
strstr "$(setsid --help)" "control" && CTTY="-c"
|
||||||
|
setsid $CTTY sh -i
|
||||||
|
fi
|
||||||
poweroff -f
|
poweroff -f
|
||||||
|
|
Loading…
Reference in New Issue