HP Linux Imaging and Printing

HAL deprecated, replaced by udev

Reported by Till Kamppeter on 2009-07-18
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
Undecided
Unassigned

Bug Description

HAL (Hardware Abstraction Layer) is deprecated. It is replaced by udev. HPLIP uses HAL to mark HPLIP-supported printers as having the scanner capability so that HAL opens access to their low-level USB device files (/dev/bus/usb/*/*) for the user currently logged in to the desktop.

Now udev rules have to take over this responsibility. For that upstream udev has now the rule

ENV{ID_HPLIP}=="1", ENV{ACL_MANAGE}="1"

in /lib/udev/rules.d/70-acl.rules. This makes the ACLs for access of the non-printing functions by normal users being set for devices which are marked as HPLIP-supported.

HPLIP now only need to mark the supported devices with its own udev rules, for example with rules like this:

ACTION!="add", GOTO="hpmud_rules_end"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="pid_test"
SUBSYSTEM!="usb_device", GOTO="hpmud_rules_end"

LABEL="pid_test"

...
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="??11", GROUP="lp", ENV{ID_HPLIP}="1"
...

in

/lib/udev//rules.d/40-hplip.rules

The complete 40-hplip.rules is attached.

Can you ship these rules with HPLIP? They will work for all distributions as the new rule in 70-acl.rules is already implemented in udev upstream.

Till Kamppeter (till-kamppeter) wrote :
Johannes Meixner (jsmeix) wrote :

FYI:

A note when you revise the HPLIP udev rules regarding LABELs:

Bad:
... GOTO="pid_test"
LABEL="pid_test"

Good:
... GOTO="hpmud_pid_test"
LABEL="hpmud_pid_test"

Having unique labels in all udev files on the whole system is crucial.
The reason is that all udev files are concatenated to one single
big blob of data wherein all labels must be unique.
Otherwise GOTO="ambiguous_label" would jump to an
arbitrary LABEL="ambiguous_label" target.
Therefore one must make sure with appropriate name prefixes
that all labels in all udev files are unique.
Perhaps nowadays there might be this or that subtle exception
from the general rule but to be on the safe side, I recommend
to use appropriate name prefixes in any case.

Welcome to the hell of udev/HAL!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers