plymouth: install all themes and make them selectable by command line
authorHarald Hoyer <harald@redhat.com>
Fri, 17 Jul 2009 12:52:53 +0000 (14:52 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 17 Jul 2009 14:00:09 +0000 (16:00 +0200)
Bootsplash - plymouth
       rd_plytheme=<theme name>
              specify the plymouth bootsplash theme (fallback is text)

dracut.8
dracut.spec
modules.d/50plymouth/install
modules.d/50plymouth/parse-plymouth.sh [new file with mode: 0644]
modules.d/50plymouth/plymouth-populate-initrd
modules.d/50plymouth/plymouth-pretrigger.sh

index bcf603f61f0355bbc31ce849fcc846fc0e034a09..07b8592a7c568ae68426610bb137f8f9d2b67737 100644 (file)
--- a/dracut.8
+++ b/dracut.8
@@ -99,6 +99,11 @@ will be written to /etc/sysconfig/i18n in the initramfs
 .B LANG=<locale>
 will be written to /etc/sysconfig/i18n in the initramfs
 
+.SH Bootsplash - plymouth
+.TP
+.B rd_plytheme=<theme name>
+specify the plymouth bootsplash theme (fallback is text)
+
 .SH LVM
 .TP
 .B rd_NO_LVM
index a1f2526a4f04380772cc05011acefac3db7f26aa..1721bb46b504ce6a1ba799afa6878da7d7eb0446 100644 (file)
@@ -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
index 162106db972901910a6fb0b4ea4ef4f67c76049e..f87f8e13471036578799a9216e167474b51dd752 100755 (executable)
@@ -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 (file)
index 0000000..ca273f0
--- /dev/null
@@ -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
+
index 1e1bb2cb6a1503fa57aad9e18faa6fc3ed4e2269..e26d64616d8009b6bfc1951e4e56e72fe09474fb 100755 (executable)
@@ -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
index 68cf41d525d49f0cf1116e1041da7fe945ad944e..243eb7f5aaa074738d7616eee48a3cb44755afa1 100755 (executable)
@@ -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