New device wiring option
Daniel O'Connor
darius at dons.net.au
Fri Apr 16 11:36:01 UTC 2021
> On 15 Apr 2021, at 14:47, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
>
> --------
> Bjoern A. Zeeb writes:
>
>> Probably USB as well? Having 10 serial consoles on USB Hubs and unplugging
>> one “early” one it is easy to end up re-numbering the entire chain after a
>> reboot. Not sure if this really fits into your problem/implementation domain.
>
> My solution to that specific problem is the following entry in /etc/devd:
>
> attach 500 {
> match "device-name" "uftdi[0-9]*";
> match "vendor" "0x0403";
> match "product" "(0x6001|0x6015)";
> action "ln -fs /dev/cua$ttyname /dev/cua_$sernum";
> };
>
> notify 500 {
> match "system" "USB";
> match "subsystem" "DEVICE";
> match "type" "DETACH";
> match "vendor" "0x0403";
> match "product" "(0x6001|0x6015)";
> action "rm -f /dev/cua_$sernum";
> };
I wrote a more general version of this, although when I did testing the serial number was not available so I had to store it for deletion later.
--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
-------------- next part --------------
An embedded message was scrubbed...
From: "O'Connor, Daniel" <darius at dons.net.au>
Subject: USB serial ports by serial number
Date: Thu, 3 Oct 2019 12:25:09 +0930
Size: 2277
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20210416/3ab68ca2/attachment.eml>
More information about the freebsd-arch
mailing list