Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37040594
en ru br
ALT Linux repos
S:20200207-alt1
D:20080605-alt2
5.0: 20081207-alt1
4.1: 20080923-alt1
4.0: 20080806-alt1.M40.1
+backports:20060523-alt0.9
3.0: 1.59-alt1
+backports:20060523-alt0.1.M30.1

Group :: System/Configuration/Hardware
RPM: foo2zjs

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: foo2zjs.hotplug-alt-20080925.patch
Download


--- foo2zjs.orig/hplj1000	2008-06-05 14:02:14 +0400
+++ foo2zjs/hplj1000	2008-09-25 11:17:09 +0400
@@ -24,6 +24,7 @@
 esac
 
 PROGNAME="$0"
+PROGDIR="`dirname "$0"`"
 
 #
 # Set $DEV to, e.g. /dev/usb/lp0, to force the device you want
@@ -144,16 +145,18 @@
     if [ "$USB2" != "" ]; then
 	if [ -w /etc/hotplug/usb.usermap ]; then
 		USERMAP=/etc/hotplug/usb.usermap
-	elif [ -d /etc/hotplug/usb/ ]; then
+	elif [ -d /etc/hotplug/usb/ -a -w /etc/hotplug/usb/ ]; then
 		USERMAP=/etc/hotplug/usb/foo2zjs.usermap
 		if [ ! -s $USERMAP ]; then
 			echo > $USERMAP
 		fi
+	elif [ -d "$PROGDIR" -a -w "$PROGDIR" ]; then
+		USERMAP="$PROGDIR/foo2zjs.usermap"
 	else
 		log "No /etc/hotplug usermap!"
 		exit
 	fi
-	chmod 664 $USERMAP
+	#chmod 664 $USERMAP
 	ex - $USERMAP <<-EOF
 	g/^hplj$MODEL/d
 	\$a
@@ -179,8 +182,21 @@
     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"
-	return 1
+	log "Try download firmware $MODEL ...."
+	cd /tmp/
+	if ping -c 1 foo2zjs.rkkda.com; then
+	    getweb $FWMODEL
+	    log "Download finished"
+	    log "Unpack firmware"
+	    arm2hpdl sihp$FWMODEL.img > sihp$FWMODEL.dl
+	    log "Install firmware"
+	    mv sihp$FWMODEL.dl $FWDIR/
+	    sleep 2
+	    rm -f sihp$FWMODEL.img
+	else
+	    log "Firmware not downloading. Read foo2zjs installation instructions (/usr/share/doc/foo2zjs-XXXXXXXX/README-UTF8.ALT)"
+	    return 1
+	fi
     fi
 
     log "loading HP LaserJet $MODEL firmware $fw to $_dev ..."
@@ -212,7 +228,7 @@
 	status=`$PRINTERID $dev 2>/dev/null | grep -y "hp LaserJet $MODEL"`
 	if [ "$status" != "" ]; then
 	    # This is a LaserJet 100x
-	    chmod 0666 $dev
+	    #chmod 0666 $dev
 	    status=`$PRINTERID $dev | grep 'FWVER'`
 	    if [ "$status" = "" ]; then
 		# Firmware is not yet loaded
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin