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! -- Cheers =8-} Mike Friede, V?lkerverst?ndigung und ?berhaupt blabla
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. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 195 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20090228/565e02cc/attachment.pgp
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