]>
git.ipfire.org Git - thirdparty/dracut.git/blob - test/TEST-04-FULL-SYSTEMD/test-init.sh
4 while read -r _line ||
[ -n "$_line" ]; do
16 for _o
in $CMDLINE; do
17 if [ "${_o%%=*}" = "${1%%=*}" ]; then
18 if [ -n "${1#*=}" -a "${1#*=*}" != "${1}" ]; then
19 # if $1 has a "=<value>", we want the exact match
20 if [ "$_o" = "$1" ]; then
27 if [ "${_o#*=}" = "$_o" ]; then
28 # if cmdline argument has no "=<value>", we assume "=1"
38 if [ -n "$_val" ]; then
39 [ "x$_doecho" != "x" ] && echo "$_val";
46 local _deprecated _newoption
47 while [ $# -gt 0 ]; do
49 -d) _deprecated
=1; shift;;
50 -y) if _dogetarg
$2 >/dev
/null
; then
51 if [ "$_deprecated" = "1" ]; then
52 [ -n "$_newoption" ] && warn
"Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn
"Option '$2' is deprecated."
59 -n) if _dogetarg
$2 >/dev
/null
; then
61 if [ "$_deprecated" = "1" ]; then
62 [ -n "$_newoption" ] && warn
"Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn
"Option '$2' is deprecated."
68 *) if [ -z "$_newoption" ]; then
72 if [ "$_deprecated" = "1" ]; then
73 [ -n "$_newoption" ] && warn
"Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn
"Option '$1' is deprecated."
90 [ $?
-ne 0 -a -z "$_b" ] && _b
="$_default"
92 [ $_b = "0" ] && return 1
93 [ $_b = "no" ] && return 1
94 [ $_b = "off" ] && return 1
98 export PATH
=/sbin
:/bin
:/usr
/sbin
:/usr
/bin
99 strstr
() { [ "${1##*"$2"*}" != "$1" ]; }
100 CMDLINE
=$
(while read line ||
[ -n "$line" ]; do echo $line;done < /proc
/cmdline
)
102 exec </dev
/console
>/dev
/console
2>&1
105 while read a m a ||
[ -n "$a" ]; do
106 [ "$m" = "$1" ] && return 0
111 systemctl
--failed --no-legend --no-pager > /failed
113 if ismounted
/usr
&& [ ! -s /failed
]; then
114 echo "dracut-root-block-success" |
dd oflag
=direct
,dsync of
=/dev
/sdc
117 if ! ismounted
/usr
; then
118 echo "**************************FAILED**************************"
119 echo "/usr not mounted!!"
121 echo "**************************FAILED**************************"
124 journalctl
--full --no-pager -o short-monotonic
126 if [ -s /failed
]; then
127 echo "**************************FAILED**************************"
129 echo "**************************FAILED**************************"
132 ls -al /run
/systemd
/system
135 export PS1
='initramfs-test:\w\$ '
136 [ -f /etc
/mtab
] ||
ln -sfn /proc
/mounts
/etc
/mtab
137 [ -f /etc
/fstab
] ||
ln -sfn /proc
/mounts
/etc
/fstab
139 echo "made it to the rootfs!"
140 if getargbool
0 rd.shell
; then
141 # while sleep 1; do sleep 1;done
142 strstr
"$(setsid --help)" "control" && CTTY
="-c"
146 /usr
/bin
/systemctl poweroff
147 echo "Powering down."