API to link sysctl nodes to devices

Poul-Henning Kamp phk at phk.freebsd.dk
Sat Jun 4 08:52:58 UTC 2016


--------
In message <CAN1JrQ2dd0WZi0_aaNdqH9xdy292tP2DYLxvKV9bfK93vYFLXw at mail.gmail.com>
, KILOREUX Emperex writes:

>As part of my participation GSOC, I have been working on an API spec to
>link sysctl nodes to devices.

It's not really the sysctl nodes as such you should focus on, but
rather on the gap between (the increasingly inaccurately named)
newbus and devfs.

The poster-boy example is how you get from USB bus coordinates to
/dev/da* or /dev/{tty|cua}U* devices.

devd(8) seems to know the linkage and usually I resort to /etc/devd
entries like this to make it liveable:

	attach 1000 {
		match "device-name"     "uftdi[0-9]*";
		match "vendor"          "0x0403";
		match "product"         "0x6001";
		match "sernum"          "FTHAV9UU";
		action "ln -s /dev/cua$ttyname /dev/bbb1";
	};

	notify 1000 {
		match "system"          "USB";
		match "subsystem"       "DEVICE";
		match "type"            "DETACH";
		match "vendor"          "0x0403";
		match "product"         "0x6001";
		match "sernum"          "FTHAV9UU";
		action "rm -f /dev/bbb1";
	};


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-arch mailing list