Browse Source

added plymouth with crypt handling

master
Harald Hoyer 15 years ago
parent
commit
0f46778162
  1. 2
      dracut.conf
  2. 13
      modules.d/91plymouth/63-luks.rules
  3. 9
      modules.d/91plymouth/install
  4. 4
      modules.d/91plymouth/plymouth-ask.sh
  5. 4
      modules.d/91plymouth/plymouth-newroot.sh
  6. 88
      modules.d/91plymouth/plymouth-populate-initrd
  7. 31
      modules.d/91plymouth/plymouth-start.sh

2
dracut.conf

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
# specify the dracut modules to use
dracutmodules="redhat-i18n crypt kernel-modules lvm terminfo udev-rules base dmraid"
dracutmodules="redhat-i18n kernel-modules lvm terminfo udev-rules base dmraid plymouth"

13
modules.d/91plymouth/63-luks.rules

@ -0,0 +1,13 @@ @@ -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+="plymouth-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"

LABEL="luks_end"

9
modules.d/91plymouth/install

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
#!/bin/bash
echo "installing plymouth"
. "$moddir"/plymouth-populate-initrd -t "$initdir"
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"/plymouth-ask.sh /lib/udev/plymouth-ask
inst cryptsetup

4
modules.d/91plymouth/plymouth-ask.sh

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
#!/bin/sh

[ -b /dev/mapper/$2 ] || exec /bin/plymouth ask-for-password --command="/sbin/cryptsetup luksOpen -T1 $1 $2"

4
modules.d/91plymouth/plymouth-newroot.sh

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
#!/bin/sh

[ -x /bin/plymouth ] && /bin/plymouth --newroot=$NEWROOT

88
modules.d/91plymouth/plymouth-populate-initrd

@ -0,0 +1,88 @@ @@ -0,0 +1,88 @@
#!/bin/bash

[ -z "$DESTDIR" ] || exit 0

[ -z "$LIBEXECDIR" ] && LIBEXECDIR="/usr/libexec"
[ -z "$DATADIR" ] && DATADIR="/usr/share"
[ -z "$SYSTEMMAP" ] && SYSTEM_MAP="/boot/System.map-$(/bin/uname -r)"
if [ -z "$LIB" ]; then
if $(echo nash-showelfinterp /proc/$$/exe | /sbin/nash --forcequiet | grep -q lib64); then
LIB="lib64"
else
LIB="lib"
fi
fi
[ -z "$LIBDIR" ] && LIBDIR="/usr/$LIB"
[ -z "$BINDIR" ] && BINDIR="/usr/bin"
[ -z "$GRUB_MENU_TITLE" ] && GRUB_MENU_TITLE="Graphical Bootup"
[ -z "$PLYMOUTH_LOGO_FILE" ] && PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
[ -z "$PLYMOUTH_PLUGIN_NAME" ] && PLYMOUTH_PLUGIN_NAME=$(plymouth-set-default-plugin)

function usage() {
local output="/dev/stdout"
local rc=0
if [ "$1" == "error" ]; then
output="/dev/stderr"
rc=1
fi

echo "usage: plymouth [ --verbose | -v ] { --targetdir | -t } <initrd_directory>" > $output
exit $rc
}

verbose=false
INITRDDIR=""
while [ $# -gt 0 ]; do
case $1 in
--verbose|-v)
verbose=true
;;
--targetdir|-t)
shift
INITRDDIR="$1"
;;
--help|-h)
usage normal
;;
*)
usage error
break
;;
esac
shift
done

[ -z "$INITRDDIR" ] && usage error

inst /sbin/plymouthd $INITRDDIR /bin/plymouthd
inst /bin/plymouth $INITRDDIR
inst ${LIBDIR}/plymouth/text.so $INITRDDIR
inst ${LIBDIR}/plymouth/details.so $INITRDDIR
inst ${PLYMOUTH_LOGO_FILE} $INITRDDIR
inst /etc/system-release $INITRDDIR
mkdir -p ${INITRDDIR}${DATADIR}/plymouth

if [ -z "$PLYMOUTH_PLUGIN_NAME" ]; then
echo "No default plymouth plugin is set" > /dev/stderr
exit 1
fi

if [ ! -f ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}.so ]; then
echo "The default plymouth plugin (${PLYMOUTH_PLUGIN_NAME}) doesn't exist" > /dev/stderr
exit 1
fi

inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}.so $INITRDDIR

if [ -f ${LIBDIR}/plymouth/default.so ]; then
inst ${LIBDIR}/plymouth/default.so $INITRDDIR
fi

if [ -d ${DATADIR}/plymouth/${PLYMOUTH_PLUGIN_NAME} ]; then
for x in ${DATADIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}/* ; do
[ ! -f "$x" ] && break
inst $x $INITRDDIR
done
fi

# vim:ts=8:sw=4:sts=4:et

31
modules.d/91plymouth/plymouth-start.sh

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
#!/bin/sh

mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
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

Loading…
Cancel
Save