dracut-systemd/dracut-initqueue: only start service if really needed
[dracut.git] / test / TEST-03-USR-MOUNT / test-init.sh
blob48fbfeaf60d9da5bb66c85e37e0e255ef60305ba
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 >/dev/console 2>&1
9 ismounted() {
10 while read a m a || [ -n "$m" ]; do
11 [ "$m" = "$1" ] && return 0
12 done < /proc/mounts
13 return 1
16 if ismounted /usr; then
17 echo "dracut-root-block-success" >/dev/sdc
19 export TERM=linux
20 export PS1='initramfs-test:\w\$ '
21 [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
22 [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab
23 stty sane
24 echo "made it to the rootfs!"
25 if strstr "$CMDLINE" "rd.shell"; then
26 strstr "$(setsid --help)" "control" && CTTY="-c"
27 setsid $CTTY sh -i
29 echo "Powering down."
30 mount -n -o remount,ro /
31 poweroff -f