summaryrefslogtreecommitdiffstats
path: root/modules.d/50plymouth/plymouth-populate-initrd.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:54:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:54:25 +0000
commit9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a (patch)
tree2efb72864cc69e174c9c5ee33efb88a5f1553b48 /modules.d/50plymouth/plymouth-populate-initrd.sh
parentInitial commit. (diff)
downloaddracut-9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a.tar.xz
dracut-9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a.zip
Adding upstream version 060+5.upstream/060+5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules.d/50plymouth/plymouth-populate-initrd.sh')
-rwxr-xr-xmodules.d/50plymouth/plymouth-populate-initrd.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/modules.d/50plymouth/plymouth-populate-initrd.sh b/modules.d/50plymouth/plymouth-populate-initrd.sh
new file mode 100755
index 0000000..7e3afdd
--- /dev/null
+++ b/modules.d/50plymouth/plymouth-populate-initrd.sh
@@ -0,0 +1,45 @@
+#!/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