From ba0d7591a68c5a521b95b2eada70b80153b5bff1 Mon Sep 17 00:00:00 2001 From: Laszlo Gombos Date: Sun, 2 Oct 2022 01:06:12 +0000 Subject: [PATCH] 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. --- modules.d/99base/dracut-lib.sh | 5 ----- modules.d/99shutdown/shutdown.sh | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) 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 -- 2.47.3