Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Dec 2003 21:14:38 -0500
From:      Barney Wolff <barney@databus.com>
To:        Andrew Thompson <andy@fud.org.nz>
Cc:        current@freebsd.org
Subject:   Re: devd & ukbd
Message-ID:  <20031212021438.GA18921@pit.databus.com>
In-Reply-To: <20031212014907.GA86634@kate.fud.org.nz>
References:  <20031212014907.GA86634@kate.fud.org.nz>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 12, 2003 at 02:49:07PM +1300, Andrew Thompson wrote:
> 
> I am trying to put together a devd rule for attaching a usb keyboard. The 
> problem is that the usb device is called ukbd0 while the keyboard needs to
> be referred to as kbd1.
> 
> attach 10 {
>         device-name "ukbd[0-9]+";
>         action "kbdcontrol -k /dev/$device-name < /dev/console";
> };
> detach 10 {
>         device-name "ukbd[0-9]+";
>         action "kbdcontrol -k /dev/kbd0";
> };
> 
> This obviously doesnt work as /dev/ukbd0 doesnt exist, anyone know a way
> in devd to translate it to /dev/kbd1?
> 
> maybe something like kbd($device-number + 1)
> 
> A better solution would be if the kbd1 device caused a devd event when 
> attached, which it does not seem to.

I do it in /etc/usbd.conf, with:
device "KB"
	devname "ukbd[0-9]+"
	attach  "kbdcontrol -k `ls /dev/kbd* |tail -1` </dev/console"

-- 
Barney Wolff         http://www.databus.com/bwresume.pdf
I'm available by contract or FT, in the NYC metro area or via the 'Net.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031212021438.GA18921>