[Pkg-kde-extras] udev rules HP Photosmart (was: Digikam stopped detecting my HP Photosmart camera...)

Mark Purcell msp at debian.org
Thu Jul 10 13:07:45 UTC 2008


Marco,

I have recently taken over the hplip package, which has some udev rules loaded 
to /etc/udev/rules.d/55-hpmud.rules.

Note that the debian package and upstream hplip packages ship different 
55-hpmud.rules (attached)

Can I get some input from you as to the best practice for udev rules in 
Debian?

1. Looking through the udev bug reports, it would appear that for a printer/ 
multi function device from HP that MODE="0664" would be better and would 
allow use with the upstream OWNER="root", GROUP="lp".

2. Do you have any ideas how the conflict with libgphoto2-2 could be resolved?

Mark

Upstreams discussion about the rules is as follows:
! The udev 55-hpmud.rules file sets the default Unix permissions to 666 which 
! allow read/write to "owner", "group" and "other" users. This means anybody 
! can use this HP printer. If you want to change this user policy, then you 
! must modify the 55-hpmud.rules file. For example you can set the Unix 
! permissions to 660 (MODE="0660"), then only users that are members of 
! the "lp" group can use the device.
!
! The udev 55-hpmud.rules file wild-cards the USB product-id check based on 
! known HP products. This means the current rules files should work on new 
! future HP products.


On Thu, 10 Jul 2008, Bruce Sass wrote:
> ...it turns out the appropriate /dev/bus/usb entry is owned by
> lp.scanner.  :/
>
> Hi All,
>
> Sorry for the lateness of this report, I don't know how many upgrades of
> HPLIP and gphoto have gone through since the problem first appeared, it
> is too many to bother going back and seeing who changed what though.
>
> In a nutshell...
>
> libgphoto2-2 ships: /etc/udev/rules.d/025_libgphoto2.rules
> which contains:
>
> a few dozen cameras with ATTRS{idVendor}=="03f0" where ATTRS{idProduct}
> is something ending with "02"
>
>
> hplip ships: /etc/udev/rules.d/55-hpmud.rules
> which contains:
>
> # Check for Photosmart products (0x03f0xx02).
> SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??02", OWNER="lp",
> GROUP="scanner", MODE="0660"
>
>
> ...HPLIP is assuming that all Photosmart products are scanners, which
> may well be true and correct (if it is not feasible to list individual
> idProduct's for whatever reason). However, since it does so after
> libgphoto's rules are read, it messes up access to Photosmart cameras.
>
> Simply swapping the order of the two .rules files serves to get Digikam
> working again--but libgphoto's .rules would need to start setting an
> OWNER to ensure that camera devices don't end up owned by lp.plugdev!
>
> So, afaict:
>
> 1) the PhotoTools Maintainers can fix this problem by renaming 025_* to
> (say) z60_* and adding (perhaps) OWNER="root" to each entry.
>
> 2) the HPLIP Maintainers can fix the problem by getting upstream to
> provide individual idProduct codes (which may or may not require the
> cooperation of the manufacturer).
>
> I don't know which is the better solution (and hence who should get the
> bug), but suspect that 1) could be implemented quicker and is less
> likely to affect currently supported devices negatively (as would
> happen if the list of Photosmart scanners is incomplete).
>
> While I consider this to be something which needs to be worked out
> between the libgphoto and hplip packages, I've included the KDE Extras
> Team and udev because Marco is the one most likely to have the best
> insight into the problem and it is Digikam which appears to be breaking
> (superficially at least, my problem looks the same as #409209, #451783,
> and Bug 155825 in the KDE bug DB, maybe this offers a clue to solving
> one of them).
>
>
> - Bruce
>
> p.s. Keep me in the loop, please, so I don't get caught with
> duplicate/unnecessary/conflicting rules because of some local fix I've
> implemented... it is the least you can do since I've not filed an RC
> bug against one of you so close to a release.  :-)
>
> _______________________________________________
> Pkg-hpijs-devel mailing list
> Pkg-hpijs-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-hpijs-devel


-------------- next part --------------
# HPLIP udev rules file for HP printer and all-in-one products.

ACTION!="add", GOTO="hpmud_rules_end"
SUBSYSTEM=="ppdev", OWNER="root", GROUP="lp", MODE="0666"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="pid_test"
SUBSYSTEM!="usb_device", GOTO="hpmud_rules_end"

LABEL="pid_test"

# Check for AiO products (0x03f0xx11).
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??11", OWNER="root", GROUP="lp", MODE="0666", ENV{sane_hpaio}="yes"
# Check for Photosmart products (0x03f0xx02).
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??02", OWNER="root", GROUP="lp", MODE="0666", ENV{sane_hpaio}="yes"
# Check for Business Inkjet products (0x03f0xx12).
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??12", OWNER="root", GROUP="lp", MODE="0666", ENV{sane_hpaio}="yes"
# Check for Deskjet products (0x03f0xx04).
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??04", OWNER="root", GROUP="lp", MODE="0666", ENV{sane_hpaio}="yes"
# Check for LaserJet products (0x03f0xx17).
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??17", OWNER="root", GROUP="lp", MODE="0666", ENV{sane_hpaio}="yes"

# If sane-bankends is installed add hpaio backend support to dll.conf if needed.
ENV{sane_hpaio}=="yes", RUN+="/bin/sh -c 'grep -q ^#hpaio /etc/sane.d/dll.conf;if [ $$? -eq 0 ];then sed -i -e s/^#hpaio/hpaio/ /etc/sane.d/dll.conf;else grep -q ^hpaio /etc/sane.d/dll.conf;if [ $$? -ne 0 ];then echo hpaio >>/etc/sane.d/dll.conf;fi;fi'"

LABEL="hpmud_rules_end"
-------------- next part --------------
# Udev rules file for HP printer products.

ACTION!="add", GOTO="hpmud_rules_end"
SUBSYSTEM=="ppdev", OWNER="lp", GROUP="scanner", MODE="0660"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="pid_test"
SUBSYSTEM!="usb_device", GOTO="hpmud_rules_end"

LABEL="pid_test"

# Check for AiO products (0x03f0xx11).
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??11", OWNER="lp", GROUP="scanner", MODE="0660"
# Check for Photosmart products (0x03f0xx02).
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??02", OWNER="lp", GROUP="scanner", MODE="0660"
# Check for Business Inkjet products (0x03f0xx12).
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??12", OWNER="lp", GROUP="scanner", MODE="0660"
# Check for Deskjet products (0x03f0xx04).
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??04", OWNER="lp", GROUP="scanner", MODE="0660"
# Check for LaserJet products (0x03f0xx17).
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="??17", OWNER="lp", GROUP="scanner", MODE="0660"

LABEL="hpmud_rules_end"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.alioth.debian.org/pipermail/pkg-kde-extras/attachments/20080710/43118d92/attachment.pgp 


More information about the pkg-kde-extras mailing list