Print via Brother BR-Script3 PostScript instead of the vendor driver
The HL-4150CDN emulates PostScript 3, so CUPS converts client documents to PostScript and forwards them to socket://<ip>:9100. The official BR-Script3 PPD turns device options (tray, duplex, colour, media type, toner save, ...) into setpagedevice instructions. This drops the i386 multiarch runtime and the broken Brother vendor filter chain, and removes the unused Brother Linux packages from the repo.
This commit is contained in:
1 parent
6f3162849b
commit
30c685e085
22 files changed
+1070
-273
No files matched your search
+15
-8
@@ -5,10 +5,15 @@
|
||||
# the Brother HL-4150CDN queue if it does not exist yet. The CUPS daemon is
|
||||
# kept in the foreground so the container lives as long as the print server.
|
||||
#
|
||||
# The queue uses Brother's BR-Script3 (PostScript 3) PPD and, by default,
|
||||
# sends jobs to the printer over raw AppSocket (socket://<ip>:9100). CUPS
|
||||
# converts client documents to PostScript and the PPD turns device options
|
||||
# (tray, duplex, colour, ...) into PostScript "setpagedevice" instructions.
|
||||
#
|
||||
# Configuration (all optional, via environment):
|
||||
# PRINTER_IP IP address / host name of the network printer.
|
||||
# PRINTER_URI Full device URI; overrides PRINTER_IP when set.
|
||||
# PRINTER_PROTOCOL lpd (default), socket or ipp - used with PRINTER_IP.
|
||||
# PRINTER_PROTOCOL socket (default), lpd or ipp - used with PRINTER_IP.
|
||||
# PRINTER_NAME CUPS queue name and advertised (DNS-SD) name.
|
||||
# PRINTER_DESCRIPTION CUPS Description (lpadmin -D) shown in the web UI.
|
||||
# PPD_FILE PPD used for the queue.
|
||||
@@ -17,28 +22,30 @@ set -eu
|
||||
PRINTER_NAME="${PRINTER_NAME:-HL4150CDN}"
|
||||
PRINTER_IP="${PRINTER_IP:-}"
|
||||
PRINTER_URI="${PRINTER_URI:-}"
|
||||
PRINTER_PROTOCOL="${PRINTER_PROTOCOL:-lpd}"
|
||||
PRINTER_PROTOCOL="${PRINTER_PROTOCOL:-socket}"
|
||||
PRINTER_DESCRIPTION="${PRINTER_DESCRIPTION:-}"
|
||||
PPD_FILE="${PPD_FILE:-/usr/share/cups/model/brhl4150cdn.ppd}"
|
||||
PPD_FILE="${PPD_FILE:-/usr/share/cups/model/BR4150_2.PPD}"
|
||||
|
||||
LOG_PREFIX="[entrypoint]"
|
||||
log() { echo "${LOG_PREFIX} $*"; }
|
||||
|
||||
# Build a device URI from PRINTER_IP unless an explicit PRINTER_URI is given.
|
||||
# Raw AppSocket is the default: the HL-4150CDN accepts PostScript directly on
|
||||
# port 9100 (its BR-Script3 interpreter auto-detects the job language).
|
||||
if [ -z "${PRINTER_URI}" ] && [ -n "${PRINTER_IP}" ]; then
|
||||
case "${PRINTER_PROTOCOL}" in
|
||||
lpd)
|
||||
PRINTER_URI="lpd://${PRINTER_IP}/binary_p1"
|
||||
;;
|
||||
socket)
|
||||
PRINTER_URI="socket://${PRINTER_IP}:9100"
|
||||
;;
|
||||
lpd)
|
||||
PRINTER_URI="lpd://${PRINTER_IP}/binary_p1"
|
||||
;;
|
||||
ipp)
|
||||
PRINTER_URI="ipp://${PRINTER_IP}/ipp/print"
|
||||
;;
|
||||
*)
|
||||
log "unknown PRINTER_PROTOCOL '${PRINTER_PROTOCOL}', defaulting to lpd"
|
||||
PRINTER_URI="lpd://${PRINTER_IP}/binary_p1"
|
||||
log "unknown PRINTER_PROTOCOL '${PRINTER_PROTOCOL}', defaulting to socket"
|
||||
PRINTER_URI="socket://${PRINTER_IP}:9100"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user