Browse Source

Plan 9 from Bell Labs 2008-03-06

David du Colombier 13 years ago
parent
commit
8b751e9752

+ 6 - 3
dist/replica/_plan9.db

@@ -305,7 +305,7 @@
 386/bin/ip/httpd/wikipost - 775 sys sys 1191273662 114183
 386/bin/ip/httpfile - 775 sys sys 1188447244 284004
 386/bin/ip/imap4d - 775 sys sys 1188447250 236867
-386/bin/ip/ipconfig - 775 sys sys 1204292503 161825
+386/bin/ip/ipconfig - 775 sys sys 1204750828 161835
 386/bin/ip/linklocal - 775 sys sys 1204292504 46800
 386/bin/ip/ping - 775 sys sys 1204292506 94531
 386/bin/ip/ppp - 775 sys sys 1204292510 221800
@@ -5541,7 +5541,7 @@ rc/bin/leak - 775 sys sys 1172760642 1921
 rc/bin/lookman - 775 sys sys 1186528516 687
 rc/bin/lp - 775 sys sys 1162105982 5201
 rc/bin/mail - 775 sys sys 1045504003 138
-rc/bin/man - 775 sys sys 1194214975 2639
+rc/bin/man - 775 sys sys 1204738776 2654
 rc/bin/map - 775 sys sys 945617207 1576
 rc/bin/mapdemo - 775 sys sys 945617207 4075
 rc/bin/membername - 775 sys sys 945617207 89
@@ -12542,7 +12542,7 @@ sys/src/cmd/ip/imap4d/utils.c - 664 sys sys 1168894057 2587
 sys/src/cmd/ip/ipconfig - 20000000775 sys sys 1176933436 0
 sys/src/cmd/ip/ipconfig/ipconfig.h - 664 sys sys 1198189129 5311
 sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1198189135 20619
-sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1204178443 40237
+sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1204698102 40286
 sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1204591120 575
 sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1184880751 1046
 sys/src/cmd/ip/linklocal.c - 664 sys sys 1197673397 1751
@@ -15869,3 +15869,6 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+sys/lib/lp/devices - 664 sys sys 1204761686 3846
+sys/lib/lp/process/generic - 775 sys sys 1204761143 4465
+sys/lib/lp/process/pdfgs - 775 sys sys 1204761083 1631

+ 7 - 6
dist/replica/plan9.db

@@ -305,7 +305,7 @@
 386/bin/ip/httpd/wikipost - 775 sys sys 1191273662 114183
 386/bin/ip/httpfile - 775 sys sys 1188447244 284004
 386/bin/ip/imap4d - 775 sys sys 1188447250 236867
-386/bin/ip/ipconfig - 775 sys sys 1204292503 161825
+386/bin/ip/ipconfig - 775 sys sys 1204750828 161835
 386/bin/ip/linklocal - 775 sys sys 1204292504 46800
 386/bin/ip/ping - 775 sys sys 1204292506 94531
 386/bin/ip/ppp - 775 sys sys 1204292510 221800
@@ -5541,7 +5541,7 @@ rc/bin/leak - 775 sys sys 1172760642 1921
 rc/bin/lookman - 775 sys sys 1186528516 687
 rc/bin/lp - 775 sys sys 1162105982 5201
 rc/bin/mail - 775 sys sys 1045504003 138
-rc/bin/man - 775 sys sys 1194214975 2639
+rc/bin/man - 775 sys sys 1204738776 2654
 rc/bin/map - 775 sys sys 945617207 1576
 rc/bin/mapdemo - 775 sys sys 945617207 4075
 rc/bin/membername - 775 sys sys 945617207 89
@@ -6635,7 +6635,7 @@ sys/lib/lp/daemon/xante - 775 sys sys 954037458 364
 sys/lib/lp/daemon/xerox - 775 sys sys 954037458 326
 sys/lib/lp/daemon/xerox-4517 - 775 sys sys 954037458 332
 sys/lib/lp/daemon/xerox-N32 - 775 sys sys 954037458 343
-sys/lib/lp/devices - 664 sys sys 1015012256 3524
+sys/lib/lp/devices - 664 sys sys 1204761686 3846
 sys/lib/lp/kill - 20000000775 sys sys 1039727405 0
 sys/lib/lp/kill/generic - 775 sys sys 954037458 638
 sys/lib/lp/kill/xerox - 775 sys sys 954037458 89
@@ -6647,7 +6647,7 @@ sys/lib/lp/process - 20000000775 sys sys 1077670465 0
 sys/lib/lp/process/dpost - 775 sys sys 1015012079 2412
 sys/lib/lp/process/dvipost - 775 sys sys 954037459 3123
 sys/lib/lp/process/g3post - 775 sys sys 954037459 2348
-sys/lib/lp/process/generic - 775 sys sys 1174846328 4108
+sys/lib/lp/process/generic - 775 sys sys 1204761143 4465
 sys/lib/lp/process/gifpost - 775 sys sys 1015012079 2317
 sys/lib/lp/process/gspipe - 775 sys sys 1015012079 434
 sys/lib/lp/process/gspipeijs - 775 sys sys 1077670465 949
@@ -6655,7 +6655,7 @@ sys/lib/lp/process/hpost - 775 sys sys 1187741307 3386
 sys/lib/lp/process/jpgpost - 775 sys sys 1015012079 2313
 sys/lib/lp/process/noproc - 775 sys sys 954037459 62
 sys/lib/lp/process/p9bitpost - 775 sys sys 954037459 2436
-sys/lib/lp/process/pdfgs - 775 sys sys 1016833869 1732
+sys/lib/lp/process/pdfgs - 775 sys sys 1204761083 1631
 sys/lib/lp/process/pdfgsijs - 775 sys sys 1077634892 1687
 sys/lib/lp/process/pdfpost - 775 sys sys 1015012079 2100
 sys/lib/lp/process/post - 775 sys sys 1045164703 1955
@@ -12542,7 +12542,7 @@ sys/src/cmd/ip/imap4d/utils.c - 664 sys sys 1168894057 2587
 sys/src/cmd/ip/ipconfig - 20000000775 sys sys 1176933436 0
 sys/src/cmd/ip/ipconfig/ipconfig.h - 664 sys sys 1198189129 5311
 sys/src/cmd/ip/ipconfig/ipv6.c - 664 sys sys 1198189135 20619
-sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1204178443 40237
+sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1204698102 40286
 sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1204591120 575
 sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1184880751 1046
 sys/src/cmd/ip/linklocal.c - 664 sys sys 1197673397 1751
@@ -15869,3 +15869,4 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+sys/lib/lp/devices - 664 sys sys 1204761747 3854

+ 6 - 0
dist/replica/plan9.log

@@ -18705,3 +18705,9 @@
 1204590603 2 c sys/src/cmd/proof/screen.c - 664 sys sys 1204590226 6673
 1204592404 0 c sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1204591120 575
 1204605003 0 c 386/bin/proof - 775 sys sys 1204604985 179949
+1204698604 0 c sys/src/cmd/ip/ipconfig/main.c - 664 sys sys 1204698102 40286
+1204740004 0 c rc/bin/man - 775 sys sys 1204738776 2654
+1204750804 0 c 386/bin/ip/ipconfig - 775 sys sys 1204750828 161835
+1204761604 0 c sys/lib/lp/devices - 664 sys sys 1204761686 3846
+1204761604 1 c sys/lib/lp/process/generic - 775 sys sys 1204761143 4465
+1204761604 2 c sys/lib/lp/process/pdfgs - 775 sys sys 1204761083 1631

+ 1 - 1
rc/bin/man

@@ -24,7 +24,7 @@ fn roff {
 		Nflag='-N'
 		Lflag='-rL1000i'
 		# setting L changes page length to infinity (sed script removes empty lines)
-		if (grep -s '^\.2C' $2)
+		if (grep -s '^\.(2C|sp *[0-9]*\.)' $2)
 			postproc=col
 	}
 	if(~ $x *eqn*)

+ 28 - 20
sys/lib/lp/devices

@@ -1,64 +1,72 @@
 # Here is a sample printer devices file where some of the printers have
 # been commented out.
 #
-# device_name	loc		dest_host		phys_dev_name		speed	class				def_proc	spooler		stat		kill		daemon		sched
+# device_name	loc dest_host phys_dev_name speed class def_proc spooler stat kill daemon sched
+#
+# HP LaserJet 9050 MFP duplex Postscript 3, PDF 1.3 on Ethernet
+# mh2c548d-1	2c-548d mh2c548-1.mh.lucent.com  mh2c548-1.mh.lucent.com  - post2+1200dpi+duplex generic lpdspool+fonts lpd generic hp
+# target for PDF files, bypassing Postscript: no -o, -c, -n; doesn't add fonts.
+# +pdf needs +HPJCL for duplex printing.
+# mh2c548d-1-pdf 2c-548d mh2c548-1.mh.lucent.com mh2c548-1.mh.lucent.com - pdf+1200dpi+duplex+HPJCL generic lpdspool lpd generic hp
+# HP LaserJet 5550 duplex Colour
+# mh2c548d-2c	2c-548d mh2c548-2c.mh.lucent.com mh2c548-2c.mh.lucent.com - post+600dpi+duplex+color generic lpdspool+fonts lpd generic hp
 #
 # HP LaserJet 4M connected to serial port on an Annex terminal server.
-# 2c254			2C-254	rice			tcp!annex!7035		19200	post+600dpi			generic		generic		generic		generic		tcppost		FIFO
+# 2c254		2C-254 rice tcp!annex!7035 19200 post+600dpi generic generic generic generic tcppost
 #
 # HP LaserJet 4M connected to Ethernet via a JetDirect card.
 # The speed field is used to set the bufffer size in the tcpostio program run from tcppost.
-# 2c307			2C-307	alice			tcp!mh2c307!9100	81920	post+600dpi			generic		generic		generic		generic		tcppost		FIFO
+# 2c307		2C-307 alice tcp!mh2c307!9100 81920 post+600dpi generic generic generic generic tcppost
 #
 # HP LaserJet 4M connected to serial port on a Cisco terminal server.
-# 2t4			2T-402	pyxis			tcp!ts!4010			19200	post+600dpi			generic		generic		generic		generic		tcppost		FIFO
+# 2t4		2T-402 pyxis tcp!ts!4010 19200 post+600dpi generic generic generic generic tcppost
 #
 # HP LaserJet 4Si/MX connected to Ethernet via a JetDirect card.
 # This printer has a duplexing option.
 # See /sys/lib/postscript/prologues/hpsimx.ps for a fix to make it default
 # to the large paper tray at postion 1.
-# fn			2C-501	helix			tcp!fn!9100			81920	post2+600dpi+duplex	generic		generic		generic		generic		tcppost		FIFO
+# fn		2C-501 helix tcp!fn!9100 81920 post2+600dpi+duplex generic generic generic generic tcppost
 #
 # Tektronix Phaser 200i connected to Ethernet.
-# Using Xinet K-Talk software from a UNIX host.  This software is not recommended.
+# Using Xinet K-Talk software from a UNIX host. This software is not recommended.
 # We do not want to waste stock on the color printer so we do not print header pages.
-# peacock		2C-501	cetus			peacock				-		post2+300dpi+nohead+color	generic		generic		generic		generic		appletalk	FIFO
+# peacock	2C-501 cetus peacock - post2+300dpi+nohead+color generic generic generic generic appletalk
 #
 # Any PostScript printer connected to the LPT1 port on my 486 pc running Plan 9 as a terminal.
-pcclone		-			-			/dev/lpt1data		-		post+nohead			generic		pcclone		-			-			-			-
+pcclone		- - /dev/lpt1data - post+nohead generic pcclone - - - -
 #
 # QMS-410 connected to the serial port of an NCD terminal.
-# math34		2T-102	rice			tcp!math34!87		9600	post+600dpi			generic		generic		generic		generic		tcppost		FIFO
+# math34	2T-102 rice tcp!math34!87 9600 post+600dpi generic generic generic generic tcppost
 #
 # QMS-410 connected to the serial port of an AT&T 630/730 terminal
-# ps630		printer-on-630	-			-					-		post+300dpi+nohead	generic		ps630		-			-			-			-
+# ps630		printer-on-630 - - - post+300dpi+nohead generic ps630 - - - -
 #
-# Xante Accel-a-Writer-8200.  1200dpi printer that uses a BSD lpr print daemon protocol
-# psu		2C-501		cetus			psu					-		post+1200dpi		generic		generic		xante		generic		lpddaemon	FIFO
+# Xante Accel-a-Writer-8200. 1200dpi printer that uses a BSD lpr print daemon protocol
+# psu		2C-501 cetus psu - post+1200dpi generic generic xante generic lpddaemon
 #
 # 'stdout' sends the output to the standard output of the lp command.
 # if the 'phys_dev_name' field is set to a file or device, the output will go to it instead.
 # if '+sendEOT' is added to the 'class' field, an EOT character will be sent at the end of the output.
 #
-stdout	-			-				-					-		post+nohead			generic		nospool		-			-			-			-
+stdout		- - - - post+nohead generic nospool - - - -
 #
 # sends the output to the standard output of the lp command.
 # used for generating output suitable for 100 dpi.
-100dpi	-			-				-					-		post+100dpi+nohead	generic		nospool		-			-			-			-
+100dpi		- - - - post+100dpi+nohead generic nospool - - - -
 #
 # same as above for generating output suitable for 300 dpi.
-300dpi	-			-				-					-		post+300dpi+nohead	generic		nospool		-			-			-			-
+300dpi		- - - - post+300dpi+nohead generic nospool - - - -
 #
 # same as above for generating output suitable for 600 dpi.
 #
-600dpi	-			-				-					-		post+600dpi+nohead	generic		nospool		-			-			-			-
+600dpi		- - - - post+600dpi+nohead generic nospool - - - -
 #
 # same as above for generating output suitable for Linotronics phototypesetter.
-1270dpi	-			-				-					-		post+lino+nohead	generic		nospool		-			-			-			-
+1270dpi		- - - - post+lino+nohead generic nospool - - - -
 
 # 600dpi postscript printer named vogon via BSD LPD printer queue on alice
-vogon printer-room	alice	vogon - post+600dpi		generic		lpdspool	lpd		-			-		FIFO
+vogon		printer-room alice vogon - post+600dpi generic lpdspool lpd - -
 
 # HP DeskJet and Canon BJC-240
-hpdeskjet		-		-				/dev/lpt1data					-	gs!cdj670+nohead					generic		nospool		-		-			-		-
-canonbjc240l		-		-				/dev/lpt1data					-	gs!bjc600+nohead					generic		nospool		-		-			-		-
+hpdeskjet	- - /dev/lpt1data - gs!cdj670+nohead generic nospool - - - -
+canonbjc240l	- - /dev/lpt1data - gs!bjc600+nohead generic nospool - - - -

+ 10 - 0
sys/lib/lp/process/generic

@@ -153,6 +153,16 @@ case tiff
 	}
 case PDF
 	switch ($LPCLASS) {
+	case *pdf*
+#		if (~ $LPCLASS *duplex* && ~ $LPCLASS *HPJCL*)
+#			echo -n '&l1S'		# HP JCL: duplex on
+		if (~ $LPCLASS *duplex* && ~ $LPCLASS *HPJCL*) {
+			echo '%-12345X@PJL DEFAULT DUPLEX=ON'	# HP PJL
+			echo '%-12345X'
+			echo '%-12345X@PJL DEFAULT PS:MBT=ON'	# `memory boost'
+			echo '%-12345X'
+		}
+		cat $temp		# pass pdf unaltered to pdf printer
 	case *post*
 		$proc/pdfpost $temp
 	case *gs!*

+ 9 - 16
sys/lib/lp/process/pdfgs

@@ -1,12 +1,9 @@
 #!/bin/rc
-
+# pdfgs pdffile [gsdev] - generate PS from PDF
 #
 # we don't go through postscript, because to
 # get to postscript, we send the pdf through gs!
 # much easier to just go directly.
-#
-
-# usage: pdfgs pdffile [gsdev]
 
 switch($#*) {
 case 2
@@ -15,22 +12,18 @@ case 1
 	GSDEVICE=`{echo $LPCLASS | sed 's/(.*\+)?gs!([^+]*)(\+.*)?/\2/'}
 case *
 	echo 'usage: pdfgs pdffile [gsdev]' >[1=2]
+	exit usage
 }
 
 GSTMPFILE=/tmp/pdf^$pid
-GSOPT=('-sDEVICE='$GSDEVICE '-sOutputFile='^$GSTMPFILE -dSAFER -dNOPAUSE -dQUIET -dBATCH -dNOPAUSE)
-
-#
-# RSC: pswrite produces weird overbars on various
-# letters, most notably Times-Roman A and h, unless
-# we use LanguageLevel=1.  This doesn't seem to be 
-# constrained to hp4simx printers, so just use LanguageLevel 1
-# all the time.
-#
+GSOPT=('-sDEVICE='$GSDEVICE '-sOutputFile='^$GSTMPFILE -dSAFER -dNOPAUSE \
+	-dQUIET -dBATCH -dNOPAUSE)
 
-#if(~ $dev pswrite && ~ $LPCLASS *hp4simx*)
-#	GSOPT=($GSOPT '-dLanguageLevel=1')
-if(~ $GSDEVICE pswrite)
+# ps level 1 is extremely verbose and tends to run our
+# printers out of memory when printing images.
+if(~ $GSDEVICE pswrite && ~ $LPCLASS *post2*)
+	GSOPT=($GSOPT '-dLanguageLevel=2')
+if not if(~ $GSDEVICE pswrite)
 	GSOPT=($GSOPT '-dLanguageLevel=1')
 
 if(~ $OLIST '')

+ 5 - 0
sys/src/cmd/ip/ipconfig/main.c

@@ -27,6 +27,7 @@ enum
 	Vloopback,
 	Vtorus,
 	Vtree,
+	Vpkt,
 };
 
 enum
@@ -170,6 +171,7 @@ char *verbs[] = {
 [Vra6]		"ra6",
 [Vtorus]	"torus",
 [Vtree]		"tree",
+[Vpkt]		"pkt",
 };
 
 void	adddefroute(char*, uchar*);
@@ -408,6 +410,7 @@ parseargs(int argc, char **argv)
 		case Vloopback:
 		case Vtorus:
 		case Vtree:
+		case Vpkt:
 			conf.type = *argv++;
 			argc--;
 			if(argc > 0){
@@ -429,6 +432,7 @@ parseargs(int argc, char **argv)
 		case Vloopback:
 		case Vtorus:
 		case Vtree:
+		case Vpkt:
 			sysfatal("medium %s already specified", conf.type);
 		case Vadd:
 		case Vremove:
@@ -718,6 +722,7 @@ adddefroute(char *mpoint, uchar *gaddr)
 	cfd = open(buf, ORDWR);
 	if(cfd < 0)
 		return;
+
 	if(isv4(gaddr))
 		fprint(cfd, "add 0 0 %I", gaddr);
 	else