Using SPARCprinter with Ghostscript and Solaris 2.5.1
(if you can't get NeWSprint to work)
John W. Emerson
john.emerson@yale.edu
This document describes steps I used to install a SPARCprinter on a
Solaris 2.5.1 machine. I rely heavily on the documents provided by Jens
Claussen (using Solaris 2.6 with NeWSprint 2.5B and providing the major
Ghostscript-related hints) and Alexander
Panasyuk (focusing on more than just the SPARCprinter and Solaris 2.5.1,
assuming driver integration in Ghostscript, and providing good suggestions
for using filters). This document seeks to synthesize the best of each
of these previous documents, adding instructions necessary if you lost
your NeWSprint CD (or if you can't get it to work with your new OS). Commercial
software is available (from Vividata,
for example), but the cost seems excessive if you can do it yourself for
free.
Disclaimer
I accept no responsibility for anything that happens should you follow
(or not follow) these instructions. Nor should Jens or Alexander
be held responsible for anything that happens because you follow (or do
not follow) their instructions or their instructions which I include here
merely for completeness. Almost everything will require root permission,
though I recommend compiling Ghostscript as a regular user (and then doing
the install as root).
If you have a SPARCprinter, you (at some point in time) must have had
the lpvi driver from your NeWSprint software. You may obtain the updated
lpvi driver from your Sun representative or free from Vividata, I understand:
102211-04.tar.gz
with the header file lpviio.h.
Following the lead of Vividata, I
note that permission is granted from
Sun for non-commercial distribution of this patch. As far as I know,
these are all available directly from Sun
Microsystems or through one of your UNIX support groups.
Requirements (kind of)
-
Hardware: SPARCprinter and LPVI SBUS card (yeah, you're stuck with
and end-of-life product and software that is difficult or impossible to
use with the newer Solaris operating systems)
-
Ghostscript 5.10 (available from Aladdin)
- The
lpvi
driver in patch 102211-04 and the associated
lpviio.h
header file (see disclaimer above).
-
Solaris 2.5.1 on the machine with the SPARCprinter
I only tested this install under the requirements above. I note, however,
that Alexander's page indicates that similar installs are possible using
other printers, and Jens' page indicates that the version of Solaris probably
shouldn't cause any unforseen problems, either. Other versions of Ghostscript
(as far back as 2.53, perhaps) also shouldn't pose a problem. Links to
these pages are provided above.
Instructions
1. Install the lpvi driver. (Make sure you have the
patched version -- see above.) These instructions are modified from
the ones available from
Vividata, which I found to be incomplete.
-
Copy lpvi into /kernel/drv
-
Add the following line to the end of /etc/devlink.tab
type=ddi_pseudo;name=SUNW,lpvi \M0
where the space before the \M0 is a single tab.
-
Add the driver to the kernel:
/usr/sbin/add_drv -i 'SUNW,lpvi' lpvi
-
Add the following line in the forceload section of /etc/system.
There is no / before the drv/lpvi, yes really.
-
See if /reconfigure exists. If it doesn't, then do
and then reboot the machine. You could also boot -r.
-
Once the system comes back up, make sure:
-
The command
returns something like
24 f5b0d000 7100 8 1
lpvi (SPARCprinter driver v1.75)
-
The device link /dev/lpvi0 exists and you should chmod 666
/dev/lpvi0. Jens' recommends the use of NeWSprint's add_np_driver
command, which (in theory) would automatically do the steps listed above.
2. Compile the SPARCprinter driver into Ghostscript.
I found Jen's
instructions to be very helpful, and so I provide minimalist notes
here. I used gcc and GNU make. I strongly
recommend that you read make.txt, install.txt, and possibly
use.txt if you are not completely comfortable with compiling and
using Ghostscript fron scratch.
-
Add sparc.dev to the DEVICE_DEVS macro of the appropriate
makefile (I used gcc-head.mak). Also edit the file to fit
the needs of your installation, as described in make.txt and install.txt
of Ghostscript. Then run tar_cat. It is important
that you keep track of the install paths, particularly for the fonts.
-
Make a link or simply place a copy of lpviio.h in the Ghostscript
directory (which is some path.../gs5.10 probably).
-
Edit gdevsppr.c so the include near the top finds the lpviio.h
file -- I found that using the absolute pathname was easier than worrying
about paths:
#include "(put the absolute path here)/gs5.10/lpviio.h"
-
[optional] Edit the error messages to be more descriptive: see Jens' page
for details or an actual edited copy of gdevsppr.c.
-
Compile Ghostscript! ln -s gcc-head.mak makefile and make
were sufficient for me. Then make install should complete
the install.
3. Manually print a postscript file to see if you are in business
so far... I found the following to work for me, a happy medium
between the suggestions of Jens and Alexander:
./gs -dNOPAUSE -dBATCH -dSAFER -r400 -sDEVICE=sparc
-sOutputFile=/dev/lpvi0 filename.ps
I broke this line to make it easier to read. There is also a -dPAPERSIZE
option, for those of you who use a4 paper, for example. Other options
(like -dFIXEDMEDIA, for example) are described in Ghostscript's
use.txt. After everything is working, you will probably
want to add the -q option to block out the Ghostscript messages
produced during the file processing.
4. Set up the Solaris print services.
I had to do some work here, synthesizing from Jens and Alexander only seemed
to allow me to print postscript as well as simple ASCII text files. This
could have been my fault, obviously, but here is what worked for me.
-
Create the following filter description file and put it into /etc/lp/fd.
I called mine sparc.fd. Make sure you set the permissions
to match the other files in the directory.
Input types: any
Output types: postscript
Printer types: PS
Printers: any
Filter type: fast
Command: /usr/local/bin/gs -dNOPAUSE -dBATCH -dSAFER -r400
-sDEVICE=sparc -sOutputFile=/dev/lpvi0 -
I broke this Command: line to make it easier to read; you should let the
line wrap when you type it.
-
/usr/sbin/lpfilter -f sparcio -F /etc/lp/fd/sparc.fd
-
/usr/sbin/lpadmin -p sparcprinter -v /dev/null -I postscript
-
enable sparcprinter
-
accept sparcprinter
-
These steps should create a standard filter in /etc/lp/interfaces
called sparcprinter. You have to edit this file, around line 855, immediately after the comment ## Print some copies of the file(s), adding the line
FILTER='/usr/local/bin/gs -dNOPAUSE -dBATCH -dSAFER -r400
-sDEVICE=sparc -sOutputFile=/dev/lpvi0 -'
I broke this into two lines just to make it easier for you to read.
Note that after everything is working, you will probably want to add the
-q option here and in the command above in /etc/lp/fd/sparc.fd,
after which you should re-run the lpfilter command.
- I recognize that the use of the gs command twice seems a bit odd.
However, the man pages say the command line of the sparc.fd
file is required, and nothing worked without the line inserted in the
interface script. Go figure.
5. I think that is it!!! The lpr -Psparcprinter
<filename> command should now work, as well as printing from Netscape,
etc... If you have questions, comments, corrections, or if it
doesn't work (or if it does) please feel free to email me, at john.emerson@yale.edu.
This file was originally created on August 2, 1998. I will list any modification
dates below -- there are none yet.