diff options
author | Miloslav Trmac <mitr@volny.cz> | 2006-07-09 05:04:38 +0000 |
---|---|---|
committer | Miloslav Trmac <mitr@volny.cz> | 2006-07-09 05:04:38 +0000 |
commit | ad5e55b3daf05c976faba0ffa4e25212772b00cb (patch) | |
tree | 727719a73169f3f8235daa636b345abd931513c2 /rc.d | |
parent | e7492c6bf0f55bda1357c64dbb4959de881b1400 (diff) | |
download | initscripts-ad5e55b3daf05c976faba0ffa4e25212772b00cb.tar initscripts-ad5e55b3daf05c976faba0ffa4e25212772b00cb.tar.gz initscripts-ad5e55b3daf05c976faba0ffa4e25212772b00cb.tar.bz2 initscripts-ad5e55b3daf05c976faba0ffa4e25212772b00cb.tar.xz initscripts-ad5e55b3daf05c976faba0ffa4e25212772b00cb.zip |
Switch to VT 1 when asking for block device encryption key
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/rc.sysinit | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 79e20cfa..ba14702c 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -105,7 +105,7 @@ key_is_random() { # encrypted but /var/lib/random-seed is needed to initialize swap. init_crypto() { local have_random dst src key opt mode owner params makeswap skip arg opt - local param value ret + local param value rc ret ret=0 have_random=$1 @@ -185,7 +185,10 @@ init_crypto() { makeswap=no fi fi - # FIXME: if [ -z key ], should we allow retries or handle rhgb? + if [ -z "$key" -a -x /usr/bin/rhgb-client ] \ + && /usr/bin/rhgb-client --ping ; then + chvt 1 + fi if cryptsetup isLuks "$src" 2>/dev/null; then if key_is_random "$key"; then echo $"$dst: LUKS requires non-random key, skipping" @@ -200,7 +203,12 @@ init_crypto() { else /sbin/cryptsetup $params ${key:+-d $key} create "$dst" "$src" <&1 fi - if [ $? -ne 0 ]; then + rc=$? + if [ -z "$key" -a -x /usr/bin/rhgb-client ] \ + && /usr/bin/rhgb-client --ping ; then + chvt 8 + fi + if [ $rc -ne 0 ]; then ret=1 continue fi |