From e04106b6551fb6d4b28df992c9e55d4538fddda5 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 3 Apr 2019 10:32:58 +0200 Subject: [PATCH] 1694663 - Cannot scan with M281fdw LaserJet - failed: Error during device I/O --- hplip-hpmud-string-parse.patch | 16 ++++++++++++++++ hplip-m278-m281-needs-plugin.patch | 15 +++++++++++++++ hplip.spec | 20 +++++++++++++++++++- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 hplip-hpmud-string-parse.patch create mode 100644 hplip-m278-m281-needs-plugin.patch diff --git a/hplip-hpmud-string-parse.patch b/hplip-hpmud-string-parse.patch new file mode 100644 index 0000000..58bf5dd --- /dev/null +++ b/hplip-hpmud-string-parse.patch @@ -0,0 +1,16 @@ +diff --git a/io/hpmud/model.c b/io/hpmud/model.c +index 4ea8990..72c630b 100644 +--- a/io/hpmud/model.c ++++ b/io/hpmud/model.c +@@ -420,7 +420,10 @@ static int ParseFile(char *datFile, char *model, char *attr, int attrSize, int * + strncpy(section, rcbuf+1, sizeof(section)); /* found new section */ + n = strlen(section); + section[n-2]=0; /* remove ']' and CR */ +- if (strcasecmp(model, section) == 0) ++ if (strcasecmp(model, section) == 0 || ++ (section[0] == 'h' && section[1] == 'p' && ++ section[2] == '_' && ++ strcasecmp(model, section + 3) == 0)) + { + /* Found model match. */ + *bytes_read = ResolveAttributes(fp, attr, attrSize); diff --git a/hplip-m278-m281-needs-plugin.patch b/hplip-m278-m281-needs-plugin.patch new file mode 100644 index 0000000..2a0783c --- /dev/null +++ b/hplip-m278-m281-needs-plugin.patch @@ -0,0 +1,15 @@ +diff --git a/data/models/models.dat b/data/models/models.dat +index 4b21c1a..76c4cc0 100644 +--- a/data/models/models.dat ++++ b/data/models/models.dat +@@ -64063,8 +64063,8 @@ model11=HP Color LaserJet Pro MFP M280c2 + monitor-type=0 + panel-check-type=0 + pcard-type=0 +-plugin=0 +-plugin-reason=0 ++plugin=1 ++plugin-reason=64 + power-settings=0 + ppd-name=hp-color_laserjet_mfp_m278-m281-ps.ppd + family-ppd=hp-postscript-laserjet-pro.ppd diff --git a/hplip.spec b/hplip.spec index 650bb1c..86f124d 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.18.12 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -95,6 +95,17 @@ Patch43: hplip-missing-links.patch # have different options, so I'm not sure what author wanted to set). # Remove the change for now, it works for user and me. Patch44: hplip-hplj-3052.patch +# hpmud parses mdns txt record badly +# upstream tickets: https://bugs.launchpad.net/hplip/+bug/1797501 +# https://bugs.launchpad.net/hplip/+bug/1817214 +# https://bugs.launchpad.net/hplip/+bug/1821932 +# with no response from upstream +# Patch taken from Debian https://lists.debian.org/debian-printing/2018/11/msg00049.html +Patch45: hplip-hpmud-string-parse.patch +# Part of https://bugzilla.redhat.com/show_bug.cgi?id=1694663 +# It was found out that specific device needs plugin for scanning +# Reported upstream as https://bugs.launchpad.net/hplip/+bug/1822762 +Patch46: hplip-m278-m281-needs-plugin.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow @@ -341,6 +352,10 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h %patch43 -p1 -b .missing-links # 1684434 - Scanning broken for HP LaserJet 3052 %patch44 -p1 -b .hp-laserjet-3052-broken-scanning +# 1694663 - Cannot scan with M281fdw LaserJet - failed: Error during device I/O (part 1) +%patch45 -p1 -b .hpmud-string-parse +# 1694663 - Cannot scan with M281fdw LaserJet - failed: Error during device I/O (part 2) +%patch46 -p1 -b .m278-m281-needs-plugin sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ @@ -627,6 +642,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Mon Apr 01 2019 Zdenek Dohnal - 3.18.12-8 +- 1694663 - Cannot scan with M281fdw LaserJet - failed: Error during device I/O + * Mon Apr 01 2019 Zdenek Dohnal - 3.18.12-7 - 1694569 - hp-uiscan does not have interactive mode