Wireless mouse battery level patch

Kay Sievers kay.sievers at vrfy.org
Fri Sep 15 14:43:35 PDT 2006


On Fri, 2006-09-15 at 17:10 -0400, Matthew Williams wrote:
> Kay Sievers wrote:
> > 
> > Your udev rule seems broken. What distro is it? You want something like: 
> > SUBSYSTEM=="usb_device", ACTION="add", PROGRAM="/bin/sh -c 'K=%k;
> > K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'",
> > NAME="%c"
> > 
> 
> I'm using Slackware-current.  It's a late-stage 11.0 release candidate.  The
> relevant udev rule is the same as in the standard udev distribution:

There is no such thing, udev contains no "standard rules".

> SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev};
> B=$${X%%%%.*}; D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c"
> 
> Although your udev rule would also fix this particular problem, the patch
> itself delivers a better comparison in any case.  It doesn't make sense to
> do a string compare of two pairs of integer values.  Your change also
> doesn't cover off the difference in hex vs decimal for /proc/bus/usb vs
> /dev/bus/usb.

What makes you think, that it's hex?

Kay



More information about the hal mailing list