From owner-freebsd-current@FreeBSD.ORG Fri Jul 17 15:02:39 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68359106566C for ; Fri, 17 Jul 2009 15:02:39 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 10B118FC17 for ; Fri, 17 Jul 2009 15:02:38 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id n6HF2ahG002572 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Jul 2009 17:02:36 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by cicely5.cicely.de (8.14.2/8.14.2) with ESMTP id n6HF2O9N001556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Jul 2009 17:02:24 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id n6HF2OFg098841; Fri, 17 Jul 2009 17:02:24 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id n6HF2Nn8098840; Fri, 17 Jul 2009 17:02:23 +0200 (CEST) (envelope-from ticso) Date: Fri, 17 Jul 2009 17:02:23 +0200 From: Bernd Walter To: Sagara Wijetunga Message-ID: <20090717150222.GJ97863@cicely7.cicely.de> References: <20090714123509.16504.qmail@us1.tomahawkonline.net> <20090717071401.32195.qmail@us1.tomahawkonline.net> <200907171322.54942.hselasky@c2i.net> <20090717085556.1810.qmail@us1.tomahawkonline.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090717085556.1810.qmail@us1.tomahawkonline.net> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, AWL=0.007, BAYES_00=-2.599 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on spamd.cicely.de Cc: freebsd-current@freebsd.org, Hans Petter Selasky Subject: Re: Is extra USB event possible in FreeBSD 8? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2009 15:02:39 -0000 On Fri, Jul 17, 2009 at 04:55:56PM +0800, Sagara Wijetunga wrote: > Hans Petter Selasky writes: > > >>Hi FreeBSD community > >> > >>In case if my earlier post was not clear, here are bit more detail to > >>explain my question. > >> > >>We want to catch device creation USB events at the devd and take actions > >>as > >>specified in following devd rules: > >> > >>attach 200 { > >> match "vendor" "0x0718"; > >> match "product" "0x0081"; > >> match "sernum" "14925B00"; > >> device-name "da[0-9]+"; > >> action "action $device-name otherparams"; > >>}; > > > >It is not USB that creates /dev/daXXX. This is done by the CAM layer and > >its subsystems. Also the CAM layer does not have any place to supply such > >information. What we could possibly do is to fake a SCSI command providing > >the CAM layer with the required information. > > > >Else, are you aware about disk-labels, to uniquely identify disks? > > > > Hi Hans Petter > > Thank you very much for your prompt reply. > > Regarding "disk-labels", is it "label:" tag you specify for bsdlabel with > -A option? > > If it is, this option is out. Almost all of the USB mass storage devices, > eg. USB flash disks, cameras, audio players, etc. are already formatted. We > cannot ask users to format first (ie. in FreeBSD terms create disk lables, > create files systems, etc) before use as it make no sense at all. Eg. One > buy a camera at the airport, take photos on a tour, after the tour wants to > transfer photos to the computer. Now its too late to create labels. There are more label types. glabel is the tool to create partition label, which reduces disk size and requires reformating, but geom_label can use other labels as well. msdosfs has it's media name in the filesystem header. E.g. my camera media identifies as /dev/msdosfs/HP_Mz60 and my cell phone under /dev/msdosfs/E65 UFS labels indentify under /dev/ufs, ... Those label names can be changed at any time on already formated media, since they are already part of the filesystem. > Therefore, your first option sounds interesting. I'm not sure is it the > correct way forward. As you are the USB expert, could you recommend the > correct solution? You want to identify media not USB devices. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.