Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 296788 - sys-fs/udev-149 udevd warning about rules.d/70-nut-usbups
Summary: sys-fs/udev-149 udevd warning about rules.d/70-nut-usbups
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-13 21:58 UTC by gglaboussole
Modified: 2010-06-29 18:44 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
suggestion from comment #1 (nut-udev-rules.diff,7.05 KB, patch)
2010-02-22 12:06 UTC, Fab
Details | Diff
install the udev rules only if usb is enabled (nut-no-usb-rules.diff,591 bytes, patch)
2010-03-20 21:01 UTC, Lex Brugman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description gglaboussole 2009-12-13 21:58:13 UTC
After upgrading from udev 147-r1 I've noticed lot of complaints in my log and at boot time.
I don't now if this is a problem with sys-power/nut-2.4.1-r1 and its rules.d/70-nut-usbups.rules or with th latest version of udev :

SYSFS{}= will be removed in a future ude
v version, please use ATTR{}= to match the event device, or ATTRS{}= to match a
parent device, in /etc/udev/rules.d/70-nut-usbups.rules:90


I'm not an expert in udev rules but simply change SYSFS{} by ATTR{} or ATTRS{} stop theses warnings but doesn't solve the problem, worse it make me my ups disappeared

Reproducible: Always

Steps to Reproduce:
1.upgrade to sys-fs/udev-149
2.
3.

Actual Results:  
warnings

Expected Results:  
stop 

emerge --info
Portage 2.1.7.14 (default/linux/amd64/10.0/desktop, gcc-4.4.2, glibc-2.11-r1, 2.6.32-gentoo x86_64)
=================================================================
System uname: Linux-2.6.32-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.0.1
Timestamp of tree: Sun, 13 Dec 2009 20:15:02 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4, 3.1.1-r1
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.0
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.3
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.64
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA PUEL QUAKE4 dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests candy ccache distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.ovh.net/gentoo-distfiles/"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="fr"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/roslin /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa amd64 bash-completion berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt css cups cxx dbus dri dts dv dvd dvdr eds emboss encode evo exif faac faad ffmpeg firefox flac fortran gdbm gif gimp glitz gnome gnutls gphoto2 gpm gstreamer gtk hal iconv id3tag ieee1394 imagemagick ipv6 java jpeg lame libnotify libsamplerate libsndfile mad matroska mikmod mjpeg mmx modules mp3 mp4 mpeg mplayer mudflap multilib musepack mysql nautilus ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre pdf perl png ppds pppd pulseaudio python qt3support qt4 quicktime readline reflection sdl session smp sndfile sox spell spl sse sse2 ssl ssse3 startup-notification stream svg sysfs taglib tcpd theora thunar tiff truetype twolame unicode usb v4l vcd vdpau vorbis wavpack webkit wma x264 xcb xml xorg xulrunner xv xvid zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev " KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" RUBY_TARGETS="ruby18" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="nvidia vesa " 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Matthias Schwarzott gentoo-dev 2009-12-15 19:29:47 UTC
@robbat2:
This package seems to install its rules into /etc/udev/rules.d and /lib/udev/rules.d.
So udev-125 and newer does not care about the file in /etc and takes the one from /lib.
So either move completely to /lib and require udev-125, or just stay at /etc.

About the changes required in the rules:
SYSFS should be changed to ATTR.
The header of the file looks normal so far. But maybe the BUS line needs to be changed/removed.
Most udev rules apply permissions at add and change events.

As far as I remember there are two different matches for these devices:
For new kernels: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device"
For old kernels: SUBSYSTEM=="usb_device"

Here old means older than 2.6.22.

I suggest something like:
ACTION!="add|change", GOTO="nut-usbups_rules_end"
SUBSYSTEM=="usb_device", GOTO="nut-usbups_rules_real"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="nut-usbups_rules_real"
GOTO="nut-usbups_rules_end"

LABEL="nut-usbups_rules_real"
Comment 2 Guy 2009-12-27 20:44:43 UTC
Disclaimer: I am not a programmer.

To the reporter:

This may not be a problem with "udev" but rather with "sys-power/nut".

What's being reported is that future releases of "udev" will no longer support a specific rule construction. The "rule" udev is complaining about is actually provided by the "sys-power/nut" ebuild.

You can confirm this by running the following command in a terminal window either as "root" or using "sudo" depending on how you log in and how you're system is configured. You also need to have the package "gentoolkit" installed for this command to work:

# equery b 70-nut-usbups.rules

It will tell which package was the source for the rules file.

The devs may actually re-assign this bug to the sys-power/nut maintainer.

Unfortunately, since I'm not a programmer, I can't provide a patch file as a suggested fix.
Comment 3 gglaboussole 2009-12-28 10:51:48 UTC
(In reply to comment #2)
> 
> # equery b 70-nut-usbups.rules
> 
> It will tell which package was the source for the rules file.
> 
> The devs may actually re-assign this bug to the sys-power/nut maintainer.
> 
> Unfortunately, since I'm not a programmer, I can't provide a patch file as a
> suggested fix.
> 

In facts I'did this command... it's because I've wrote : "I don't now if this is a problem with sys-power/nut-2.4.1-r1 and its
rules.d/70-nut-usbups.rules or with th latest version of udev" 
The results is that nut and this version of udev don't work well together, so as I'm not a programmer too, I've reported this problem for let the programmer to analyze if this is a problem with udev or nut..
I'm just an user, I have no possibility too solve the problem alone, I can just report this
Regards
Comment 4 Fab 2010-02-22 11:47:08 UTC
Just hit this bug after upgrading to udev-149. Tried suggestion from comment #1 applied on both /etc/udev/rules.d and /lib/udev/rules.d files, changed nothing. udev continues to spam me with this warning on each boot.
Comment 5 Fab 2010-02-22 12:06:05 UTC
Created attachment 220691 [details, diff]
suggestion from comment #1

Ok, finally the suggestion from comment #1 did the trick.
I simply forgot to change each occurence of SYSFS with ATTR.
See attached patch.
Comment 6 Lex Brugman 2010-03-20 21:01:46 UTC
Created attachment 224435 [details, diff]
install the udev rules only if usb is enabled

This patch modifies the ebuild to only install the usb udev rules if the usb useflag is enabled as they are not needed when not using any usb ups.
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-05-25 19:45:51 UTC
This has been fixed sys-power/nut-2.4.3 for nearly a month. Just upgrade.
Comment 8 Richard Scott 2010-05-26 10:03:09 UTC
(In reply to comment #7)
> This has been fixed sys-power/nut-2.4.3 for nearly a month. Just upgrade.
> 

Perhaps we need to mark this as stable to make it easier to upgrade?
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-05-26 10:30:55 UTC
There is a STABLEREQ already.
Comment 10 Richard Scott 2010-06-29 15:42:33 UTC
(In reply to comment #9)
> There is a STABLEREQ already.

I can't find such a request:
http://bugs.gentoo.org/buglist.cgi?quicksearch=STABLEREQ

Am I looking in the wrong place?

Rich
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-06-29 18:44:28 UTC
Yes, bug 321493.