Skip to content

Commit ba0d759

Browse files
LaszloGombosjohannbg
authored andcommitted
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.
1 parent 23654c5 commit ba0d759

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -956,11 +956,6 @@ emergency_shell() {
956956
_rdshell_name=$2
957957
action="Shutdown"
958958
hook="shutdown-emergency"
959-
if type plymouth > /dev/null 2>&1; then
960-
plymouth --hide-splash
961-
elif [ -x /oldroot/bin/plymouth ]; then
962-
/oldroot/bin/plymouth --hide-splash
963-
fi
964959
shift 2
965960
fi
966961

modules.d/99shutdown/shutdown.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ while [ $_cnt -le 40 ]; do
149149
done
150150
[ $_cnt -ge 40 ] && _check_shutdown final
151151

152+
if type plymouth > /dev/null 2>&1; then
153+
plymouth --hide-splash
154+
elif [ -x /oldroot/bin/plymouth ]; then
155+
/oldroot/bin/plymouth --hide-splash
156+
fi
157+
152158
getarg 'rd.break=shutdown' && emergency_shell --shutdown shutdown "Break before shutdown"
153159

154160
case "$ACTION" in

0 commit comments

Comments
 (0)