Merge pull request #68 from dracut-mailing-devs/1431698021-16626-3-git-send-email...
[dracut.git] / test / TEST-12-RAID-DEG / test-init.sh
blobc7c114e745346f80d008eaeeb48c00da7fb631f8
1 #!/bin/sh
2 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
3 strstr() { [ "${1##*"$2"*}" != "$1" ]; }
4 CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline)
5 command -v plymouth >/dev/null && plymouth --quit
6 exec >/dev/console 2>&1
7 echo "dracut-root-block-success" >/dev/sda1
8 export TERM=linux
9 export PS1='initramfs-test:\w\$ '
10 [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
11 [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab
12 stty sane
13 echo "made it to the rootfs!"
14 strstr "$CMDLINE" "rd.shell" && sh -i
15 echo "Powering down."
16 mount -n -o remount,ro /
17 #echo " rd.break=shutdown " >> /run/initramfs/etc/cmdline
18 if [ -d /run/initramfs/etc ]; then
19 echo " rd.debug=0 " >> /run/initramfs/etc/cmdline
21 if [ -e /lib/systemd/systemd-shutdown ]; then
22 exec /lib/systemd/systemd-shutdown poweroff
24 poweroff -f