about summary refs log tree commit diff
path: root/core-services
diff options
context:
space:
mode:
authorpulux <pulux@pf4sh.de>2015-01-06 06:28:23 +0100
committerpulux <pulux@pf4sh.de>2015-01-06 06:28:23 +0100
commit7988fd1e20d9eeff0d6d0a80792388333acbece7 (patch)
tree461e846dd49ade29e852d0e1cff26996ed271502 /core-services
parent815a44b8fa35697966d2b14821f201d3f88d81a5 (diff)
downloadrunit-void-7988fd1e20d9eeff0d6d0a80792388333acbece7.tar.gz
runit-void-7988fd1e20d9eeff0d6d0a80792388333acbece7.tar.xz
runit-void-7988fd1e20d9eeff0d6d0a80792388333acbece7.zip
add fallback path if crypttab parser not found
Diffstat (limited to 'core-services')
-rw-r--r--core-services/03-filesystems.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/core-services/03-filesystems.sh b/core-services/03-filesystems.sh
index 8b1e16b..e46c83d 100644
--- a/core-services/03-filesystems.sh
+++ b/core-services/03-filesystems.sh
@@ -22,7 +22,14 @@ fi
 
 if [ -e /etc/crypttab ]; then
     msg "Activating encrypted devices...\n"
-    awk -f /etc/runit/crypt.awk /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"