gnu: hplip: Fix USB timeouts.

* gnu/packages/patches/hplip-usb-timeout.patch: New file.
* gnu/local.mk: Register it.
* gnu/packages/cups.scm (hplip): Use it.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
This commit is contained in:
Bruno Victal 2023-10-17 17:25:48 +01:00 committed by Mathieu Othacehe
parent a0060934a5
commit 1e5ec9d853
No known key found for this signature in database
GPG key ID: 8354763531769CA6
3 changed files with 26 additions and 0 deletions

View file

@ -1401,6 +1401,7 @@ dist_patch_DATA = \
%D%/packages/patches/heimdal-CVE-2022-45142.patch \
%D%/packages/patches/helm-fix-gcc-9-build.patch \
%D%/packages/patches/highlight-gui-data-dir.patch \
%D%/packages/patches/hplip-usb-timeout.patch \
%D%/packages/patches/http-parser-CVE-2020-8287.patch \
%D%/packages/patches/htslib-for-stringtie.patch \
%D%/packages/patches/hubbub-sort-entities.patch \

View file

@ -522,6 +522,7 @@ (define-public hplip
(sha256
(base32
"0ihv9ddjrjx5bdf8pwc2fvljkpfzq4qi9r2awm8dgky053v0bk7p"))
(patches (search-patches "hplip-usb-timeout.patch"))
(modules '((guix build utils)))
(snippet
'(begin

View file

@ -0,0 +1,24 @@
# Source: <https://bugs.launchpad.net/hplip/+bug/1922404>
--- a/config_usb_printer.py
+++ b/config_usb_printer.py
@@ -28,6 +28,7 @@
# Std Lib
import sys
import os
+import time
# Local
from base.g import *
@@ -181,9 +182,10 @@
# ******************************* RUNNING FIRMWARE DOWNLOAD TO DEVICE FOR SUPPORTED PRINTER'S
fw_download_req = mq.get('fw-download', False)
if fw_download_req:
- fw_cmd = "hp-firmware -y3 -s %s"%param
+ fw_cmd = "hp-firmware -n -y3 -s %s"%param
log.info(fw_cmd)
fw_sts, fw_out = utils.run(fw_cmd)
+ time.sleep(5)
if fw_sts == 0:
log.debug("Firmware downloaded to %s "%device_uri)
else: