updated on Fri Jan 6 08:01:17 UTC 2012
[aur-mirror.git] / foo2zjs / 0001-Firmware-destdir-support-20111227.patch
blobc93eba1659b5ccffc091350f113cf72054762d4d
1 Maintainer: Nicola Bignami <nicola@kernel-panic.dnsdojo.net>
2 Contributor: Muhammed Uluyol <uluyol0@gmail.com>
3 Date: Wed, 28 Dec 2011 19:30:24
4 Subject: [PATCH] Firmware destdir support
6 ---
7 Makefile | 97 ++++++++++----------------------
8 foo2zjs-loadfw.in | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++++
9 hplj10xx.rules | 59 +++++++-------------
10 3 files changed, 211 insertions(+), 107 deletions(-)
11 create mode 100644 foo2zjs-loadfw.in
13 diff --git a/Makefile b/Makefile
14 index 8f9bbce..a97b36b 100644
15 --- a/Makefile
16 +++ b/Makefile
17 @@ -18,7 +18,6 @@ VERSION=0.0
19 # Installation prefix...
20 PREFIX=/usr/local
21 -PREFIX=/usr
22 PREFIX=$(DESTDIR)/usr
24 # Pathnames for this package...
25 @@ -37,7 +36,7 @@ INSTALL=install
26 ROOT=root
28 # Pathnames for referenced packages...
29 -FOODB=$(DESTDIR)/usr/share/foomatic/db/source
30 +FOODB=$(PREFIX)/share/foomatic/db/source
32 # User ID's
33 LPuid=-oroot
34 @@ -163,6 +162,7 @@ FILES = \
35 gipddecode.1in \
36 hbpldecode.c \
37 hbpldecode.1in \
38 + foo2zjs-loadfw.in \
39 foo2zjs-wrapper.in \
40 foo2zjs-wrapper.1in \
41 foo2hp2600-wrapper.in \
42 @@ -239,7 +240,7 @@ # CUPS vars
43 -CUPS_SERVERBIN := $(shell cups-config --serverbin 2>/dev/null)
44 +CUPS_SERVERBIN := $(DESTDIR)$(shell cups-config --serverbin 2>/dev/null)
45 -CUPS_DEVEL := $(shell grep cupsSideChannelDoRequest /usr/include/cups/sidechannel.h 2>/dev/null)
46 +CUPS_DEVEL := $(DESTDIR)$(shell grep cupsSideChannelDoRequest /usr/include/cups/sidechannel.h 2>/dev/null)
47 -CUPS_GOODAPI := $(shell cups-config --api-version 2>/dev/null | sed "s/1\.[0123].*//")
48 +CUPS_GOODAPI := $(DESTDIR)$(shell cups-config --api-version | sed "s/1\.[0123].*//" 2>/dev/null)
50 # hpclj2600n-0.icm km2430_0.icm km2430_1.icm km2430_2.icm samclp300-0.icm
51 # sihp1000.img sihp1005.img sihp1020.img sihp1018.img
52 # sihpP1005.img sihpP1006.img sihpP1505.img
53 @@ -262,7 +262,7 @@ endif
54 SHELLS= foo2zjs-wrapper foo2oak-wrapper foo2hp2600-wrapper \
55 foo2xqx-wrapper foo2lava-wrapper foo2qpdl-wrapper \
56 foo2slx-wrapper foo2hiperc-wrapper
57 -SHELLS+= foo2zjs-pstops
58 +SHELLS+= foo2zjs-loadfw foo2zjs-pstops
59 SHELLS+= printer-profile
60 MANPAGES= foo2zjs-wrapper.1 foo2zjs.1 zjsdecode.1
61 MANPAGES+= foo2oak-wrapper.1 foo2oak.1 oakdecode.1
62 @@ -465,6 +465,11 @@ foo2slx: foo2slx.o $(LIBJBG)
63 foo2hiperc: foo2hiperc.o $(LIBJBG)
64 $(CC) $(CFLAGS) -o $@ foo2hiperc.o $(LIBJBG)
66 +foo2zjs-loadfw: foo2zjs-loadfw.in Makefile
67 + [ ! -f $@ ] || chmod +w $@
68 + sed < $@.in > $@ \
69 + -e 's:@ZJSFWDIR@:$(SHAREZJS)/firmware:' -e 's:@XQXFWDIR@:$(SHAREXQX)/firmware/:' || (rm -f $@ && exit 1)
70 + chmod 555 $@
72 foo2zjs-wrapper: foo2zjs-wrapper.in Makefile
73 [ ! -f $@ ] || chmod +w $@
74 @@ -623,6 +628,8 @@ install-test:
75 UDEVBIN=$(DESTDIR)/bin/
77 install-prog:
78 + [ -d $(BIN) ] || $(INSTALL) -d -m 755 $(BIN)/
79 + [ -d $(DESTDIR)/bin/ ] || $(INSTALL) -d -m 755 $(DESTDIR)/bin/
81 # Install driver, wrapper, and development tools
83 @@ -630,7 +637,7 @@ install-prog:
84 $(INSTALL) -c $(PROGS) $(SHELLS) $(BIN)/
85 if [ "$(BINPROGS)" != "" ]; then \
86 $(INSTALL) -d $(UDEVBIN); \
87 - $(INSTALL) -c $(BINPROGS) $(UDEVBIN); \
88 + $(INSTALL) -c $(BINPROGS) $(DESTDIR)/bin/; \
91 # Install gamma correction files. These are just templates,
92 @@ -683,10 +690,10 @@ install-foo:
94 # Clear foomatic cache and rebuild database if needed
96 - rm -rf /var/cache/foomatic/*/*
97 - rm -f /var/cache/foomatic/printconf.pickle
98 - if [ -d /var/cache/foomatic/compiled ]; then \
99 - cd /var/cache/foomatic/compiled; \
100 + rm -rf $(DESTDIR)/var/cache/foomatic/*/*
101 + rm -f $(DESTDIR)/var/cache/foomatic/printconf.pickle
102 + if [ -d $(DESTDIR)/var/cache/foomatic/compiled ]; then \
103 + cd $(DESTDIR)/var/cache/foomatic/compiled; \
104 foomatic-combo-xml -O >overview.xml; \
107 @@ -748,7 +755,7 @@ install-extra:
108 fi; \
109 done
110 # foo2zjs Firmware files (if any)
111 - $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREZJS)/firmware/
112 + $(INSTALL) $(LPuid) $(LPgid) -m 755 -d $(SHAREZJS)/firmware/
113 for i in sihp1*.img; do \
114 if [ -f $$i ]; then \
115 base=`basename $$i .img`; \
116 @@ -757,7 +764,7 @@ install-extra:
117 fi; \
118 done
119 # foo2xqx Firmware files (if any)
120 - $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREXQX)/firmware/
121 + $(INSTALL) $(LPuid) $(LPgid) -m 755 -d $(SHAREXQX)/firmware/
122 for i in sihpP*.img; do \
123 if [ -f $$i ]; then \
124 base=`basename $$i .img`; \
125 @@ -808,10 +815,10 @@ install-extra:
126 fi; \
127 done
129 -MODEL=$(DESTDIR)/usr/share/cups/model
130 +MODEL=$(PREFIX)/share/cups/model
131 -LOCALMODEL=$(DESTDIR)/usr/local/share/cups/model
132 +LOCALMODEL=$(PREFIX)/usr/local/share/cups/model
133 MACMODEL=/Library/Printers/PPDs/Contents/Resources
134 -PPD=$(DESTDIR)/usr/share/ppd
135 +PPD=$(PREFIX)/share/ppd
136 VARPPD=/var/lp/ppd
137 install-ppd:
139 @@ -829,13 +836,6 @@ install-ppd:
140 done; \
141 ppdmgr -u; \
142 elif [ -d $(PPD) ]; then \
143 - find $(PPD) -name '*foo2zjs*' | xargs rm -rf; \
144 - find $(PPD) -name '*foo2hp*' | xargs rm -rf; \
145 - find $(PPD) -name '*foo2xqx*' | xargs rm -rf; \
146 - find $(PPD) -name '*foo2lava*' | xargs rm -rf; \
147 - find $(PPD) -name '*foo2qpdl*' | xargs rm -rf; \
148 - find $(PPD) -name '*foo2slx*' | xargs rm -rf; \
149 - find $(PPD) -name '*foo2hiperc*' | xargs rm -rf; \
150 [ -d $(PPD)/foo2zjs ] || mkdir $(PPD)/foo2zjs; \
151 cd PPD; \
152 for ppd in *.ppd; do \
153 @@ -868,9 +868,9 @@ install-ppd:
154 done; \
157 -APPL=$(DESTDIR)/usr/share/applications
158 -OLDAPPL=$(DESTDIR)/usr/share/gnome/apps/System
159 -PIXMAPS=$(DESTDIR)/usr/share/pixmaps
160 +APPL=$(PREFIX)/share/applications
161 +OLDAPPL=$(PREFIX)/share/gnome/apps/System
162 +PIXMAPS=$(PREFIX)/share/pixmaps
164 install-desktop:
166 @@ -894,7 +894,7 @@ install-gui:
167 $(INSTALL) -c -m 755 hplj10xx_gui.tcl $(SHAREZJS)
170 -USBDIR=/etc/hotplug/usb
171 +USBDIR=$(DESTDIR)/etc/hotplug/usb
172 UDEVDIR=/etc/udev/rules.d
173 LIBUDEVDIR=/lib/udev/rules.d
174 RULES=hplj10xx.rules
175 @@ -939,61 +939,22@@ install-hotplug-test:
178 install-hotplug-prog:
180 - # remove HPLIP (proprietary) files and install our version
182 - if [ -d $(UDEVDIR) ]; then \
183 - rm -f $(UDEVDIR)/*hpmud*laserjet_1000*; \
184 - rm -f $(UDEVDIR)/*hpmud*laserjet_1005*; \
185 - rm -f $(UDEVDIR)/*hpmud*laserjet_1018*; \
186 - rm -f $(UDEVDIR)/*hpmud*laserjet_1020*; \
187 - rm -f $(UDEVDIR)/*hpmud*laserjet_p1005*; \
188 - rm -f $(UDEVDIR)/*hpmud*laserjet_p1006*; \
189 - rm -f $(UDEVDIR)/*hpmud*laserjet_p1007*; \
190 - rm -f $(UDEVDIR)/*hpmud*laserjet_p1008*; \
191 - rm -f $(UDEVDIR)/*hpmud*laserjet_p1505*; \
192 - rm -f $(UDEVDIR)/*hpmud_support.rules; \
193 - rm -f $(LIBUDEVDIR)/*-hplj10xx.rules; \
194 - version=`$(UDEVD) --version 2>/dev/null`; \
195 - if [ "$$version" = "" ]; then version=0; fi; \
196 - echo "*** udev version $$version"; \
197 - if [ "$$version" -lt 148 ]; then \
198 - $(INSTALL) -c -m 644 $(RULES).old $(UDEVDIR)/11-$(RULES); \
199 - else \
200 - $(INSTALL) -c -m 644 $(RULES) $(UDEVDIR)/11-$(RULES); \
201 - fi \
202 - fi
203 + install -d -m 755 $(DESTDIR)$(UDEVDIR)
204 + $(INSTALL) -c -m 644 $(RULES) $(DESTDIR)$(UDEVDIR)/11-$(RULES); \
205 if [ -d $(DEVDDIR) ]; then \
206 $(INSTALL) -c -m 644 hplj10xx.conf $(DEVDDIR)/; \
208 [ -d $(USBDIR) ] || $(INSTALL) -d -m 755 $(USBDIR)/
209 - $(INSTALL) -c -m 755 hplj1000 $(USBDIR)/
210 - ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hplj1005
211 - ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hplj1018
212 - ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hplj1020
213 - ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1005
214 - ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1006
215 - ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1007
216 - ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1008
217 - ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1505
218 - $(USBDIR)/hplj1000 install-usermap
219 - $(USBDIR)/hplj1005 install-usermap
220 - $(USBDIR)/hplj1018 install-usermap
221 - $(USBDIR)/hplj1020 install-usermap
222 - $(USBDIR)/hpljP1005 install-usermap
223 - $(USBDIR)/hpljP1006 install-usermap
224 - $(USBDIR)/hpljP1007 install-usermap
225 - $(USBDIR)/hpljP1008 install-usermap
226 - $(USBDIR)/hpljP1505 install-usermap
227 - # modprobe usblp
228 - $(USBDIR)/hplj1000 install-usblp
229 + $(INSTALL) -d -m 755 $(DESTDIR)/sbin
230 + $(INSTALL) -c -m 755 foo2zjs-loadfw $(DESTDIR)/sbin
232 install-hotplug-osx:
233 cd osx-hotplug; $(MAKE) PREFIX=$(PREFIX) install-hotplug
235 install-filter:
236 if [ "$(CUPS_SERVERBIN)" != "" ]; then \
237 + install -d -m 755 $(CUPS_SERVERBIN)/filter; \
238 - ln -sf $(BIN)/command2foo2lava-pjl $(CUPS_SERVERBIN)/filter/; \
239 + ln -sf ../../../bin/command2foo2lava-pjl $(CUPS_SERVERBIN)/filter/; \
242 CUPSDCONF=/etc/cups/cupsd.conf
243 diff --git a/foo2zjs-loadfw.in b/foo2zjs-loadfw.in
244 new file mode 100644
245 index 0000000..a7e1bfc
246 --- /dev/null
247 +++ b/foo2zjs-loadfw.in
248 @@ -0,0 +1,162 @@
249 +#!/bin/sh
251 +# foo2zjs-loadfw:
253 +# Hotplug script for HP1000/1005/1020 USB laser printers. The model number
254 +# that this script deals with is determined from the udev env.
256 +# Used to download firmware automatically into the printer when it
257 +# is powered up or plugged into the USB port.
259 +# The inspiration fo this script is from:
260 +# Oscar Santacreu. Alicante-Spain (2002)
261 +# Mike Morgan (2004)
262 +# Modified by Stefan Schweizer (2005) to work as a udev-RUN-script
265 +# Directory to find downloadable HP firmware files sihpMMMM.dl
267 +ZJSFW=@ZJSFWDIR@
268 +XQXFW=@XQXFWDIR@
271 +# Program used to determine USB id information
273 +USBID=/bin/usb_printerid
276 +# Timeout to load firmware
278 +TIMEOUT=6
281 +# Figure out how to log our messages
283 +if [ -t 1 ]; then
284 + # Running from a tty...
285 + log() {
286 + echo "$0: $@"
288 +elif [ -x /usr/bin/logger ]; then
289 + # Have logger...
290 + log() {
291 + logger -t "$0" -- "$@"
293 +else
294 + # No logger...
295 + log() {
296 + echo "$0: $@" >> /var/log/messages
301 +# Figure out the model number from the name of this script
303 +case "$1" in
304 +P1005)
305 + MODEL=P1005; FWMODEL=$MODEL
306 + MODELNAME="HP LaserJet $MODEL"
307 + FWDIR=$XQXFW
308 + ;;
309 +P1006)
310 + MODEL=P1006; FWMODEL=$MODEL
311 + MODELNAME="HP LaserJet $MODEL"
312 + FWDIR=$XQXFW
313 + ;;
314 +P1007)
315 + MODEL=P1007; FWMODEL=P1005 # Alias
316 + MODELNAME="HP LaserJet $MODEL"
317 + FWDIR=$XQXFW
318 + ;;
319 +P1008)
320 + MODEL=P1008; FWMODEL=P1006 # Alias
321 + MODELNAME="HP LaserJet $MODEL"
322 + FWDIR=$XQXFW
323 + ;;
324 +P1505)
325 + MODEL=P1505; FWMODEL=$MODEL
326 + MODELNAME="HP LaserJet $MODEL"
327 + FWDIR=$XQXFW
328 + ;;
329 +P1505n)
330 + MODEL=P1505n; FWMODEL=$MODEL
331 + MODELNAME="HP LaserJet $MODEL"
332 + FWDIR=$XQXFW
333 + ;;
334 +1000)
335 + MODEL=1000; FWMODEL=$MODEL
336 + MODELNAME="hp LaserJet $MODEL"
337 + FWDIR=$ZJSFW
338 + ;;
339 +1005)
340 + MODEL=1005; FWMODEL=$MODEL
341 + MODELNAME="hp LaserJet $MODEL"
342 + FWDIR=$ZJSFW
343 + ;;
344 +1018)
345 + MODEL=1018; FWMODEL=$MODEL
346 + MODELNAME="HP LaserJet $MODEL"
347 + FWDIR=$ZJSFW
348 + ;;
349 +1020)
350 + MODEL=1020; FWMODEL=$MODEL
351 + MODELNAME="HP LaserJet $MODEL"
352 + FWDIR=$ZJSFW
353 + ;;
355 + log "Only HP LaserJet 1000, 1005, 1018 and 1020 are supported"
356 + log "You need to supply one of these on the cmdline: $0 10**"
357 + exit
358 + ;;
359 +esac
361 +if [ -n "$2" ]; then
362 + DEVNAME=$2
363 +elif [ -n "$DEVNAME" ]; then
364 + log 'using $DEVNAME'
365 +else
366 + log "You need to either have $DEVNAME set in the environment or supply it on the cmdline, like:"
367 + log "$0 10** /dev/usb/lp0"
368 + exit 1
372 +# Procedure to load a single device with firmware
374 +load1() {
375 + fw="$FWDIR/sihp$FWMODEL.dl"
376 + if [ ! -f "$fw" ]; then
377 + log "Missing HP LaserJet $MODEL firmware file $fw"
378 + log "...read foo2zjs installation instructions and run ./getweb $MODEL"
379 + return 1
380 + fi
382 + log "loading HP LaserJet $MODEL firmware $fw to $DEVNAME ..."
383 + if cat $fw > $DEVNAME; then
384 + sleep $TIMEOUT
385 + log "... download successful."
386 + else
387 + log "... download failed."
388 + fi
389 + return 0
393 +# OK, now download firmware to any printers that need it
395 +if [ -x $USBID ]; then
396 + if $USBID $DEVNAME | grep "$MODELNAME" 2> /dev/null; then
397 + # This is a LaserJet 100x
398 + if $USBID $DEVNAME | grep 'FWVER' 2> /dev/null; then
399 + log "HP LaserJet $MODEL firmware already loaded into $DEVNAME"
400 + else
401 + # Firmware is not yet loaded
402 + load1 "$DEVNAME"
403 + fi
404 + else
405 + log "No supported printer found."
406 + fi
407 +else
408 + log "HP LaserJet $MODEL firmware was not downloaded..."
409 + log "...couldn't find $USBID"
411 diff --git a/hplj10xx.rules b/hplj10xx.rules
412 index ee0295d..b81ff9e 100644
413 --- a/hplj10xx.rules
414 +++ b/hplj10xx.rules
415 @@ -1,39 +1,20 @@
417 -# hplj10xx.rules.old: udev equal or after 1.30
419 -#Own udev rule for HP Laserjet 1000
420 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \
421 - ATTRS{product}=="hp LaserJet 1000", NAME="usb/%k", \
422 - SYMLINK+="hplj1000-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1000"
423 -#Own udev rule for HP Laserjet 1005
424 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \
425 - ATTRS{product}=="hp LaserJet 1005 series", NAME="usb/%k", \
426 - SYMLINK+="hplj1005-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1005"
427 -#Own udev rule for HP Laserjet 1018
428 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \
429 - ATTRS{product}=="HP LaserJet 1018", NAME="usb/%k", \
430 - SYMLINK+="hplj1018-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1018"
431 -#Own udev rule for HP Laserjet 1020
432 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \
433 - ATTRS{product}=="HP LaserJet 1020", NAME="usb/%k", \
434 - SYMLINK+="hplj1020-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1020"
435 -#Own udev rule for HP Laserjet P1005
436 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \
437 - ATTRS{product}=="HP LaserJet P1005", NAME="usb/%k", \
438 - SYMLINK+="hpljP1005-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1005"
439 -#Own udev rule for HP Laserjet P1006
440 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \
441 - ATTRS{product}=="HP LaserJet P1006", NAME="usb/%k", \
442 - SYMLINK+="hpljP1006-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1006"
443 -#Own udev rule for HP Laserjet P1007
444 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \
445 - ATTRS{product}=="HP LaserJet P1007", NAME="usb/%k", \
446 - SYMLINK+="hpljP1007-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1007"
447 -#Own udev rule for HP Laserjet P1008
448 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \
449 - ATTRS{product}=="HP LaserJet P1008", NAME="usb/%k", \
450 - SYMLINK+="hpljP1008-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1008"
451 -#Own udev rule for HP Laserjet P1505
452 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \
453 - ATTRS{product}=="HP LaserJet P1505", NAME="usb/%k", \
454 - SYMLINK+="hpljP1505-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1505"
455 +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
456 + ATTRS{idProduct}=="0517", RUN+="/sbin/foo2zjs-loadfw 1000 $tempnode"
457 +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
458 + ATTRS{idProduct}=="1317", RUN+="/sbin/foo2zjs-loadfw 1005 $tempnode"
459 +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
460 + ATTRS{idProduct}=="4117", RUN+="/sbin/foo2zjs-loadfw 1018 $tempnode"
461 +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
462 + ATTRS{idProduct}=="2b17", RUN+="/sbin/foo2zjs-loadfw 1020 $tempnode"
463 +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
464 + ATTRS{idProduct}=="3d17", RUN+="/sbin/foo2zjs-loadfw P1005 $tempnode"
465 +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
466 + ATTRS{idProduct}=="3e17", RUN+="/sbin/foo2zjs-loadfw P1006 $tempnode"
467 +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
468 + ATTRS{idProduct}=="4817", RUN+="/sbin/foo2zjs-loadfw P1007 $tempnode"
469 +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
470 + ATTRS{idProduct}=="4917", RUN+="/sbin/foo2zjs-loadfw P1008 $tempnode"
471 +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
472 + ATTRS{idProduct}=="3f17", RUN+="/sbin/foo2zjs-loadfw P1505 $tempnode"
473 +ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
474 + ATTRS{idProduct}=="4017", RUN+="/sbin/foo2zjs-loadfw P1505n $tempnode"
476 1.7.6