From de0a29236d6ba04502b193719396eb9a79b3e98a Mon Sep 17 00:00:00 2001 From: "Markus.Berger" Date: Mon, 5 Jan 2015 14:29:30 +0100 Subject: add function to parse more crypttab filds and options --- core-services/03-filesystems.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'core-services') diff --git a/core-services/03-filesystems.sh b/core-services/03-filesystems.sh index af55570..8b1e16b 100644 --- a/core-services/03-filesystems.sh +++ b/core-services/03-filesystems.sh @@ -22,9 +22,7 @@ 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 + awk -f /etc/runit/crypt.awk /etc/crypttab if [ -x /sbin/vgchange ]; then msg "Activating LVM devices for dm-crypt...\n" -- cgit 1.4.1 From 7988fd1e20d9eeff0d6d0a80792388333acbece7 Mon Sep 17 00:00:00 2001 From: pulux Date: Tue, 6 Jan 2015 06:28:23 +0100 Subject: add fallback path if crypttab parser not found --- core-services/03-filesystems.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'core-services') 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" -- cgit 1.4.1