From owner-freebsd-stable@FreeBSD.ORG Mon Mar 2 13:23:52 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 038B4106564A for ; Mon, 2 Mar 2009 13:23:52 +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 418678FC14 for ; Mon, 2 Mar 2009 13:23:50 +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 PAA22696; Mon, 02 Mar 2009 15:23:46 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <49ABDDE2.6090402@icyb.net.ua> Date: Mon, 02 Mar 2009 15:23:46 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090110) MIME-Version: 1.0 To: Kostik Belousov References: <20090228143453.GX41617@deviant.kiev.zoral.com.ua> In-Reply-To: <20090228143453.GX41617@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org, Michael Sperber 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:23:52 -0000 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"; }; -- Andriy Gapon