]>
Commit | Line | Data |
---|---|---|
badda27f HH |
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; do echo $line;done < /proc/cmdline) | |
6 | plymouth --quit | |
7 | exec </dev/console >/dev/console 2>&1 | |
8 | ||
9 | ismounted() { | |
10 | while read a m a; do | |
11 | [ "$m" = "$1" ] && return 0 | |
12 | done < /proc/mounts | |
13 | return 1 | |
14 | } | |
15 | ||
3d115217 HH |
16 | systemctl --failed --no-legend --no-pager > /failed |
17 | ||
83691c41 | 18 | if ismounted /usr && [ ! -s /failed ]; then |
badda27f HH |
19 | echo "dracut-root-block-success" >/dev/sdc |
20 | fi | |
3d115217 | 21 | |
83691c41 HH |
22 | journalctl --full --no-pager -o short-monotonic |
23 | ||
24 | if [ -s /failed ]; then | |
25 | echo "**************************FAILED**************************" | |
26 | cat /failed | |
27 | echo "**************************FAILED**************************" | |
28 | fi | |
29 | ||
30 | ls -al /run/systemd/system | |
3d115217 | 31 | |
badda27f HH |
32 | export TERM=linux |
33 | export PS1='initramfs-test:\w\$ ' | |
34 | [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab | |
35 | [ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab | |
36 | stty sane | |
37 | echo "made it to the rootfs!" | |
38 | if 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 | |
42 | fi | |
665b7e58 HH |
43 | set -x |
44 | /usr/bin/systemctl poweroff | |
badda27f | 45 | echo "Powering down." |