Wireless mouse battery level patch

Matthew Williams mrw7mrw at yahoo.ca
Fri Sep 15 14:10:47 PDT 2006


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:

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.

Matt
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the hal mailing list