From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 21 08:57:07 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D620E16A4CE for ; Fri, 21 Jan 2005 08:57:07 +0000 (GMT) Received: from people.fsn.hu (people.fsn.hu [195.228.252.137]) by mx1.FreeBSD.org (Postfix) with ESMTP id A240A43D1F for ; Fri, 21 Jan 2005 08:57:06 +0000 (GMT) (envelope-from bra@fsn.hu) Received: from localhost (localhost [127.0.0.1]) by people.fsn.hu (Postfix) with ESMTP id 46FAF84446 for ; Fri, 21 Jan 2005 09:57:05 +0100 (CET) Received: from people.fsn.hu ([127.0.0.1]) by localhost (people.fsn.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 54228-04-2 for ; Fri, 21 Jan 2005 09:56:59 +0100 (CET) Received: from [172.16.129.72] (japan.axelero.com [195.228.243.99]) by people.fsn.hu (Postfix) with ESMTP id 3A95184425 for ; Fri, 21 Jan 2005 09:56:59 +0100 (CET) Message-ID: <41F0C3DA.50104@fsn.hu> Date: Fri, 21 Jan 2005 09:56:58 +0100 From: Attila Nagy User-Agent: Mozilla Thunderbird 1.0 (X11/20050103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: hackers@freebsd.org Content-Type: multipart/mixed; boundary="------------050708080301000901060103" X-Virus-Scanned: amavisd-new at fsn.hu Subject: geom mirror and gbde X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2005 08:57:07 -0000 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--