Comment 18 for bug 1220628

Revision history for this message
Johannes Meixner (jsmeix) wrote :

Hello Amarnath Chitumalla,

regarding my comment#16
"Alternatively I am thinking about to ... invoking only hp-firmware in that udev rule":

I have now additionally connected a HP LaserJet 1220 USB printer
(a PostScript+PCL printer that does not need firmware).

I have the hp-config_usb_printer udev rule still disabled.

Instead I added this rule in /etc/udev/rules.d/56-hpmud.rules
(long line shown wrapped here):
====================================================================
# This rule uploads firmware to HP USB printer devices if needed:
ENV{hp_test}=="yes",
 PROGRAM="/bin/logger -p user.info udev hpmud.rules runs hp-firmware
 to test if HP device with USB vendor ID $attr{idVendor} and USB
 product ID $attr{idProduct} at USB bus ID $env{BUSNUM} and USB device
 ID $env{DEVNUM} needs firmware and if yes to upload it",
 RUN+="/usr/bin/hp-firmware -s $env{BUSNUM}:$env{DEVNUM}"
====================================================================

For me it seems to work perfectly well.

After disconnect and reconnect both printers to the USB I have now (excerpt):
====================================================================
# lsusb
Bus 001 Device 009: ID 03f0:2b17 Hewlett-Packard LaserJet 1020
Bus 001 Device 010: ID 03f0:0417 Hewlett-Packard LaserJet 1200 series
====================================================================
and I get this in /var/log/messages
(long lines shown wrapped here):
====================================================================
2013-09-05T13:29:21.158333+02:00 linux-cjo7 logger: udev hpmud.rules runs
 hp-firmware to test if HP device with USB vendor ID 03f0 and USB product ID 2b17
 at USB bus ID 001 and USB device ID 009 needs firmware and if yes to upload it
2013-09-05T13:36:55.216327+02:00 linux-cjo7 logger: udev hpmud.rules runs
 hp-firmware to test if HP device with USB vendor ID 03f0 and USB product ID 0417
 at USB bus ID 001 and USB device ID 010 needs firmware and if yes to upload it
2013-09-05T13:36:55.469968+02:00 linux-cjo7 hp-firmware: hp-firmware[17226]:
 error: Device hp:/usb/HP_LaserJet_1220?serial=00XXXXXXXXXX
 does not support or require firmware download.
====================================================================
and only the LaserJet 1020 gets its firmware uploaded.

Amarnath Chitumalla,

I would appreciate it very much if you could provide feedback
whether or not my hp-firmware call via udev should work well
or if there could be bad side effects.

Explanation why I cannot run hp-config_usb_printer via udev:

As far as I know our (i.e. SUSE's) policies I am not allowed to let
hp-config_usb_printer run via udev because when a program
is run via udev it runs as root (i.e. it has unlimited permissions
to do anythiung in the system) without explicit authentication
of an admin.

I.e. any user can plug in a HP USB printer to trigger that
hp-config_usb_printer run via udev as root.

As far as I know hp-config_usb_printer can download and install
proprietary software from HP (if needed for the printer device)
or hp-config_usb_printer can trigger some other software
that downloads and installs proprietary software from HP
but SUSE policies do not allow to let any software be installed
in any kind of (semi)-automated way - in particular no third-party
software (regardless if it is free or proprietary software).

As far as I know our SUSE policies, for any new software installation
there must be an explicit request by root to install that software
(an automated update of already installed software is different).

You may have a look at a related issue
https://features.opensuse.org/307745
where currently I don't have a permission to implement it.

I do fully understand that you (i.e. the HPLIP team) would like
to provide some kind of automated HP printer setup
to end-users with HP printers.

For us (i.e. for SUSE) automated printer setup is o.k. as long as
it happens only with already installed software.

What is not o.k. for us is any possibility of (semi)-automated
installation of new third-party software.