diff -Nru foo2zjs-20140925dfsg0/debian/changelog foo2zjs-20140925dfsg0/debian/changelog --- foo2zjs-20140925dfsg0/debian/changelog 2014-09-30 16:03:21.000000000 +0000 +++ foo2zjs-20140925dfsg0/debian/changelog 2014-10-02 20:52:07.000000000 +0000 @@ -1,3 +1,14 @@ +foo2zjs (20140925dfsg0-3) unstable; urgency=medium + + [ Peter De Wachter ] + * Fix laserjet1018 appearance and disappearance loop: (Closes: #663868) + - update the 30-udev-rules.patch to add an 'ACTION="add"' to avoid running + the firmware upload script on unplug, + - add patch 97-hplj1000-fix-firmware-upload-infite-loop.patch to ignore the + irrelevant events and thus cut the loop short. + + -- Didier Raboud Thu, 02 Oct 2014 22:51:47 +0200 + foo2zjs (20140925dfsg0-2) unstable; urgency=medium * Put tix to Recommends on Debian and to Suggests on Ubuntu and derivatives diff -Nru foo2zjs-20140925dfsg0/debian/patches/30-udev-rules.patch foo2zjs-20140925dfsg0/debian/patches/30-udev-rules.patch --- foo2zjs-20140925dfsg0/debian/patches/30-udev-rules.patch 2014-09-30 07:35:47.000000000 +0000 +++ foo2zjs-20140925dfsg0/debian/patches/30-udev-rules.patch 2014-10-02 20:28:01.000000000 +0000 @@ -2,9 +2,11 @@ a) remove KERNEL=="lp*", as usblp is now blacklisted by CUPS (it will work without CUPS too). b) Replace paths: /etc/hotplug/usb/ by no path, as the binaries are shipped in /lib/udev/ c) Drop the MODE specification + d) Add ACTION=="ADD", otherwise the firmware script runs after unplugging as well Author: Luca Capello Author: Didier Raboud -Last-Update: 2014-01-07 +Author: Peter De Wachter +Last-Update: 2014-01-02 --- a/hplj10xx.rules +++ b/hplj10xx.rules @@ -2,38 +2,42 @@ @@ -14,66 +16,66 @@ -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ - ATTRS{product}=="hp LaserJet 1000", NAME="usb/%k", \ - SYMLINK+="hplj1000-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1000" -+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ ++ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{product}=="hp LaserJet 1000", \ + SYMLINK+="hplj1000-%n", RUN+="hplj1000" #Own udev rule for HP Laserjet 1005 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ - ATTRS{product}=="hp LaserJet 1005 series", NAME="usb/%k", \ - SYMLINK+="hplj1005-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1005" -+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ ++ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{product}=="hp LaserJet 1005 series", \ + SYMLINK+="hplj1005-%n", RUN+="hplj1005" #Own udev rule for HP Laserjet 1018 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ - ATTRS{product}=="HP LaserJet 1018", NAME="usb/%k", \ - SYMLINK+="hplj1018-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1018" -+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ ++ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{product}=="HP LaserJet 1018", \ + SYMLINK+="hplj1018-%n", RUN+="hplj1018" #Own udev rule for HP Laserjet 1020 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ - ATTRS{product}=="HP LaserJet 1020", NAME="usb/%k", \ - SYMLINK+="hplj1020-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1020" -+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ ++ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{product}=="HP LaserJet 1020", \ + SYMLINK+="hplj1020-%n", RUN+="hplj1020" #Own udev rule for HP Laserjet P1005 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ - ATTRS{product}=="HP LaserJet P1005", NAME="usb/%k", \ - SYMLINK+="hpljP1005-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1005" -+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ ++ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{product}=="HP LaserJet P1005", \ + SYMLINK+="hpljP1005-%n", RUN+="hpljP1005" #Own udev rule for HP Laserjet P1006 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ - ATTRS{product}=="HP LaserJet P1006", NAME="usb/%k", \ - SYMLINK+="hpljP1006-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1006" -+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ ++ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{product}=="HP LaserJet P1006", \ + SYMLINK+="hpljP1006-%n", RUN+="hpljP1006" #Own udev rule for HP Laserjet P1007 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ - ATTRS{product}=="HP LaserJet P1007", NAME="usb/%k", \ - SYMLINK+="hpljP1007-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1007" -+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ ++ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{product}=="HP LaserJet P1007", \ + SYMLINK+="hpljP1007-%n", RUN+="hpljP1007" #Own udev rule for HP Laserjet P1008 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ - ATTRS{product}=="HP LaserJet P1008", NAME="usb/%k", \ - SYMLINK+="hpljP1008-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1008" -+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ ++ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{product}=="HP LaserJet P1008", \ + SYMLINK+="hpljP1008-%n", RUN+="hpljP1008" #Own udev rule for HP Laserjet P1505 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ - ATTRS{product}=="HP LaserJet P1505", NAME="usb/%k", \ - SYMLINK+="hpljP1505-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1505" -+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ ++ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{product}=="HP LaserJet P1505", \ + SYMLINK+="hpljP1505-%n", RUN+="hpljP1505" +#Own udev rule for HP Laserjet P1505n -+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ ++ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{product}=="HP LaserJet P1505n", \ + SYMLINK+="hpljP1505n-%n", RUN+="hpljP1505n" diff -Nru foo2zjs-20140925dfsg0/debian/patches/97-hplj1000-fix-firmware-upload-infite-loop.patch foo2zjs-20140925dfsg0/debian/patches/97-hplj1000-fix-firmware-upload-infite-loop.patch --- foo2zjs-20140925dfsg0/debian/patches/97-hplj1000-fix-firmware-upload-infite-loop.patch 1970-01-01 00:00:00.000000000 +0000 +++ foo2zjs-20140925dfsg0/debian/patches/97-hplj1000-fix-firmware-upload-infite-loop.patch 2014-10-02 20:28:33.000000000 +0000 @@ -0,0 +1,48 @@ +Description: Prevent an infinite loop when loading the firmware. + When using the load_cups method, the CUPS backend will internally + unload and reload the usblp module. This will generate + SUBSYSTEM=usbmisc events that need to be ignored in the CUPS code + path, or this script will be rerun in an infite loop. + + But when using the load_usblp method, the usblp module is obviously + needed. So in this situation we need to ignore the SUBSYSTEM=usb + events. +Bug-Debian: http://bugs.debian.org/663868 +Author: Peter De Wachter +Last-Update: 2014-10-02 +--- a/hplj1000 ++++ b/hplj1000 +@@ -24,11 +24,6 @@ + # Mike Morgan (2004) + # + +-# udev calls us twice on FC4! Just want /dev/usb/lp +-case "$DEVNAME" in +-/dev/usb/usb*) exit;; +-esac +- + PROGNAME="$0" + + # +@@ -260,6 +255,7 @@ + # + # force downloading to a specific device + # ++ if [ "$SUBSYSTEM" != "usbmisc" ]; then exit; fi + load_usblp "$DEV" + elif [ -x $USB_BACKEND ]; then + # +@@ -267,11 +263,13 @@ + # not need to care whether the system uses the usblp kernel module or + # libusb + # ++ if [ "$SUBSYSTEM" != "usb" ]; then exit; fi + load_cups + elif [ -x $PRINTERID ]; then + # + # Sniff around for printers that need a firmware download + # ++ if [ "$SUBSYSTEM" != "usbmisc" ]; then exit; fi + usblps=`find /dev/usb -type c -name 'lp*'`" "`find /dev -type c -name 'usblp*'` + for dev in $usblps; do + status=`$PRINTERID $dev 2>/dev/null | grep -y "hp LaserJet $MODEL"` diff -Nru foo2zjs-20140925dfsg0/debian/patches/series foo2zjs-20140925dfsg0/debian/patches/series --- foo2zjs-20140925dfsg0/debian/patches/series 2014-09-30 07:42:31.000000000 +0000 +++ foo2zjs-20140925dfsg0/debian/patches/series 2014-10-02 20:28:17.000000000 +0000 @@ -19,3 +19,4 @@ 92-udev-firmware-script-fixes.patch 95-udev-firmware-script-no-hplip-rules-removal.patch 96-hplj1000-fix-cups-usb-backend-firmware-upload.patch +97-hplj1000-fix-firmware-upload-infite-loop.patch