summary refs log tree commit diff
diff options
context:
space:
mode:
authorDominik Honnef <dominikh@fork-bomb.org>2014-07-29 21:15:02 +0200
committerDominik Honnef <dominikh@fork-bomb.org>2014-07-29 21:15:02 +0200
commitcbbd435170f3b8ec9f2b32611a4fe83b4254be35 (patch)
treea2274bea6d8f52f787cade65b9abc21cd883a023
parent9d3e9c62475d9ade4e0e09a28d8712a8ac7e825f (diff)
downloadrunit-void-cbbd435170f3b8ec9f2b32611a4fe83b4254be35.tar.gz
runit-void-cbbd435170f3b8ec9f2b32611a4fe83b4254be35.tar.xz
runit-void-cbbd435170f3b8ec9f2b32611a4fe83b4254be35.zip
add support for basic crypttabs
allows using basic crypttabs (those consisting of only two fields).

LVM devices need to be scanned twice: before and after processing the
crypttab, as both crypt on top of LVM and LVM on top of crypt are common
setups.
-rwxr-xr-x112
1 files changed, 12 insertions, 0 deletions
diff --git a/1 b/1
index dda6746..8b02fe6 100755
--- a/1
+++ b/1
@@ -97,6 +97,18 @@ if [ -x /usr/sbin/dmraid ]; then
     /usr/sbin/dmraid -i -ay
 fi
 
+if [ -x /usr/sbin/vgchange ]; then
+    msg "Activating LVM devices...\n"
+    vgchange --sysinit -a y
+fi
+
+if [ -e /etc/crypttab ]; then
+    msg "Activating encrypted devices...\n"
+    awk '/^#/ || /^$/ { next }
+         NF>2 { print "unsupported crypttab: " $0 >"/dev/stderr"; next }
+         { system("cryptsetup luksOpen " $2 " " $1) }' /etc/crypttab
+fi
+
 if [ -x /usr/bin/btrfs ]; then
     msg "Activating btrfs devices...\n"
     btrfs device scan