Bug#1001440: /usr/bin/foo2zjs: fails to load firmware into printer

2023-05-11 Thread Kevin Goodsell
I'm not sure if it's the same issue, but I'm also seeing firmware failing
to load on my LaserJet 1020 using foo2zjs. My guess is that there's a
conflict between the firmware loading script and udev-configure-printer
trying to access the printer at the same time.

Here is a snippet from journalctl when the printer was turned on:

  May 11 18:02:34 cyclops kernel: usb 2-14: new high-speed USB device
number 14 using xhci_hcd
  May 11 18:02:34 cyclops kernel: usb 2-14: New USB device found,
idVendor=03f0, idProduct=2b17, bcdDevice= 1.00
  May 11 18:02:34 cyclops kernel: usb 2-14: New USB device strings: Mfr=1,
Product=2, SerialNumber=3
  May 11 18:02:34 cyclops kernel: usb 2-14: Product: HP LaserJet 1020
  May 11 18:02:34 cyclops kernel: usb 2-14: Manufacturer: Hewlett-Packard
  May 11 18:02:34 cyclops kernel: usb 2-14: SerialNumber: JL1K941
  May 11 18:02:34 cyclops kernel: usblp 2-14:1.0: usblp1: USB Bidirectional
printer dev 14 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2B17
  May 11 18:02:40 cyclops kernel: usblp1: removed
  May 11 18:02:40 cyclops /lib/udev/hplj1020[162068]: foo2zjs: loading HP
LaserJet 1020 firmware /lib/firmware/hp/sihp1020.dl to CUPS USB device ...
  May 11 18:02:40 cyclops kernel: usblp 2-14:1.0: usblp1: USB Bidirectional
printer dev 14 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2B17
  May 11 18:02:40 cyclops kernel: usblp1: removed
  May 11 18:02:40 cyclops systemd[1]: Started Configure Plugged-In Printer.
  May 11 18:02:40 cyclops udev-configure-printer[162071]: add usb-002-014
  May 11 18:02:40 cyclops udev-configure-printer[162071]: device devpath is
/devices/pci:00/:00:14.0/usb2/2-14
  May 11 18:02:40 cyclops udev-configure-printer[162071]: Device
vendor/product is 03F0:2B17
  May 11 18:02:41 cyclops udev-configure-printer[162071]: failed to claim
interface
  May 11 18:02:41 cyclops systemd[1]: configure-printer@usb-002-014.service:
Main process exited, code=exited, status=1/FAILURE
  May 11 18:02:41 cyclops systemd[1]: configure-printer@usb-002-014.service:
Failed with result 'exit-code'.

And here's a snippet of the same scenario with a work-around in place:

  May 11 17:58:15 cyclops kernel: usb 2-14: new high-speed USB device
number 13 using xhci_hcd
  May 11 17:58:15 cyclops kernel: usb 2-14: New USB device found,
idVendor=03f0, idProduct=2b17, bcdDevice= 1.00
  May 11 17:58:15 cyclops kernel: usb 2-14: New USB device strings: Mfr=1,
Product=2, SerialNumber=3
  May 11 17:58:15 cyclops kernel: usb 2-14: Product: HP LaserJet 1020
  May 11 17:58:15 cyclops kernel: usb 2-14: Manufacturer: Hewlett-Packard
  May 11 17:58:15 cyclops kernel: usb 2-14: SerialNumber: JL1K941
  May 11 17:58:15 cyclops kernel: usblp 2-14:1.0: usblp1: USB Bidirectional
printer dev 13 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2B17
  May 11 17:58:21 cyclops kernel: usblp1: removed
  May 11 17:58:21 cyclops kernel: usblp 2-14:1.0: usblp1: USB Bidirectional
printer dev 13 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2B17
  May 11 17:58:21 cyclops /lib/udev/hplj1020[161939]: foo2zjs: loading HP
LaserJet 1020 firmware /lib/firmware/hp/sihp1020.dl to CUPS USB device ...
  May 11 17:58:21 cyclops kernel: usblp1: removed
  May 11 17:58:31 cyclops kernel: usblp 2-14:1.0: usblp1: USB Bidirectional
printer dev 13 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2B17
  May 11 17:58:31 cyclops /lib/udev/hplj1020[161944]: foo2zjs:
usb://HP/LaserJet%201020?serial=JL1K941... download successful.
  May 11 17:58:31 cyclops systemd[1]: Started Configure Plugged-In Printer.
  May 11 17:58:31 cyclops udev-configure-printer[161953]: add usb-002-013
  May 11 17:58:31 cyclops udev-configure-printer[161953]: device devpath is
/devices/pci:00/:00:14.0/usb2/2-14
  May 11 17:58:31 cyclops udev-configure-printer[161953]:
MFG:Hewlett-Packard MDL:HP LaserJet 1020 SERN:- serial:JL1K941
  May 11 17:58:36 cyclops kernel: usblp1: removed
  May 11 17:58:36 cyclops kernel: usblp 2-14:1.0: usblp1: USB Bidirectional
printer dev 13 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2B17
  May 11 17:58:37 cyclops kernel: usblp1: removed
  May 11 17:58:37 cyclops kernel: usblp 2-14:1.0: usblp1: USB Bidirectional
printer dev 13 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2B17
  May 11 17:58:38 cyclops udev-configure-printer[161953]: URI contains USB
serial number
  May 11 17:58:38 cyclops udev-configure-printer[161953]: URI match:
usb://HP/LaserJet%201020?serial=JL1K941
  May 11 17:58:38 cyclops udev-configure-printer[161953]: URI of detected
printer: usb://HP/LaserJet%201020?serial=JL1K941, normalized: laserjet 1020
serial jl1k941
  May 11 17:58:38 cyclops udev-configure-printer[161953]: URI of print
queue: usb://HP/LaserJet%201020?serial=JL1K941, normalized: laserjet 1020
serial jl1k941
  May 11 17:58:38 cyclops udev-configure-printer[161953]: Queue
ipp://localhost/printers/HP_LaserJet_1020 has matching device URI
  May 11 17:58:38 cyclops udev-configure-printer[161953]: Re-enabled
printer ipp://localhost/printers/HP_LaserJet_1020
  May 11 17:58:38 cyclops systemd[1]: configure-printer@usb-002

Bug#1001440: /usr/bin/foo2zjs: fails to load firmware into printer

2021-12-09 Thread David Heidelberg
Package: printer-driver-foo2zjs
Version: 20200505dfsg0-2
Severity: important
File: /usr/bin/foo2zjs

Dear Maintainer,

After connecting printer (HP 1018), firmware isn't loaded into printer, even 
after getting by getweb 1018.

Seems like script /lib/udev/hplj1000 and symlinks (as hplj1018) give up on 
uploading firmware into device.

I managed to succeed by disabling udev rule triggering this script and manually 
running

# cat /lib/firmware/hp/sihp1018.dl > /dev/usb/lp3

which does upload 1018 firmware into USB printer connected to lp3 (visible in 
dmesg).

I think this is partly inconsistency between Debian udev rules and upstream 
firmware upload script quality (and age).

I'll try figure out patch, but not promising it'll be soon.

David

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing'), (10, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.15.0-2-amd64 (SMP w/4 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages printer-driver-foo2zjs depends on:
ii  cups-filters [foomatic-filters]  1.28.10-2
ii  dc   1.07.1-3+b1
ii  libc62.32-5
ii  libcups2 2.3.3op2-7
ii  libjbig0 2.1-3.1+b2
ii  liblcms2-utils   2.12~rc1-2
ii  printer-driver-foo2zjs-common20200505dfsg0-2

Versions of packages printer-driver-foo2zjs recommends:
ii  cups 2.3.3op2-7
ii  cups-client  2.3.3op2-7
ii  mscompress   0.4-9
ii  unzip6.0-26
ii  wget 1.21.2-2+b1

Versions of packages printer-driver-foo2zjs suggests:
ii  hannah-foo2zjs  1:4+b1
ii  psutils 1.17.dfsg-4

-- no debconf information