]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
feat(plymouth): drop unused plymouth-populate-initrd
authorBenjamin Drung <benjamin.drung@canonical.com>
Wed, 29 Oct 2025 20:40:22 +0000 (21:40 +0100)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Thu, 30 Oct 2025 13:25:17 +0000 (09:25 -0400)
The plymouth `check` function calls `pkglib_dir` which searches for an
executable `plymouth-populate-initrd` script. Otherwise it will exit
with a failure and plymouth will not be included. Therefore
`plymouth-populate-initrd` will always be present when `install` is
called. Thus the code path for calling `plymouth-populate-initrd.sh`
will never taken.

So drop `plymouth-populate-initrd.sh` and its unused code path.

modules.d/45plymouth/module-setup.sh
modules.d/45plymouth/plymouth-populate-initrd.sh [deleted file]

index 21e6ea1a81d31d10bc5136b3a9b13b3a36fdda6d..c66c7c9a7567ff9cd0f5d9495614e03d6e3d039d 100755 (executable)
@@ -37,7 +37,7 @@ check() {
     [[ "$mount_needs" ]] && return 1
     [[ $(pkglib_dir) ]] || return 1
 
-    require_binaries plymouthd plymouth plymouth-set-default-theme || return 1
+    require_binaries plymouthd plymouth || return 1
 
     return 0
 }
@@ -54,13 +54,8 @@ depends() {
 # called by dracut
 install() {
     PKGLIBDIR=$(pkglib_dir)
-    if [ ! -x "${dracutsysrootdir-}${PKGLIBDIR}"/plymouth-populate-initrd ]; then
-        # shellcheck disable=SC1090
-        . "$moddir"/plymouth-populate-initrd.sh
-    else
-        PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
-            "${dracutsysrootdir-}${PKGLIBDIR}"/plymouth-populate-initrd -t "$initdir" 2> /dev/null
-    fi
+    PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
+        "${dracutsysrootdir-}${PKGLIBDIR}"/plymouth-populate-initrd -t "$initdir" 2> /dev/null
 
     inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
 
diff --git a/modules.d/45plymouth/plymouth-populate-initrd.sh b/modules.d/45plymouth/plymouth-populate-initrd.sh
deleted file mode 100755 (executable)
index 17653a0..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/bash
-
-PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
-PLYMOUTH_THEME=$(plymouth-set-default-theme)
-
-inst_multiple plymouthd plymouth
-
-test -e "${PLYMOUTH_LOGO_FILE}" && inst_simple "${PLYMOUTH_LOGO_FILE}"
-
-# shellcheck disable=SC2174
-mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
-
-inst_libdir_file "plymouth/text.so" "plymouth/details.so"
-
-if [[ $hostonly ]]; then
-    inst_multiple \
-        "/usr/share/plymouth/themes/details/details.plymouth" \
-        "/usr/share/plymouth/themes/text/text.plymouth"
-
-    if [[ -d ${dracutsysrootdir-}/usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then
-        for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/*; do
-            [[ -f "${dracutsysrootdir-}$x" ]] || break
-            inst "$x"
-        done
-    fi
-
-    if [[ -L ${dracutsysrootdir-}/usr/share/plymouth/themes/default.plymouth ]]; then
-        inst /usr/share/plymouth/themes/default.plymouth
-        # Install plugin for this theme
-        PLYMOUTH_PLUGIN=$(grep "^ModuleName=" "${dracutsysrootdir-}"/usr/share/plymouth/themes/default.plymouth | while read -r _ b _ || [ -n "$b" ]; do echo "$b"; done)
-        inst_libdir_file "plymouth/${PLYMOUTH_PLUGIN}.so"
-    fi
-else
-    for x in "${dracutsysrootdir-}"/usr/share/plymouth/themes/{text,details}/*; do
-        [[ -f $x ]] || continue
-        THEME_DIR=$(dirname "${x#"${dracutsysrootdir-}"}")
-        # shellcheck disable=SC2174
-        mkdir -m 0755 -p "${initdir}/$THEME_DIR"
-        inst_multiple "${x#"${dracutsysrootdir-}"}"
-    done
-    (
-        cd "${initdir}"/usr/share/plymouth/themes || exit
-        ln -s text/text.plymouth default.plymouth 2>&1
-    )
-fi