From cbbd435170f3b8ec9f2b32611a4fe83b4254be35 Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Tue, 29 Jul 2014 21:15:02 +0200 Subject: 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. --- 1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '1') 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 -- cgit 1.4.1