aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2011-01-28 20:58:45 +0100
committerThomas Bächler <thomas@archlinux.org>2011-01-28 20:58:45 +0100
commitc44eccadf84ba0d9d0d449a870aad63bb03fd8d3 (patch)
treeb6420d5bdc4a489daf5b5458425724385bef5bcf
parentf4703f832e6d8578c52dd8a71b9bf34894fe3d34 (diff)
downloadinitscripts-c44eccadf84ba0d9d0d449a870aad63bb03fd8d3.tar.xz
Only call activate_vgs a second time if any logical volumes have actually been activated.
-rw-r--r--functions6
-rwxr-xr-xrc.sysinit7
2 files changed, 10 insertions, 3 deletions
diff --git a/functions b/functions
index 9cec7a0..b424879 100644
--- a/functions
+++ b/functions
@@ -272,7 +272,11 @@ read_crypttab() {
while read line; do
[[ $line && ${line:0:1} != '#' ]] || continue
eval nspo=("${line%#*}")
- $1 "${nspo[0]}" "${nspo[1]}" "${nspo[2]}" "${nspo[*]:3}" || failed=1
+ if $1 "${nspo[0]}" "${nspo[1]}" "${nspo[2]}" "${nspo[*]:3}"; then
+ crypto_unlocked=1
+ else
+ failed=1
+ fi
done < /etc/crypttab
return $failed
}
diff --git a/rc.sysinit b/rc.sysinit
index d562e36..3ed61c7 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -202,13 +202,16 @@ if [[ -f /etc/crypttab && $CS ]]; then
fi
return $failed
}
+ crypto_unlocked=0
if read_crypttab do_unlock; then
stat_done
else
stat_fail
fi
- # Maybe someone has LVM on an encrypted block device
- activate_vgs
+ if [[ ${crypto_unlocked} -eq 1 ]]; then
+ # Maybe someone has LVM on an encrypted block device
+ activate_vgs
+ fi
fi
status "Mounting Root Read-only" /bin/mount -n -o remount,ro /