@@ -47,6 +47,19 @@ poll_device() {
}
launch_interactive_shell() {
+ if [ -n "$rd_noninteractive" ]; then
+ printf '%s\n' \
+ "************** REBOOT REQUIRED **************" \
+ "* *" \
+ "* running in non-interactive mode *" \
+ "* - *" \
+ "* automatically restarting in 2 seconds *" \
+ "* *" \
+ "*********************************************"
+ sleep 2
+ reboot -f
+ fi
+
export PS1='[rootfs \W]\$ '
# explicitly redirect to /dev/console in case we're logging. note that
@@ -174,6 +187,9 @@ parse_cmdline_item() {
rd_logmask=$(( _rdlog_kmsg | _rdlog_cons ))
fi
;;
+ rd.noninteractive)
+ rd_noninteractive=y
+ ;;
[![:alpha:]_]*|[[:alpha:]_]*[![:alnum:]_]*)
# invalid shell variable, ignore it
;;
@@ -292,6 +292,9 @@ the kernel command line:
*all*;;
Writes output to all known log targets.
+*rd.noninteractive*::
+ If specified, reboot the machine instead of starting an interactive shell.
+
These are only the variables that the core of mkinitcpio honor. Additional
hooks may look for other environment variables and should be documented by the
help output for the hook.
@@ -217,6 +217,8 @@ test_parse 'rd.log=kmsg' \
'rd_logmask' '2'
test_parse 'rd.log=file' \
'rd_logmask' '1'
+test_parse 'rd.noninteractive' \
+ 'rd_noninteractive' 'y'
# a mix of stuff
test_parse 'foo=bar bareword bar="ba az"' \