summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/defaults/rc.conf2
-rw-r--r--etc/rc.d/gbde16
2 files changed, 15 insertions, 3 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index c4a94fb..df9bd0c 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -50,6 +50,8 @@ rc_conf_files="/etc/rc.conf /etc/rc.conf.local"
# Experimental - test before enabling
gbde_autoattach_all="NO" # YES automatically mounts gbde devices from fstab
gbde_devices="NO" # Devices to automatically attach (list, or AUTO)
+gbde_attach_attempts="3" # Number of times to attempt attaching gbde devices
+gbde_lockdir="/etc" # Where to look for gbde lockfiles
gbde_swap_enable="NO" # Set to YES to automatically initialize gbde swap
# devices listed in fstab with a random one-shot key
diff --git a/etc/rc.d/gbde b/etc/rc.d/gbde
index 25bcd2a..6359f41 100644
--- a/etc/rc.d/gbde
+++ b/etc/rc.d/gbde
@@ -81,10 +81,20 @@ gbde_start()
for device in $gbde_devices; do
parentdev=${device%.bde}
parent=${parentdev#/dev/}
- eval "lock=\${gbde_lock_${parent}-\"/etc/${parent}.lock\"}"
- if [ -e $lock ]; then
+ eval "lock=\${gbde_lock_${parent}-\"${gbde_lockdir}/${parent}.lock\"}"
+ if [ -e "${lock}" -a ! -e "${device}" ]; then
echo "Configuring Disk Encryption for ${device}."
- gbde attach ${parentdev} -l ${lock}
+
+ count=1
+ while [ ${count} -le ${gbde_attach_attempts} ]; do
+ gbde attach ${parentdev} -l ${lock}
+ if [ -e ${device} ]; then
+ break
+ fi
+ echo "Attach failed; attempt ${count} of ${gbde_attach_attempts}."
+ count=$((${count} + 1))
+ done
+
fi
done
}
OpenPOWER on IntegriCloud