]> git.ipfire.org Git - thirdparty/dracut.git/blame - test/TEST-04-FULL-SYSTEMD/test-init.sh
testsuite fixup
[thirdparty/dracut.git] / test / TEST-04-FULL-SYSTEMD / test-init.sh
CommitLineData
badda27f
HH
1#!/bin/sh
2>/dev/watchdog
3export PATH=/sbin:/bin:/usr/sbin:/usr/bin
4strstr() { [ "${1#*$2*}" != "$1" ]; }
5CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
6plymouth --quit
7exec </dev/console >/dev/console 2>&1
8
9ismounted() {
10 while read a m a; do
11 [ "$m" = "$1" ] && return 0
12 done < /proc/mounts
13 return 1
14}
15
3d115217
HH
16systemctl --failed --no-legend --no-pager > /failed
17
83691c41 18if ismounted /usr && [ ! -s /failed ]; then
badda27f
HH
19 echo "dracut-root-block-success" >/dev/sdc
20fi
3d115217 21
83691c41
HH
22journalctl --full --no-pager -o short-monotonic
23
24if [ -s /failed ]; then
25 echo "**************************FAILED**************************"
26 cat /failed
27 echo "**************************FAILED**************************"
28fi
29
30ls -al /run/systemd/system
3d115217 31
badda27f
HH
32export TERM=linux
33export PS1='initramfs-test:\w\$ '
34[ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
35[ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab
36stty sane
37echo "made it to the rootfs!"
38if strstr "$CMDLINE" "rd.shell"; then
3d115217 39# while sleep 1; do sleep 1;done
badda27f
HH
40 strstr "$(setsid --help)" "control" && CTTY="-c"
41 setsid $CTTY sh -i
42fi
665b7e58
HH
43set -x
44/usr/bin/systemctl poweroff
badda27f 45echo "Powering down."