[Nut-upsdev] udev versions (was Re: [Nut-upsuser] still no nut at reboot)

Charles Lepple clepple at gmail.com
Tue Nov 16 12:27:56 UTC 2010

(moving to -upsdev since it is really more of a code maintenance  

On Nov 15, 2010, at 8:09 AM, Arjen de Korte wrote:

> Citeren Charles Lepple <clepple at gmail.com>:
>>> Whats next coach?  I'm going blind staring at this, and probably  
>>> missing
>>> something obvious, like hacking on the 52-* udev script some more  
>>> to change
>>> some perms?  FWIW, changing all the 'ATTR' to 'ATTRS' shut it up
>>> completely.  This was udev complaining about a deprecated format.   
>>> Other
>>> than the spelling, I didn't change anything else.
>> Sigh. Good to know that we will need to update that at some point.  
>> (I wonder how many older udev installations we will break if we  
>> change that now? Guess we could ship two copies.)
> The change in r2071 might not be correct in the first place. See the  
> following (which ironically, I found through the comments in this  
> commit):
>    http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=NEWS#l850
> This suggests (among other things) to change SYSFS to ATTRS (not  
> ATTR), exactly what seems to be needed to make the rules files work  
> again. Without digging much further into this, I think it makes  
> sense to follow that and use ATTRS instead.


I have seen at least one file on an Ubuntu 10.04 box which uses both  
methods, and makes it conditional on whether the kernel is sending  
"usb" or "usb_device" events:

> # UDEV-style hotplug map for libmtp
> # Put this file in /etc/udev/rules.d
> ACTION!="add", GOTO="libmtp_rules_end"
> ATTR{dev}!="?*", GOTO="libmtp_rules_end"
> SUBSYSTEM=="usb", GOTO="libmtp_usb_rules"
> # The following thing will be deprecated when older kernels are  
> phased out.
> SUBSYSTEM=="usb_device", GOTO="libmtp_usb_device_rules"
> GOTO="libmtp_rules_end"
> LABEL="libmtp_usb_rules"
> # Creative ZEN Vision
> ATTR{idVendor}=="041e", ATTR{idProduct}=="411f", SYMLINK+="libmtp- 
> %k", MODE="660", GROUP="audio"
> [...]
> GOTO="libmtp_rules_end"
> LABEL="libmtp_usb_device_rules"
> # Creative ZEN Vision
> ATTRS{idVendor}=="041e", ATTRS{idProduct}=="411f", SYMLINK+="libmtp- 
> %k", MODE="660", GROUP="audio"

Looks like Ubuntu changed to the udev which supports ATTRS sometime  
between 6.06 and 8.04 (2006 and 2008), but I haven't tracked down when  
the kernels changed over.

More information about the Nut-upsdev mailing list