--- work/foo2zjs/foo2zjs-loadfw +++ work/foo2zjs/foo2zjs-loadfw @@ -2,7 +2,8 @@ # foo2zjs-loadfw: # -# Hotplug script for HP1000/1005/1020 USB laser printers. The model number +# Hotplug script for 100[05],1018,1020,P100[5678],P1505,P1505n +# USB laser printers. The model number # that this script deals with is determined from the udev env. # # Used to download firmware automatically into the printer when it @@ -19,7 +20,7 @@ FWDIR=/lib/firmware # -# Program used to determine USB id information +# Program used to determine USB printer id information # USBID=/bin/usb_printerid @@ -49,31 +50,54 @@ fi # -# Figure out the model number from the name of this script +# Figure out the model number from the argument of this script # +MODELNAME='' +FWMODEL='' case "$1" in +P1005) + MODEL=P1005 + ;; +P1006) + MODEL=P1006 + ;; +P1007) + MODEL=P1007 + FWMODEL=P1005 + ;; +P1008) + MODEL=P1008 + FWMODEL=P1006 + ;; +P1505) + MODEL=P1505 + ;; +P1505n) + MODEL=P1505n + FWMODEL=P1505 + ;; 1000) - MODEL=1000 - MODELNAME="hp LaserJet $MODEL" - ;; + MODEL=1000 + MODELNAME="hp LaserJet $MODEL" + ;; 1005) - MODEL=1005 - MODELNAME="hp LaserJet $MODEL" - ;; + MODEL=1005 + MODELNAME="hp LaserJet $MODEL" + ;; 1018) - MODEL=1018 - MODELNAME="HP LaserJet $MODEL" - ;; + MODEL=1018 + ;; 1020) - MODEL=1020 - MODELNAME="HP LaserJet $MODEL" - ;; + MODEL=1020 + ;; *) - log "Only HP LaserJet 1000, 1005, 1018 and 1020 are supported" - log "You need to supply one of these on the cmdline: $0 10**" - exit - ;; + log "Only HP LaserJet 100[05],1018,1020,P100[5678],P1505,P1505n are supported" + log "You need to supply one of these on the cmdline: $0 10**" + exit + ;; esac +: ${MODELNAME:="HP LaserJet $MODEL"} +: ${FWMODEL:="$MODEL"} if [ -n "$2" ]; then DEVNAME=$2 @@ -89,7 +112,7 @@ # Procedure to load a single device with firmware # load1() { - fw="$FWDIR/sihp$MODEL.dl" + fw="$FWDIR/sihp$FWMODEL.dl" if [ ! -f "$fw" ]; then log "Missing HP LaserJet $MODEL firmware file $fw" log "...read foo2zjs installation instructions and run ./getweb $MODEL" --- work/foo2zjs/hplj10xx.rules +++ work/foo2zjs/hplj10xx.rules @@ -1,4 +1,16 @@ ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{idProduct}=="3d17", RUN+="/sbin/foo2zjs-loadfw P1005 $tempnode" +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{idProduct}=="3e17", RUN+="/sbin/foo2zjs-loadfw P1006 $tempnode" +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{idProduct}=="4817", RUN+="/sbin/foo2zjs-loadfw P1007 $tempnode" +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{idProduct}=="4917", RUN+="/sbin/foo2zjs-loadfw P1008 $tempnode" +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{idProduct}=="3f17", RUN+="/sbin/foo2zjs-loadfw P1505 $tempnode" +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ + ATTRS{idProduct}=="4017", RUN+="/sbin/foo2zjs-loadfw P1505n $tempnode" +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ ATTRS{idProduct}=="0517", RUN+="/sbin/foo2zjs-loadfw 1000 $tempnode" ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ ATTRS{idProduct}=="1317", RUN+="/sbin/foo2zjs-loadfw 1005 $tempnode"