Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 186906 - net-print/hplip-2.7.6 udev rules broken with kernel >= 2.6.22
Summary: net-print/hplip-2.7.6 udev rules broken with kernel >= 2.6.22
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Printing (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
: 188237 188423 (view as bug list)
Depends on: 188796
Blocks: kernel-2.6.22
  Show dependency tree
 
Reported: 2007-07-28 15:24 UTC by Francois Chenier
Modified: 2007-08-22 13:35 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Chenier 2007-07-28 15:24:04 UTC
Due to recent changes in kernel, udev does not set the right group for file associated to USB printer in /dev/bus/usb/*

For kernel >=2.6.22, udev rules in /etc/udev/rules.d/55-hpmud.rules should be 

SUBSYSTEM!="usb", GOTO="hpmud_rules_end"
ACTION!="add", GOTO="hpmud_rules_end"
SYSFS{idVendor}=="03f0", GROUP="lp"
LABEL="hpmud_rules_end"

and not SUBSYSTEM!="usb_device" ...

Tested and working with sys-fs/udev-113-r2, net-print/hplip-2.7.6 and sys-kernel/vanilla-sources-2.6.23_rc1.
Comment 1 Denis Dupeyron (RETIRED) gentoo-dev 2007-08-01 06:22:04 UTC
I have just updated my machine to kernel 2.6.22-r2 (from 2.6.21-r2) and udev-113-r2. I do not seem to have any issue communicating with my officejet device nor printing to it.

Could you provide more information about what the actual problem is ?

Thanks in advance.
Denis.
Comment 2 Francois Chenier 2007-08-01 14:30:24 UTC
On kernel 2.6.23 with unmodified hpmod udev rule (SUBSYSTEM!=usb_device) I got 

crw-rw-r-- 1 root usb 189, 2 2007-08-01 23:07 /dev/bus/usb/001/003

when I connect my printer. Now, when try to print something, CUPS returns an "open device failed; will retry in 30 seconds" error (but everything else like ink level in hplip works fine).

The problem is ... udev should sets group to lp and not to usb (this rule is in /etc/udev/50-udev.rules). If I slightly modify the hpmud rule (SUBSYSTEM!=usb), udev starts to assign group of this device to lp and everything goes back to normal.

I can be wrong with my assumption with kernel 2.6.22 but I've found this hint an /etc/udev/50-udev.rules

Cheers
Comment 3 Francois Chenier 2007-08-01 14:42:30 UTC
Ah yes, my printer is a Photosmart 1115 with a memory card reader (udev may be confused with by this feature thinking it's a USB memory device and not a printer).

Hope may help!
Comment 4 Denis Dupeyron (RETIRED) gentoo-dev 2007-08-01 19:39:54 UTC
(In reply to comment #2)
> On kernel 2.6.23 with unmodified hpmod udev rule (SUBSYSTEM!=usb_device) I got 
> crw-rw-r-- 1 root usb 189, 2 2007-08-01 23:07 /dev/bus/usb/001/003

I definitely do not get this, which was expected as my multifunction device is fully working :

calchan ~ # ls -als /dev/bus/usb/002/002
0 crw-rw-r-- 1 root lp 189, 129 2007-08-01 08:14 /dev/bus/usb/002/002

So it seems it is an issue with the way your particular model is supported. I suggest you report this upstream and see with them if they can help you debug this and eventually solve it.

In the meantime I'm resolving this bug UPSTREAM. Feel free to reopen it if you end up having a fix. As soon as we know what the actual problem is and how to solve it we do not need to wait for a new release of hplip, since I can implement the fix in the ebuild.

Denis.
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2007-08-09 14:45:35 UTC
*** Bug 188237 has been marked as a duplicate of this bug. ***
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-08-09 14:47:13 UTC
Reopen wrt Bug 188237
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2007-08-11 04:44:49 UTC
*** Bug 188423 has been marked as a duplicate of this bug. ***
Comment 8 Matthias Schwarzott gentoo-dev 2007-08-18 14:07:29 UTC
The solution is like in bug 188573:

Using udev-114 (as you already do, it is stable now).
Using this rule
SUBSYSTEM!="usb|usb_device", GOTO="hpmud_rules_end"

It will work for old and new kernels.
Maybe you want to block older udev-version as they do not support this syntax.
Comment 9 Matthias Schwarzott gentoo-dev 2007-08-21 12:08:02 UTC
Added hplip-2.7.7-r1 which contains fixed udev-rules.
Comment 10 Ian Pickworth 2007-08-22 12:51:26 UTC
(In reply to comment #9)
> Added hplip-2.7.7-r1 which contains fixed udev-rules.
> 
I am having a problem with this fix. My system details are:

ian2 ~ # uname -r
2.6.22-gentoo-r5
ian2 ~ # udevinfo --version
114

After upgrade to hplip-2.7.7-r1 and a system reboot, hp-check reports incorrect group:

Checking for permissions of USB attached printers...
HP Device 0x8104 at 001:015: 
    Device URI: hp:/usb/Deskjet_5700?serial=HU4BP1Y021049T
    Device node: /dev/bus/usb/001/015
    Mode: 0664
    UID: 0 (root)
    GID: 85 (usb)
error: INCORRECT group. Group must be 'lp'
error:     Device group and mode are NOT properly setup.

The problem appears to me this line:
  ATTR{idVendor}=="03f0", GROUP="lp"
in the file 55-hpmud.rules

If I change it to
 SYSFS{idVendor}=="03f0", GROUP="lp"

and replug the printer the group ownership is set to lp correctly.

Regards
Ian

Comment 11 Matthias Schwarzott gentoo-dev 2007-08-22 13:01:40 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > Added hplip-2.7.7-r1 which contains fixed udev-rules.
> > 
> I am having a problem with this fix. My system details are:
> 
> ian2 ~ # uname -r
> 2.6.22-gentoo-r5
> ian2 ~ # udevinfo --version
> 114
> 
> After upgrade to hplip-2.7.7-r1 and a system reboot, hp-check reports incorrect
> group:
> 
> Checking for permissions of USB attached printers...
> HP Device 0x8104 at 001:015: 
>     Device URI: hp:/usb/Deskjet_5700?serial=HU4BP1Y021049T
>     Device node: /dev/bus/usb/001/015
>     Mode: 0664
>     UID: 0 (root)
>     GID: 85 (usb)
> error: INCORRECT group. Group must be 'lp'
> error:     Device group and mode are NOT properly setup.
> 
> The problem appears to me this line:
>   ATTR{idVendor}=="03f0", GROUP="lp"
> in the file 55-hpmud.rules
> 
> If I change it to
>  SYSFS{idVendor}=="03f0", GROUP="lp"
> 
> and replug the printer the group ownership is set to lp correctly.
> 
> Regards
> Ian
> 
Strange - that would mean idVendor is at some unusual place in sysfs. Could you please attach output of this command (sure using correct device-name):
udevinfo -a --name=/dev/bus/usb/001/015

Comment 12 Ian Pickworth 2007-08-22 13:15:02 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > (In reply to comment #9)
> > The problem appears to me this line:
> >   ATTR{idVendor}=="03f0", GROUP="lp"
> > in the file 55-hpmud.rules
> > 
> > If I change it to
> >  SYSFS{idVendor}=="03f0", GROUP="lp"
> > 
> > and replug the printer the group ownership is set to lp correctly.
> Strange - that would mean idVendor is at some unusual place in sysfs. Could you
> please attach output of this command (sure using correct device-name):
> udevinfo -a --name=/dev/bus/usb/001/015
> 

I have included the output below, but it triggered a thought - a missing "S".

If I change the line to:
 ATTRS{idVendor}=="03f0", GROUP="lp"
it works correctly.

I think your ebuild file files/hplip-2.7.7-udev-kernel.2.6.22.diff needs to change
+ATTR{idVendor}=="03f0", GROUP="lp"

to

+ATTRS{idVendor}=="03f0", GROUP="lp"

but I have no udev skills at all!
Regards
Ian
-----------
ian2 ~ # udevinfo -a --name=/dev/bus/usb/001/016

Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:02.2/usb1/1-4/1-4.4/1-4.4.3/usb_device/usbdev1.16':
    KERNEL=="usbdev1.16"
    SUBSYSTEM=="usb_device"
    DRIVER==""
    ATTR{dev}=="189:15"

  looking at parent device '/devices/pci0000:00/0000:00:02.2/usb1/1-4/1-4.4/1-4.4.3/usb_device':
    KERNELS=="usb_device"
    SUBSYSTEMS==""
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:02.2/usb1/1-4/1-4.4/1-4.4.3':
    KERNELS=="1-4.4.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{serial}=="HU4BP1Y021049T"
    ATTRS{product}=="Deskjet 5700"
    ATTRS{manufacturer}=="HP"
    ATTRS{quirks}=="0x0"
    ATTRS{maxchild}=="0"
    ATTRS{version}==" 2.00"
    ATTRS{devnum}=="16"
    ATTRS{busnum}=="1"
    ATTRS{speed}=="12"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bcdDevice}=="0100"
    ATTRS{idProduct}=="8104"
    ATTRS{idVendor}=="03f0"
    ATTRS{bMaxPower}=="  2mA"
    ATTRS{bmAttributes}=="c0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{configuration}==""
    ATTRS{dev}=="189:15"

  looking at parent device '/devices/pci0000:00/0000:00:02.2/usb1/1-4/1-4.4':
    KERNELS=="1-4.4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{quirks}=="0x0"
    ATTRS{maxchild}=="4"
    ATTRS{version}==" 2.00"
    ATTRS{devnum}=="7"
    ATTRS{busnum}=="1"
    ATTRS{speed}=="480"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bcdDevice}=="0100"
    ATTRS{idProduct}=="0059"
    ATTRS{idVendor}=="0409"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{configuration}==""
    ATTRS{dev}=="189:6"

  looking at parent device '/devices/pci0000:00/0000:00:02.2/usb1/1-4':
    KERNELS=="1-4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{quirks}=="0x0"
    ATTRS{maxchild}=="4"
    ATTRS{version}==" 2.00"
    ATTRS{devnum}=="3"
    ATTRS{busnum}=="1"
    ATTRS{speed}=="480"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bcdDevice}=="0100"
    ATTRS{idProduct}=="0059"
    ATTRS{idVendor}=="0409"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{configuration}==""
    ATTRS{dev}=="189:2"

  looking at parent device '/devices/pci0000:00/0000:00:02.2/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{serial}=="0000:00:02.2"
    ATTRS{product}=="EHCI Host Controller"
    ATTRS{manufacturer}=="Linux 2.6.22-gentoo-r5 ehci_hcd"
    ATTRS{quirks}=="0x0"
    ATTRS{maxchild}=="6"
    ATTRS{version}==" 2.00"
    ATTRS{devnum}=="1"
    ATTRS{busnum}=="1"
    ATTRS{speed}=="480"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bcdDevice}=="0206"
    ATTRS{idProduct}=="0000"
    ATTRS{idVendor}=="0000"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{configuration}==""
    ATTRS{dev}=="189:0"

  looking at parent device '/devices/pci0000:00/0000:00:02.2':
    KERNELS=="0000:00:02.2"
    SUBSYSTEMS=="pci"
    DRIVERS=="ehci_hcd"
    ATTRS{msi_bus}==""
    ATTRS{broken_parity_status}=="0"
    ATTRS{enable}=="1"
    ATTRS{modalias}=="pci:v000010DEd00000068sv00001043sd00000C11bc0Csc03i20"
    ATTRS{local_cpus}=="1"
    ATTRS{irq}=="11"
    ATTRS{class}=="0x0c0320"
    ATTRS{subsystem_device}=="0x0c11"
    ATTRS{subsystem_vendor}=="0x1043"
    ATTRS{device}=="0x0068"
    ATTRS{vendor}=="0x10de"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{uevent}==""
-----------------
Comment 13 Matthias Schwarzott gentoo-dev 2007-08-22 13:26:32 UTC
(In reply to comment #12)
> I have included the output below, but it triggered a thought - a missing "S".
> 
> If I change the line to:
>  ATTRS{idVendor}=="03f0", GROUP="lp"
> it works correctly.
> 
> I think your ebuild file files/hplip-2.7.7-udev-kernel.2.6.22.diff needs to
> change
> +ATTR{idVendor}=="03f0", GROUP="lp"
> 
> to
> 
> +ATTRS{idVendor}=="03f0", GROUP="lp"
> 
Yeah, that is what I wanted to find out if this is needed. Seems like you still have enabled the old interface for usb. And this seems to need it.
The new one did not. That means adding this "S" now.
Comment 14 Matthias Schwarzott gentoo-dev 2007-08-22 13:35:44 UTC
Now added hplip-2.7.7-r2 that now contains ATTRS.
Reopen if this still does not work.