From owner-freebsd-stable@FreeBSD.ORG Thu Jul 23 03:32:18 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72BBA10656B7 for ; Thu, 23 Jul 2009 03:32:18 +0000 (UTC) (envelope-from sagara@tomahawk.com.sg) Received: from us1.tomahawkonline.net (us1.tomahawkonline.net [66.98.178.56]) by mx1.freebsd.org (Postfix) with SMTP id 39C048FC0A for ; Thu, 23 Jul 2009 03:32:18 +0000 (UTC) (envelope-from sagara@tomahawk.com.sg) Received: (qmail 27859 invoked by alias); 23 Jul 2009 00:13:38 -0000 Message-ID: <20090723001338.27858.qmail@us1.tomahawkonline.net> References: <20090722022027.12059.qmail@us1.tomahawkonline.net> <20090722142033.GA13316@svzserv.kemerovo.su> In-Reply-To: <20090722142033.GA13316@svzserv.kemerovo.su> From: "Sagara Wijetunga" To: Eugene Grosbein Date: Thu, 23 Jul 2009 08:13:38 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-stable@freebsd.org Subject: Re: SCSI device not created upon a CF card plug in X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 03:32:18 -0000 Eugene Grosbein writes: > On Wed, Jul 22, 2009 at 10:20:27AM +0800, Sagara Wijetunga wrote: > >> My questions in this regards are: >> 1. Is this an error/bug in FreeBSD 7.2? > > This is regression from pre-5.x days. In 4.x and earlier, > you can have static device nodes and access them just fine. > >> 2. Or, does it require some configuration tweak? > > As a workaround, you should drop cardreader.conf into /usr/local/etc/devd/ > (create directory if it does not exist) with contents like: > > attach 1000 { > device-name "umass[0-9]+"; > action "/usr/local/libexec/umass/attach-umass $device-name"; > }; > > Script /usr/local/libexec/umass/attach-umass is invoked > when umassX appears: > > #!/bin/sh > > PATH=/bin:/sbin:/usr/bin:/usr/sbin > DEV=/dev > p=`dirname $0` > > [ -z "$1" ] && exit 1 > u="$1" > > # wait until dust settles > i=1; > while [ $i -le 10 ] > do > sleep 1 > device=`$p/umass2da $u` > if [ $? = 0 ]; then > : > $DEV/${device} > break > fi > i=$(($i+1)) > done > > This script calls /usr/local/libexec/umass/umass2da helper > to translate umassX to daY (in hope this translation is possible): > > #!/bin/sh > PATH=/sbin:/usr/bin > > camcontrol devlist -v | awk -v u=$1 '\ > BEGIN { s = ""; e = 1; } > $3 ~ /umass-sim[0-9]+/ { s = $3; sub("-sim","",s); } > /[,(]da[0-9]+.*\)$/ { > if(s == u) { > match($NF, /da[0-9]+/); > print substr($NF, RSTART, RLENGTH); > e=0; exit 0; > } > } > END { exit e; }' > Hi Eugene, thanks for the reply. The issue we discussed is about internal multi-card readers. For internal multi-card readers, the umassX created at boot time. If there is media inside at boot time, the device node for slices are also created. There is no issue about it. But the issue is after boot up, later some time, if you plug in a media card, FreeBSD does not generate any devd event. This needs to be fixed at the FreeBSD end, appreciate if the FreeBSD community actively fix it soon. Best regards Sagara