]> git.ipfire.org Git - thirdparty/dracut.git/blame - test/TEST-10-RAID/test-init.sh
Specify strstr tightly, add strglob/strglobin.
[thirdparty/dracut.git] / test / TEST-10-RAID / test-init.sh
CommitLineData
c0b5f979 1#!/bin/sh
387bf82e 2export PATH=/sbin:/bin:/usr/sbin:/usr/bin
2c19a5fa 3strstr() { [ "${1#*"$2"*}" != "$1" ]; }
ceaf49d7 4CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
96d22bd7 5command -v plymouth >/dev/null && plymouth --quit
c0b5f979 6exec >/dev/console 2>&1
1a0c05b8 7echo "dracut-root-block-success" >/dev/sda1
c0b5f979 8export TERM=linux
92391334 9export PS1='initramfs-test:\w\$ '
ceaf49d7
HH
10[ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
11[ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab
c0b5f979 12stty sane
ceaf49d7
HH
13echo "made it to the rootfs!"
14strstr "$CMDLINE" "rd.shell" && sh -i
15echo "Powering down."
6ce31231 16mount -n -o remount,ro /
8570b544 17#echo " rd.break=shutdown " >> /run/initramfs/etc/cmdline
96d22bd7
HH
18if [ -d /run/initramfs/etc ]; then
19 echo " rd.debug=0 " >> /run/initramfs/etc/cmdline
20fi
ceaf49d7 21if [ -e /lib/systemd/systemd-shutdown ]; then
96d22bd7 22 exec /lib/systemd/systemd-shutdown poweroff
ceaf49d7 23fi
4b8b7c59 24poweroff -f