[PATCH 28/50] Remove dependency on plymouth for getroot, pass 1.
authorVictor Lowther <victor.lowther@gmail.com>
Fri, 13 Feb 2009 12:42:38 +0000 (04:42 -0800)
committerDave Jones <davej@redhat.com>
Mon, 16 Feb 2009 18:56:41 +0000 (13:56 -0500)
dracut
init
rules.d/63-luks.rules

diff --git a/dracut b/dracut
index 56695c1..630b78b 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -41,7 +41,7 @@ initdir=$(mktemp -d -t initramfs.XXXXXX)
 trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die.
 
 # executables that we have to have
-exe="/bin/bash /bin/mount /bin/mknod /bin/mkdir /sbin/modprobe /sbin/udevd /sbin/udevadm /sbin/nash /sbin/pidof /bin/sleep /usr/sbin/chroot"
+exe="/bin/bash /bin/mount /bin/mknod /bin/mkdir /sbin/modprobe /sbin/udevd /sbin/udevadm /sbin/nash /sbin/pidof /bin/sleep /usr/sbin/chroot /bin/echo"
 lvmexe="/sbin/lvm"
 cryptexe="/sbin/cryptsetup"
 # and some things that are nice for debugging
diff --git a/init b/init
index 10a789b..ea06687 100755 (executable)
--- a/init
+++ b/init
@@ -74,8 +74,17 @@ esac
 tries=0
 plymouth --update "Waiting up to 30 seconds for $root to become available"
 until [[ -e $root ]]; do
-  sleep 1
-  ((tries++ > 30)) && emergency_shell
+    [[ -f /cryptroot ]] && {
+       tries=27
+       cryptopts=$(< /cryptroot)
+       if [ -x /bin/plymouth ] && plymouth --ping; then
+           /bin/plymouth ask-for-password \
+               --command "/sbin/cryptsetup luksOpen $cryptopts" && break
+       else
+           /sbin/cryptsetup luksOpen $cryptopts && break
+       fi
+    sleep 1
+    ((tries++ > 30)) && emergency_shell
 done
 plymouth --update "Mounting rootfs after $tries seconds"
 ln -s "$root" /dev/root    
index 5d8297b..ab907e9 100644 (file)
@@ -8,7 +8,6 @@ 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+="/bin/plymouth ask-for-password --command '/sbin/cryptsetup luksOpen $env{DEVNAME} luks-$env{ID_FS_UUID}"
-
+ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/echoer /cryptroot $env{DEVNAME} luks-$env{ID_FS_UUID}"
 
 LABEL="luks_end"