about summary refs log tree commit diff
path: root/core-services/03-filesystems.sh
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2015-01-16 09:31:47 +0100
committerJuan RP <xtraeme@gmail.com>2015-01-16 09:31:47 +0100
commit9cad0b82f00618bb4b6747ab9b3865579528c5db (patch)
tree0329dafe1684802c32350f6a16333851660aa67f /core-services/03-filesystems.sh
parentb51217a9ca94684413361b230dfeb5a3737f31b8 (diff)
parent56e66d8c3cee0f41ac851c1e02bebbe34b4e84ef (diff)
downloadrunit-void-9cad0b82f00618bb4b6747ab9b3865579528c5db.tar.gz
runit-void-9cad0b82f00618bb4b6747ab9b3865579528c5db.tar.xz
runit-void-9cad0b82f00618bb4b6747ab9b3865579528c5db.zip
Merge pull request #12 from pulux/master
add a script to handle more crypttab options
Diffstat (limited to 'core-services/03-filesystems.sh')
-rw-r--r--core-services/03-filesystems.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/core-services/03-filesystems.sh b/core-services/03-filesystems.sh
index af55570..e46c83d 100644
--- a/core-services/03-filesystems.sh
+++ b/core-services/03-filesystems.sh
@@ -22,9 +22,14 @@ 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
+    if [ -e /etc/runit/crypt.awk ]; then
+        awk -f /etc/runit/crypt.awk /etc/crypttab
+    else:
+        msg_warn "parsing file not found, fallback to dest src filds\n"
+        awk '/^#/ || /^$/ { next }
+           NF>2 { print "unsupported crypttab: " $0 >"/dev/stderr"; next}
+           { system("cryptsetup luksOpen " $2 " " $1) }' /etc/crypttab
+    fi
 
     if [ -x /sbin/vgchange ]; then
         msg "Activating LVM devices for dm-crypt...\n"