From owner-freebsd-stable@FreeBSD.ORG Mon Mar 2 13:53:32 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 84CF4106570E for ; Mon, 2 Mar 2009 13:53:32 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C091F8FC14 for ; Mon, 2 Mar 2009 13:53:31 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA23825; Mon, 02 Mar 2009 15:53:27 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <49ABE4D7.1060403@icyb.net.ua> Date: Mon, 02 Mar 2009 15:53:27 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090110) MIME-Version: 1.0 To: Michael Sperber References: <20090228143453.GX41617@deviant.kiev.zoral.com.ua> <49ABDDE2.6090402@icyb.net.ua> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Kostik Belousov , freebsd-stable@freebsd.org Subject: Re: devd question 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: Mon, 02 Mar 2009 13:53:33 -0000 on 02/03/2009 15:51 Michael Sperber said the following: > Andriy Gapon writes: > >> on 28/02/2009 16:34 Kostik Belousov said the following: >>> On Sat, Feb 28, 2009 at 02:13:10PM +0100, Michael Sperber wrote: >>>> I'm trying to make devd run an stty command whenever a USB serial device >>>> is attached. Unfortunately, $device-name is ucom[0-9] and the device >>>> names are /dev/cuaU[0-9] - how do I get the correct name in the device >>>> action? I haven't found a way to extract the number by itself, so I'm >>>> stuck with specifying a separate rule for each number, like so: >>>> >>>> attach 100 { >>>> device-name "ucom0"; >>>> action "stty -f /dev/cuaU0.init raw"; >>>> }; >>>> >>>> Help would be much appreciated! >>> There are some other notifications that are send through devctl when >>> cdev is created. They have system set to DEVFS, subsystem to CDEV, >>> and type CREATE. The data is the /dev node name. I am not sure how >>> to assign the action in the devd. >> A tested example: >> notify 1000 { >> match "system" "DEVFS"; >> match "subsystem" "CDEV"; >> match "cdev" "^da[0-9]+$"; >> action "echo 't120o3l32 b>c+f+16' > /dev/speaker"; >> }; > > I'm probably not understanding this---but how is the device number > transferred from the "cdev" match to the "action" line? You don't need to, you can use /dev/$cdev in action line. -- Andriy Gapon