Browse Source

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

master
Victor Lowther 16 years ago committed by Dave Jones
parent
commit
8cc53c16a0
  1. 2
      dracut
  2. 13
      init
  3. 3
      rules.d/63-luks.rules

2
dracut

@ -41,7 +41,7 @@ initdir=$(mktemp -d -t initramfs.XXXXXX) @@ -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

13
init

@ -74,8 +74,17 @@ esac @@ -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

3
rules.d/63-luks.rules

@ -8,7 +8,6 @@ SUBSYSTEM!="block", GOTO="luks_end" @@ -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"

Loading…
Cancel
Save