[hplip: 2/3] change udev rule to not add printer queue, just check plugin

Jiří Popelka jpopelka at fedoraproject.org
Tue May 14 17:35:36 UTC 2013


commit 858983f86c631403199efa43e281742f9afd46b4
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Tue May 14 19:13:41 2013 +0200

    change udev rule to not add printer queue, just check plugin

 hplip-udev-rules.patch |   17 ++++++++++-------
 hplip.spec             |    5 +++--
 2 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/hplip-udev-rules.patch b/hplip-udev-rules.patch
index 6b3fbd4..47e495b 100644
--- a/hplip-udev-rules.patch
+++ b/hplip-udev-rules.patch
@@ -1,14 +1,17 @@
 diff -up hplip-3.13.5/data/rules/56-hpmud.rules.udev-rules hplip-3.13.5/data/rules/56-hpmud.rules
---- hplip-3.13.5/data/rules/56-hpmud.rules.udev-rules	2013-05-14 14:56:07.716930453 +0200
-+++ hplip-3.13.5/data/rules/56-hpmud.rules	2013-05-14 14:54:37.757169708 +0200
-@@ -7,6 +7,7 @@ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_dev
+--- hplip-3.13.5/data/rules/56-hpmud.rules.udev-rules	2013-05-10 12:08:05.000000000 +0200
++++ hplip-3.13.5/data/rules/56-hpmud.rules	2013-05-14 19:03:18.003846301 +0200
+@@ -11,8 +11,8 @@ LABEL="hpmud_usb_rules"
+ ATTR{idVendor}=="03f0", ATTR{idProduct}=="????", OWNER="root", GROUP="lp", MODE="0660", ENV{sane_hpaio}="yes", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1"
  
- LABEL="hpmud_usb_rules"
  
-+ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"
- # ENV{ID_HPLIP}="1" is for Ubuntu udev-acl
- ATTR{idVendor}=="03f0", ATTR{idProduct}=="????", OWNER="root", GROUP="lp", MODE="0660", ENV{sane_hpaio}="yes", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1"
+-# This rule will add the printer and install plugin
+-ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM}; fi'"
++# This rule will install plugin
++ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c '/usr/bin/python /usr/share/hplip/check-plugin.py -m $env{BUSNUM}:$env{DEVNUM} &'"
  
+ # 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'"
 diff -up hplip-3.13.5/Makefile.in.udev-rules hplip-3.13.5/Makefile.in
 --- hplip-3.13.5/Makefile.in.udev-rules	2013-05-14 12:45:14.670392763 +0200
 +++ hplip-3.13.5/Makefile.in	2013-05-14 12:47:24.779623958 +0200
diff --git a/hplip.spec b/hplip.spec
index 9d7ad26..3f9db7d 100644
--- a/hplip.spec
+++ b/hplip.spec
@@ -187,8 +187,8 @@ mv prnt/drv/hpijs.drv.in{,.deviceIDs-drv-hpijs}
 # directly (bug #552572).
 %patch6 -p1 -b .mucks-with-spooldir
 
-# Removed SYSFS use in udev rules and actually made them work (bug #560754).
-# Move udev rules to /lib/udev/rules.d (bug #748208).
+# Don't add printer queue, just check plugin.
+# Move udev rules from /etc/ to /usr/lib/ (bug #748208).
 %patch7 -p1 -b .udev-rules
 
 # Retry when connecting to device fails (bug #532112).
@@ -537,6 +537,7 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
 %changelog
 * Tue May 14 2013 Jiri Popelka <jpopelka at redhat.com> - 3.13.5-1
 - 3.13.5
+- change udev rule to not add printer queue, just check plugin.
 
 * Fri May 10 2013 Jiri Popelka <jpopelka at redhat.com> - 3.13.4-3
 - Device ID for HP LaserJet 2200 (bug #873123#c8).


More information about the scm-commits mailing list