From: Laszlo Gombos Date: Sun, 2 Oct 2022 01:06:12 +0000 (+0000) Subject: refactor(shutdown): move module specific code out of base module X-Git-Tag: 058~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba0d7591a68c5a521b95b2eada70b80153b5bff1;p=thirdparty%2Fdracut.git refactor(shutdown): move module specific code out of base module dracut-lib.sh and the base module now does not have a knowledge of oldroot and plymouth. It improves the separation of concerns between the base module and the shutdown module. --- diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index 2529af666..6ba836ec3 100755 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -956,11 +956,6 @@ emergency_shell() { _rdshell_name=$2 action="Shutdown" hook="shutdown-emergency" - if type plymouth > /dev/null 2>&1; then - plymouth --hide-splash - elif [ -x /oldroot/bin/plymouth ]; then - /oldroot/bin/plymouth --hide-splash - fi shift 2 fi diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh index 73550ba9e..d611d4469 100755 --- a/modules.d/99shutdown/shutdown.sh +++ b/modules.d/99shutdown/shutdown.sh @@ -149,6 +149,12 @@ while [ $_cnt -le 40 ]; do done [ $_cnt -ge 40 ] && _check_shutdown final +if type plymouth > /dev/null 2>&1; then + plymouth --hide-splash +elif [ -x /oldroot/bin/plymouth ]; then + /oldroot/bin/plymouth --hide-splash +fi + getarg 'rd.break=shutdown' && emergency_shell --shutdown shutdown "Break before shutdown" case "$ACTION" in