Skip to contentSkip to conversation

Remove dependency on plymouth for getroot, pass 1.

PATCH In review initramfs mailing list 1 participant 1 message Feb 16, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 28/50 Remove dependency on plymouth for getroot, pass 1.

Gitweb:     http://git.kernel.org/?p=linux/kernel/git/davej/dracut.git;a=commit;h=8cc53c16a0f7860a6b87c99c1504288225fb904b
Commit:     8cc53c16a0f7860a6b87c99c1504288225fb904b
Parent:     2c6fc388b0fc46e070b7f738bc906c42883034f5
Author:     Victor Lowther <[email protected]>
AuthorDate: Fri Feb 13 04:42:38 2009 -0800
Committer:  Dave Jones <[email protected]>
CommitDate: Mon Feb 16 13:56:41 2009 -0500

[PATCH 28/50] Remove dependency on plymouth for getroot, pass 1.

---
 dracut                |    2 +-
 init                  |   13 +++++++++++--
 rules.d/63-luks.rules |    3 +--
 3 files changed, 13 insertions(+), 5 deletions(-)
dracut +1 -1
index 56695c1..630b78b 100755
@@ -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
init +11 -2
index 10a789b..ea06687 100755
@@ -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    
rules.d/63-luks.rules +1 -2
index 5d8297b..ab907e9 100644
@@ -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"

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html