]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
refactor(shutdown): move module specific code out of base module
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Sun, 2 Oct 2022 01:06:12 +0000 (01:06 +0000)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Fri, 21 Oct 2022 22:36:03 +0000 (22:36 +0000)
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.

modules.d/99base/dracut-lib.sh
modules.d/99shutdown/shutdown.sh

index 2529af666ecfcdc4cc2fd0b208e95ababc339aac..6ba836ec3b82e724274ca28a71bc1194bcdec8fc 100755 (executable)
@@ -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
 
index 73550ba9e39f57102e607481d903614087580357..d611d4469753352699e664a025f629514cf78b37 100755 (executable)
@@ -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