]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
add plymouth module for plymouth < 0.7
authorHarald Hoyer <harald@redhat.com>
Wed, 20 May 2009 09:14:56 +0000 (11:14 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 20 May 2009 09:14:56 +0000 (11:14 +0200)
modules.d/50plymouth-pre0.7/63-luks.rules [new file with mode: 0644]
modules.d/50plymouth-pre0.7/check [new file with mode: 0755]
modules.d/50plymouth-pre0.7/cryptroot-ask.sh [new file with mode: 0755]
modules.d/50plymouth-pre0.7/install [new file with mode: 0755]
modules.d/50plymouth-pre0.7/plymouth-newroot.sh [new file with mode: 0755]
modules.d/50plymouth-pre0.7/plymouth-populate-initrd [new file with mode: 0755]
modules.d/50plymouth-pre0.7/plymouth-start.sh [new file with mode: 0755]
modules.d/50plymouth/check

diff --git a/modules.d/50plymouth-pre0.7/63-luks.rules b/modules.d/50plymouth-pre0.7/63-luks.rules
new file mode 100644 (file)
index 0000000..893577b
--- /dev/null
@@ -0,0 +1,13 @@
+# hacky rules to try to try unlocking dm-crypt devs
+#
+# Copyright 2008, Red Hat, Inc.
+# Jeremy Katz <katzj@redhat.com>
+
+
+SUBSYSTEM!="block", GOTO="luks_end"
+ACTION!="add|change", GOTO="luks_end"
+
+KERNEL!="sr*", IMPORT{program}="vol_id --export $tempnode"
+ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
+
+LABEL="luks_end"
diff --git a/modules.d/50plymouth-pre0.7/check b/modules.d/50plymouth-pre0.7/check
new file mode 100755 (executable)
index 0000000..6a1f31c
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+[[ -x /sbin/plymouthd && -x /bin/plymouth && ! /usr/sbin/plymouth-set-default-theme ]]
diff --git a/modules.d/50plymouth-pre0.7/cryptroot-ask.sh b/modules.d/50plymouth-pre0.7/cryptroot-ask.sh
new file mode 100755 (executable)
index 0000000..fadb502
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+[ -b /dev/mapper/$2 ] || exec /bin/plymouth ask-for-password --command="/sbin/cryptsetup luksOpen -T1 $1 $2"
+
diff --git a/modules.d/50plymouth-pre0.7/install b/modules.d/50plymouth-pre0.7/install
new file mode 100755 (executable)
index 0000000..0d28461
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+echo "installing plymouth"
+. "$moddir"/plymouth-populate-initrd
+inst_hook pre-udev 10 "$moddir"/plymouth-start.sh
+inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh
+inst_rules "$moddir/63-luks.rules"
+inst "$moddir"/cryptroot-ask.sh /lib/udev/cryptroot-ask
+inst cryptsetup
+
diff --git a/modules.d/50plymouth-pre0.7/plymouth-newroot.sh b/modules.d/50plymouth-pre0.7/plymouth-newroot.sh
new file mode 100755 (executable)
index 0000000..c6f8c6d
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+[ -x /bin/plymouth ] && /bin/plymouth --newroot=$NEWROOT
+
diff --git a/modules.d/50plymouth-pre0.7/plymouth-populate-initrd b/modules.d/50plymouth-pre0.7/plymouth-populate-initrd
new file mode 100755 (executable)
index 0000000..e195ddc
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+if ldd /proc/$$/exe |grep -q lib64; then
+    LIBDIR="/usr/lib64"
+else
+    LIBDIR="/usr/lib"
+fi
+PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
+PLYMOUTH_PLUGIN_NAME=$(plymouth-set-default-plugin)
+
+inst /sbin/plymouthd /bin/plymouthd
+dracut_install /bin/plymouth "${LIBDIR}/plymouth/text.so" \
+    "${LIBDIR}/plymouth/details.so" "${PLYMOUTH_LOGO_FILE}" \
+    /etc/system-release "${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN_NAME:=text}.so"
+mkdir -p "${initdir}/usr/share/plymouth"
+
+[[ -f ${LIBDIR}/plymouth/default.so ]] && inst ${LIBDIR}/plymouth/default.so
+
+if [[ -d /usr/share/plymouth/${PLYMOUTH_PLUGIN_NAME} ]]; then
+    for x in "/usr/share/plymouth/${PLYMOUTH_PLUGIN_NAME}"/* ; do
+        [[ -f "$x" ]] || break
+        inst $x
+    done
+fi
+
+# vim:ts=8:sw=4:sts=4:et
diff --git a/modules.d/50plymouth-pre0.7/plymouth-start.sh b/modules.d/50plymouth-pre0.7/plymouth-start.sh
new file mode 100755 (executable)
index 0000000..9a0c0fa
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+[[ -c /dev/null ]] || mknod /dev/null c 1 3
+mknod /dev/zero c 1 5
+mknod /dev/systty c 4 0
+mknod /dev/tty c 5 0
+[[ -c /dev/console ]] || mknod /dev/console c 5 1
+[[ -c /dev/ptmx ]] || mknod /dev/ptmx c 5 2
+mknod /dev/fb c 29 0
+mknod /dev/tty0 c 4 0
+mknod /dev/tty1 c 4 1
+mknod /dev/tty2 c 4 2
+mknod /dev/tty3 c 4 3
+mknod /dev/tty4 c 4 4
+mknod /dev/tty5 c 4 5
+mknod /dev/tty6 c 4 6
+mknod /dev/tty7 c 4 7
+mknod /dev/tty8 c 4 8
+mknod /dev/tty9 c 4 9
+mknod /dev/tty10 c 4 10
+mknod /dev/tty11 c 4 11
+mknod /dev/tty12 c 4 12
+mknod /dev/ttyS0 c 4 64
+mknod /dev/ttyS1 c 4 65
+mknod /dev/ttyS2 c 4 66
+mknod /dev/ttyS3 c 4 67
+/lib/udev/console_init tty0
+
+[ -x /bin/plymouthd ] && /bin/plymouthd 
+[ -x /bin/plymouth ] && /bin/plymouth --show-splash
+
index a224b73471eef9e8bf6198e7e04fe8142dec9b57..bd7008cdd3716071330c78cf13b6827a3ec70431 100755 (executable)
@@ -1,2 +1,2 @@
 #!/bin/bash
-[[ -x /sbin/plymouthd && -x /bin/plymouth ]]
+[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-plugin ]]