diff --git a/dracut.8 b/dracut.8 index bcf603f6..07b8592a 100644 --- a/dracut.8 +++ b/dracut.8 @@ -99,6 +99,11 @@ will be written to /etc/sysconfig/i18n in the initramfs .B LANG= will be written to /etc/sysconfig/i18n in the initramfs +.SH Bootsplash - plymouth +.TP +.B rd_plytheme= +specify the plymouth bootsplash theme (fallback is text) + .SH LVM .TP .B rd_NO_LVM diff --git a/dracut.spec b/dracut.spec index a1f2526a..1721bb46 100644 --- a/dracut.spec +++ b/dracut.spec @@ -65,6 +65,7 @@ Requires: ql2200-firmware Requires: ql23xx-firmware Requires: ql2400-firmware Requires: ql2500-firmware +Requires: plymouth-system-theme plymouth-theme-charge plymouth-theme-solar %description generic This package requires everything which is needed to build a generic diff --git a/modules.d/50plymouth/install b/modules.d/50plymouth/install index 162106db..f87f8e13 100755 --- a/modules.d/50plymouth/install +++ b/modules.d/50plymouth/install @@ -1,5 +1,6 @@ #!/bin/bash . "$moddir"/plymouth-populate-initrd +inst_hook cmdline 30 "$moddir/parse-plymouth.sh" inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh inst_hook emergency 50 "$moddir"/plymouth-emergency.sh diff --git a/modules.d/50plymouth/parse-plymouth.sh b/modules.d/50plymouth/parse-plymouth.sh new file mode 100644 index 00000000..ca273f09 --- /dev/null +++ b/modules.d/50plymouth/parse-plymouth.sh @@ -0,0 +1,19 @@ +initrdargs="$initrdargs rd_plytheme" + +PLYMOUTH_THEMEDIR=/usr/share/plymouth/themes +PLYMOUTH_THEME=$(getarg rd_plytheme=) +if [ -n "$PLYMOUTH_THEME" ]; then + if [ -f "${PLYMOUTH_THEMEDIR}/${PLYMOUTH_THEME}/${PLYMOUTH_THEME}.plymouth" ]; then + info "Setting theme $PLYMOUTH_THEME" + ( + cd $PLYMOUTH_THEMEDIR; + ln -fs "${PLYMOUTH_THEME}/${PLYMOUTH_THEME}.plymouth" default.plymouth 2>&1 | vinfo; + ) + else + warn "Theme $PLYMOUTH_THEME not found!" + fi +fi + +unset PLYMOUTH_THEME +unset PLYMOUTH_THEMEDIR + diff --git a/modules.d/50plymouth/plymouth-populate-initrd b/modules.d/50plymouth/plymouth-populate-initrd index 1e1bb2cb..e26d6461 100755 --- a/modules.d/50plymouth/plymouth-populate-initrd +++ b/modules.d/50plymouth/plymouth-populate-initrd @@ -8,31 +8,46 @@ PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png" PLYMOUTH_THEME=$(plymouth-set-default-theme) inst /sbin/plymouthd /bin/plymouthd -dracut_install /bin/plymouth "${LIBDIR}/plymouth/text.so" \ - "${LIBDIR}/plymouth/details.so" \ - "/usr/share/plymouth/themes/details/details.plymouth" \ - "/usr/share/plymouth/themes/text/text.plymouth" \ +dracut_install /bin/plymouth \ "${PLYMOUTH_LOGO_FILE}" \ /etc/system-release -if [[ -f "${LIBDIR}/plymouth/${PLYMOUTH_THEME:=text}.so" ]]; then - dracut_install "${LIBDIR}/plymouth/${PLYMOUTH_THEME:=text}.so" -fi - mkdir -p "${initdir}/usr/share/plymouth" -if [[ -d /usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then - for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/* ; do - [[ -f "$x" ]] || break - inst $x - done -fi +if [[ $hostonly ]]; then + dracut_install "${LIBDIR}/plymouth/text.so" \ + "${LIBDIR}/plymouth/details.so" \ + "/usr/share/plymouth/themes/details/details.plymouth" \ + "/usr/share/plymouth/themes/text/text.plymouth" \ -if [ -L /usr/share/plymouth/themes/default.plymouth ]; then - inst /usr/share/plymouth/themes/default.plymouth - # Install plugin for this theme - PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth |awk -F= {'print $2'}) - inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN}.so + if [[ -d /usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then + for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/* ; do + [[ -f "$x" ]] || break + inst $x + done + fi + + if [ -L /usr/share/plymouth/themes/default.plymouth ]; then + inst /usr/share/plymouth/themes/default.plymouth + # Install plugin for this theme + PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth |awk -F= {'print $2'}) + inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN}.so + fi +else + for x in /usr/share/plymouth/themes/*/* ; do + [[ -f "$x" ]] || continue + THEME_DIR=$(dirname "$x") + mkdir -p "${initdir}/$THEME_DIR" + dracut_install "$x" + done + for x in ${LIBDIR}/plymouth/*.so ; do + [[ -f "$x" ]] || continue + dracut_install "$x" + done + ( + cd ${initdir}/usr/share/plymouth/themes; + ln -s text/text.plymouth default.plymouth 2>&1; + ) fi # vim:ts=8:sw=4:sts=4:et diff --git a/modules.d/50plymouth/plymouth-pretrigger.sh b/modules.d/50plymouth/plymouth-pretrigger.sh index 68cf41d5..243eb7f5 100755 --- a/modules.d/50plymouth/plymouth-pretrigger.sh +++ b/modules.d/50plymouth/plymouth-pretrigger.sh @@ -1,14 +1,12 @@ #!/bin/sh +[ -c /dev/null ] || mknod /dev/null c 1 3 # first trigger graphics subsystem -udevadm trigger --attr-match=class=0x030000 +udevadm trigger --attr-match=class=0x030000 >/dev/null 2>&1 # first trigger graphics and tty subsystem udevadm trigger --subsystem-match=graphics --subsystem-match=tty >/dev/null 2>&1 -# add nomatch for full trigger -udevtriggeropts="$udevtriggeropts --subsystem-nomatch=graphics --subsystem-nomatch=tty" -udevadm settle --timeout=30 >/dev/null 2>&1 -[ -c /dev/null ] || mknod /dev/null c 1 3 +udevadm settle --timeout=30 2>&1 | vinfo [ -c /dev/zero ] || mknod /dev/zero c 1 5 [ -c /dev/systty ] || mknod /dev/systty c 4 0 [ -c /dev/fb ] || mknod /dev/fb c 29 0 @@ -16,5 +14,5 @@ udevadm settle --timeout=30 >/dev/null 2>&1 info "Starting plymouth daemon" [ -x /bin/plymouthd ] && /bin/plymouthd -/bin/plymouth --show-splash +/bin/plymouth --show-splash 2>&1 | vinfo