summaryrefslogtreecommitdiffstats
path: root/etc/rc.subr
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-08-14 18:02:22 +0000
committerpjd <pjd@FreeBSD.org>2005-08-14 18:02:22 +0000
commita2b7d697913d661fda3cdf89df1b40035f6c116a (patch)
tree85e2934f5d33797f65e52eef52a990ff180d2d5d /etc/rc.subr
parent4c42e011b4355b63d51ade3c0d027dde76715566 (diff)
downloadFreeBSD-src-a2b7d697913d661fda3cdf89df1b40035f6c116a.zip
FreeBSD-src-a2b7d697913d661fda3cdf89df1b40035f6c116a.tar.gz
Add scripts for GELI device configuration on boot.
rc.d/geli - configures encryption (ask for passphrases, etc.); rc.d/geli2 - is called after file systems are mounted and mark devices for detach on last close. Sponsored by: Wheel Sp. z o.o. http://www.wheel.pl MFC after: 3 days
Diffstat (limited to 'etc/rc.subr')
-rw-r--r--etc/rc.subr34
1 files changed, 34 insertions, 0 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index 77f0592..e70fffb 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -1320,4 +1320,38 @@ ltr()
echo "${_out}"
}
+# Creates a list of providers for GELI encryption.
+geli_make_list()
+{
+ local devices devices2
+ local provider mountpoint type options rest
+
+ # Create list of GELI providers from fstab.
+ while read provider mountpoint type options rest ; do
+ case ":${provider}" in
+ :#*)
+ continue
+ ;;
+ *.eli)
+ # Skip swap devices.
+ if [ "${type}" = "swap" -o "${options}" = "sw" ]; then
+ continue
+ fi
+ devices="${devices} ${provider}"
+ ;;
+ esac
+ done < /etc/fstab
+
+ # Append providers from geli_devices.
+ devices="${devices} ${geli_devices}"
+
+ for provider in ${devices}; do
+ provider=${provider%.eli}
+ provider=${provider#/dev/}
+ devices2="${devices2} ${provider}"
+ done
+
+ echo ${devices2}
+}
+
fi
OpenPOWER on IntegriCloud