]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/50plymouth/plymouth-populate-initrd.sh
Renamed all shell scripts to *.sh
[thirdparty/dracut.git] / modules.d / 50plymouth / plymouth-populate-initrd.sh
1 #!/bin/bash
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4 PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
5 PLYMOUTH_THEME=$(plymouth-set-default-theme)
6
7 inst /sbin/plymouthd /bin/plymouthd
8 dracut_install /bin/plymouth \
9 "${PLYMOUTH_LOGO_FILE}" \
10 /etc/system-release
11
12 mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
13
14 if [[ $hostonly ]]; then
15 dracut_install "${usrlibdir}/plymouth/text.so" \
16 "${usrlibdir}/plymouth/details.so" \
17 "/usr/share/plymouth/themes/details/details.plymouth" \
18 "/usr/share/plymouth/themes/text/text.plymouth" \
19
20 if [[ -d /usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then
21 for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/* ; do
22 [[ -f "$x" ]] || break
23 inst $x
24 done
25 fi
26
27 if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
28 inst /usr/share/plymouth/themes/default.plymouth
29 # Install plugin for this theme
30 PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c; do echo $b; done;)
31 inst "${usrlibdir}/plymouth/${PLYMOUTH_PLUGIN}.so"
32 fi
33 else
34 for x in /usr/share/plymouth/themes/{text,details}/* ; do
35 [[ -f "$x" ]] || continue
36 THEME_DIR=$(dirname "$x")
37 mkdir -m 0755 -p "${initdir}/$THEME_DIR"
38 dracut_install "$x"
39 done
40 for x in "${usrlibdir}"/plymouth/{text,details}.so ; do
41 [[ -f "$x" ]] || continue
42 [[ "$x" != "${x%%/label.so}" ]] && continue
43 dracut_install "$x"
44 done
45 (
46 cd ${initdir}/usr/share/plymouth/themes;
47 ln -s text/text.plymouth default.plymouth 2>&1;
48 )
49 fi