|
Index: etc/rc.d/gbde
===================================================================
RCS file: /home/ncvs/src/etc/rc.d/gbde,v
retrieving revision 1.1
diff -u -r1.1 gbde
--- etc/rc.d/gbde 17 Jun 2003 02:56:29 -0000 1.1
+++ etc/rc.d/gbde 17 Jan 2004 17:09:14 -0000
@@ -72,10 +72,20 @@
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
}
Index: etc/defaults/rc.conf
===================================================================
RCS file: /home/ncvs/src/etc/defaults/rc.conf,v
retrieving revision 1.195
diff -u -r1.195 rc.conf
--- etc/defaults/rc.conf 25 Dec 2003 23:29:19 -0000 1.195
+++ etc/defaults/rc.conf 17 Jan 2004 17:29:15 -0000
@@ -45,6 +45,8 @@
# 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.
fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails.
background_fsck="YES" # Attempt to run fsck in the background where possible.
Index: share/man/man5/rc.conf.5
===================================================================
RCS file: /home/ncvs/src/share/man/man5/rc.conf.5,v
retrieving revision 1.203
diff -u -r1.203 rc.conf.5
--- share/man/man5/rc.conf.5 26 Dec 2003 03:41:27 -0000 1.203
+++ share/man/man5/rc.conf.5 17 Jan 2004 17:29:49 -0000
@@ -922,13 +922,40 @@
If set to
.Dq Li YES ,
.Pa /etc/rc.d/gbde
-will attempt to automatically initialize your .bde devices in
+will attempt to automatically initialize your
+.Xr gbde 4
+devices in
.Pa /etc/fstab .
.It Va gbde_devices
.Pq Vt str
List the devices that the script should try to attach,
or
.Dq Li AUTO .
+.It Va gbde_lockdir
+.Pq Vt str
+The directory where the
+.Xr gbde 4
+lockfiles are located.
+The default lockfile directory is
+.Pa /etc .
+.Pp
+The lockfile for each individual
+.Xr gbde 4
+device can be overridden by setting the variable
+.Va gbde_lock_ Ns Aq Ar device ,
+where
+.Ar device
+is the encrypted device without the
+.Dq Pa /dev/
+and
+.Dq Pa .bde
+parts.
+.It Va gbde_attach_attempts
+.Pq Vt int
+Number of times to attempt attaching to a
+.Xr gbde 4
+device, i.e. how many times the user is asked for the pass-phrase.
+Default is 3.
.It Va fsck_y_enable
.Pq Vt bool
If set to
|