On Fri, May 18, 2012 at 1:37 PM, Christoph Lohmann <[email protected]> wrote: > On Fri, 18 May 2012 13:37:42 +0200 Denys Vlasenko <[email protected]> > wrote: >> In general I'd say our mdev.conf syntax looks like a bottleneck now: >> kernel exports a lot more info than we can match... >> need to think more about it. > > It isn’t. The syntax is very good at preliminary parsing. I would like > to have some utility that will just evaluate the mdev.conf syntax upon > other config files. For example some /etc/usb.conf could be similiar, > just evaluating the PRODUCT variable given by the kernel. The scripts > run there inside will still have all variables for further evaluation. > > The mdev.conf syntax should concentrate on what’s important and that’s > the device name. > > In [0] you can see the scripts I use to replace udev on my desktop sys‐ > tem.
These rules from your file: scsi.*/.* root:disk 660 ! bdi.*/.* root:disk 660 ! bsg/.* root:disk 660 =bsg/ -net/.* root:root 600 @nameif use an undocumented feature that if '/' is present in regexp, then matching is done on SYBSYSTEM/DEVNAME, not just DEVNAME. (1) what if devname itself has slashes? Like this: ACTION=add BUSNUM=001 DEVICE=/proc/bus/usb/001/003 DEVNAME=bus/usb/001/003 <============ !!! DEVNUM=003 DEVPATH=/devices/pci0000:00/0000:00:02.1/usb1/1-5 DEVTYPE=usb_device MAJOR=189 MINOR=2 PRODUCT=18d1/4e12/227 SUBSYSTEM=usb TYPE=0/0/0 (2) Why do we special-case subsystem check like this? What if someone wants to check something else? Take a look at this real-world hotplug invocation: ACTION=add DEVPATH=/devices/pci0000:00/0000:00:02.1/usb1/1-5/1-5:1.0/host5/target5:0:0 DEVTYPE=scsi_target SUBSYSTEM=scsi What if someone needs to match "scsi_target" devtype? How to do it? See the problem? -- vda _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
