Merge pull request #68 from dracut-mailing-devs/1431698021-16626-3-git-send-email...
[dracut.git] / test / TEST-01-BASIC / test-init.sh
blobef196ecbc38a103bf3c46daf7b9c0a41b4646b96
1 #!/bin/sh
2 >/dev/watchdog
3 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
4 strstr() { [ "${1##*"$2"*}" != "$1" ]; }
5 CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline)
6 plymouth --quit
7 exec >/dev/console 2>&1
8 echo "dracut-root-block-success" >/dev/sdb
9 export TERM=linux
10 export PS1='initramfs-test:\w\$ '
11 [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
12 [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab
13 stty sane
14 echo "made it to the rootfs!"
15 if strstr "$CMDLINE" "rd.shell"; then
16 strstr "$(setsid --help)" "control" && CTTY="-c"
17 setsid $CTTY sh -i
19 echo "Powering down."
20 mount -n -o remount,ro /
21 poweroff -f