Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jan 2005 09:56:58 +0100
From:      Attila Nagy <bra@fsn.hu>
To:        hackers@freebsd.org
Subject:   geom mirror and gbde
Message-ID:  <41F0C3DA.50104@fsn.hu>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------050708080301000901060103
Content-Type: text/plain; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 7bit

Hello,

I would like to use gbde on a geom mirror, but /etc/rc.d/gbde fails if 
there is a slash in the device name.

I don't know what would be the clean solution, I used the attached diff 
to solve the problem.

Please review it and if there is a better solution, commit it.

Thanks,
-- 
Attila Nagy                                   e-mail: Attila.Nagy@fsn.hu
Adopt a directory on our free software   phone @work: +361 371 3536
server! http://www.fsn.hu/?f=brick             cell.: +3630 306 6758

--------------050708080301000901060103
Content-Type: text/plain;
 name="gbde.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="gbde.patch"

--- /tmp/gbde	Fri Jan 21 09:38:51 2005
+++ gbde	Thu Dec  9 10:53:51 2004
@@ -3,7 +3,7 @@
 # This file, originally written by Garrett A. Wollman, is in the public
 # domain.
 #
-# $FreeBSD: /repoman/r/ncvs/src/etc/rc.d/gbde,v 1.5.2.2 2004/10/15 06:14:43 pjd Exp $
+# $FreeBSD: src/etc/rc.d/gbde,v 1.5.2.2 2004/10/15 06:14:43 pjd Exp $
 #
 
 # PROVIDE: disks
@@ -81,16 +81,17 @@
 	for device in $gbde_devices; do
 		parent=${device%.bde}
 		parent=${parent#/dev/}
-		eval "lock=\${gbde_lock_${parent}-\"${gbde_lockdir}/${parent}.lock\"}"
+		parent_=`echo ${parent} | sed "s/\//_/g"`
+		eval "lock=\${gbde_lock_${parent_}-\"${gbde_lockdir}/${parent_}.lock\"}"
 		if [ -e "/dev/${parent}" -a ! -e "/dev/${parent}.bde" ]; then
 			echo "Configuring Disk Encryption for ${parent}."
 
 			count=1
 			while [ ${count} -le ${gbde_attach_attempts} ]; do
 				if [ -e "${lock}" ]; then
-					gbde attach ${parent} -l ${lock}
+					gbde attach /dev/${parent} -l ${lock}
 				else
-					gbde attach ${parent}
+					gbde attach /dev/${parent}
 				fi
 				if [ -e "/dev/${parent}.bde" ]; then
 					break
@@ -109,7 +110,7 @@
 		parent=${parent#/dev/}
 		if [ -e "/dev/${parent}.bde" ]; then
 			umount "/dev/${parent}.bde" 2>/dev/null
-			gbde detach "${parent}"
+			gbde detach "/dev/${parent}"
 		fi
 	done
 }

--------------050708080301000901060103--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41F0C3DA.50104>