Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 813047 - net-print/hplip-3.21.6: Firmware is not automatically uploaded to printer
Summary: net-print/hplip-3.21.6: Firmware is not automatically uploaded to printer
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-14 14:53 UTC by eroen
Modified: 2022-05-25 08:50 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eroen 2021-09-14 14:53:46 UTC
Some HP printers require the host computer to upload a firmware whenever the printer is rebooted. I currently have access to a HP LaserJet P1006 unit which exhibits this trait. HPLIP makes provisions for this to happen automatically, by providing a udev rule that runs the required commands when such a printer is added to the system.

In Gentoo, this functionality is disabled by a patch (`010_hplip-3.20.6-distribution.patch`). Manually re-adding the following lines to `/lib/udev/rules.d/56-hpmud.rules` makes the firmware upload feature work correctly in my testing.

    # This rule will check the smart install feature, plugin status and firmware download for the required printers.
    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/nohup /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM}'"



Reproducible: Always

Steps to Reproduce:
1. Connect and configure (with hp-setup) a HP printer that requires firmware upload on reset.
2. Verify the printer works correctly.
3. Power down printer, then power it back up.
4. Observe that the printer no longer functions. In my experience, HPLIP quietly fails, reporting success to CUPS despite the printer not printing.
5. Manually upload the required firmware with the `hp-firmware` command.
6. Observe that the printer works correctly.
Actual Results:  
Printer only works immediately after configuring it (due to `hp-setup` triggering a firmware upload), or after running `hp-firmware` manually. The printer does not work after being power cycled (no error messages, CUPS seems to believe everything is fine still).

Expected Results:  
Printer should work properly whenever it is connected, without the user manually running a special command every time it has been powered down.

The firmware file is provided by `net-print/hplip-plugin`.

I could not find any documentation of the purpose of the patch's changes to the udev rule, but I suspect it is related to a perceived risk of causing unwanted network activity. I have not inspected the internals of the HPLIP commands.


occam ~ # emerge --info $(qlist -ICS cups hplip)
Portage 3.0.23 (python 3.9.7-final-0, default/linux/amd64/17.1, gcc-11.2.0, glibc-2.33-r7, 5.2.3-gentoo-o0 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.2.3-gentoo-o0-x86_64-Intel-R-_Core-TM-_i5-2520M_CPU_@_2.50GHz-with-glibc2.33
KiB Mem:     8106528 total,   2426388 free
KiB Swap:    8387580 total,   4658716 free
Timestamp of repository gentoo: Sat, 11 Sep 2021 19:30:01 +0000
Head commit of repository gentoo: f0e03b171fbcc660b124520adb8bbfde175d97b7
Timestamp of repository eroen: Sun, 30 Oct 2016 21:58:42 +0000
Head commit of repository wiktorb: 0c14c46dc4d87a4fa395bf65c132bf0a8b9d3df2

sh bash 5.1_p8
ld GNU ld (Gentoo 2.37_p1 p0) 2.37
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.34.0-r2::gentoo
dev-lang/python:          3.9.7::gentoo, 3.10.0_rc2::gentoo
dev-lang/rust:            1.54.0::gentoo
dev-util/cmake:           3.21.2::gentoo
sys-apps/baselayout:      2.7-r3::gentoo
sys-apps/openrc:          0.43.5::gentoo
sys-apps/sandbox:         2.25::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.4::gentoo
sys-devel/binutils:       2.37_p1::gentoo
sys-devel/gcc:            11.2.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24

eroen
    location: /home/eroen/repos/eroen-overlay
    masters: gentoo

wiktorb
    location: /var/db/repos/wiktor_b
    sync-type: git
    sync-uri: https://github.com/wiktor-b/overlay.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7-avx -O2 -g -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=corei7-avx -O2 -g -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=corei7-avx -O2 -g -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles installsources ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=corei7-avx -O2 -g -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 bzip2 cli crypt dri fortran gdbm iconv ipv6 libglvnd libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl unicode xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en no nb" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

=================================================================
                        Package Settings
=================================================================

net-print/cups-2.3.3_p2-r2::gentoo was built with the following:
USE="acl pam ssl threads usb -X -dbus -debug -kerberos (-selinux) -static-libs -systemd -xinetd -zeroconf" ABI_X86="(64) -32 (-x32)"


net-print/cups-filters-1.28.10::gentoo was built with the following:
USE="foomatic postscript -dbus -jpeg -ldap -pclm -pdf -perl -png -test -tiff -zeroconf" ABI_X86="(64)"
CXXFLAGS="-march=corei7-avx -O2 -g -pipe -std=c++11"
FEATURES="userfetch assume-digests binpkg-docompress usersync xattr unknown-features-warn distlocks pid-sandbox config-protect-if-modified splitdebug qa-unresolved-soname-deps fixlafiles usersandbox sfperms userpriv merge-sync network-sandbox ebuild-locks parallel-fetch binpkg-dostrip unmerge-orphans multilib-strict strict unmerge-logs binpkg-logs news protect-owned installsources preserve-libs sandbox ipc-sandbox"


net-print/hplip-3.21.6::gentoo was built with the following:
USE="hpcups -X -doc -fax -hpijs -kde -libnotify -libusb0 -minimal -parport -policykit -qt5 -scanner -snmp -static-ppds" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_9 -python3_8"


net-print/hplip-plugin-3.21.6::gentoo was built with the following:
USE="-orblite" ABI_X86="(64)"
Comment 1 eroen 2021-09-14 14:58:26 UTC
Here's a similar bug report for Mageia:
https://bugs.mageia.org/show_bug.cgi?id=10072
Comment 2 Daniel Pielmeier gentoo-dev 2021-09-30 16:45:31 UTC
This change has been made in combination with others. The original bug is #434830 (Upstream: https://bugs.launchpad.net/hplip/+bug/1080353). I have the same concerns about automatically downloading arbitrary stuuf like mentioned in the Mageia tracker.