SUMMARY: SunOS 4.1.1 and X11R4

Mike Anderson mea at sparta.com
Wed Jan 2 06:02:05 AEST 1991


I posted to the net some preliminary findings about SunOS 4.1.1,
OpenWindows and X11R4 coexistence and said that I'd reply to folks that
requested the mods.  I was overwhelmed with requests for the procedures
and so I guess that I'd better summarize to the net before my mailbox
fills the disk.

My Configuration:

I'm running a SparcStation 1+ (4/65) color machine (CG6) with a Fujitsu
2266S/H (1 GB) and a CDC Wren IV (327 MB) hard disks.  I also have an
Exabyte and an Archive Viper (Sun's 150MB Tape) attached to the system all
via SCSI.  The O/S is SunOS 4.1.1 Sun-4c SUNBIN and OpenWindows Version 2.
SunOS 4.1.1 has a funny thing about sd0 and sd1 being assumed to be
internal to the 4/65 (i.e., the miniroot won't boot from external drives
if they're configured as sd0 or sd1) so with the default EEPROM setting of
the 4/65 my boot disk (the Fujitsu) had to be set for SCSI ID 0 (sd3).
Then you change the "boot-from" parameter in the EEPROMs to be
"sd(0,3,0)vmunix".  The Wren IV was set to SCSI ID 2 (sd2).  The 150 MB
was set to SCSI ID 4 (st0) and the Exabyte was SCSI ID 5 (st1).

Getting Started:

IMPORTANT: Get a copy of /usr/include/sundev/cg6reg.h from somewhere and
save it to tape or on another machine.  X11R4 needs this file and 4.1.1
for Sun 4C and Sun 3X no longer includes it for some reason.  Can anyone
post this file legally?

With 4.1.1, when you boot from the tape it automatically boots MUNIX into
RAM (i.e., no more "b st()install sd(0,3,1)") and searches for disks.  If
it finds your disks, you'll have the option of formatting and labeling the
disks.  I would recommend that you do this at this time.  I'm not sure if
its required, but I had a hell of time with the disks until I did.  A Sun
tech-type also told me to label the disks both in the "partition"
subfunction and in the "label" subfunction (a bit of voodoo no doubt).  Be
aware that if you do a complete install of 4.1.1 (minus the Versatec and
Security stuff) with OpenWindows and expect to install X11R4 later, you'll
need at least 150MB free on the /usr partition.

Install the miniroot and boot from the just installed miniroot.

Run suninstall and do whatever is appropriate for your facility as far as
the host info, the disk partitioning (keeping in mind the size required
for /usr mentioned previously), clients, etc. and start the installation.

Go get lunch.  Come back, plug in tape #2 and go to lunch again.

Reboot the newly installed O/S (you did remember to change the "boot-from"
parameter in the EEPROMs didn't you?) and congrats you have 4.1.1 and
OpenWindows V2 installed.  You can tell you have 4.1.1 installed by
bringing up suntools (all of the tools will be sickly pastel colors).

Installing X11R4:

I started with the straight X11R4 distribution as downloaded from
prep.ai.mit.edu and unloaded it in my /usr6/X11R4/src directory (your
directory structure will obviously be different).  I went into the
/usr6/X11R4/src/mit/config directory and hacked imake's Makefile (usually
"Makefile") changing the USRLIBDIR entry to be:

    USRLIBDIR = $(DESTDIR)/usr/lib/X11

and made sure the Project.tmpl LibDir entry read:

    #define LibDir $(USRLIBDIR)/X11

I also changed the Imake.tmpl line ExtraLoadFlags to read:

    #define ExtraLoadFlags -L/usr/lib/X11 /* include X11R4 libraries */

and changed my site.def file line #define CompatibilityFlags to be

    #define CompatibilityFlags -DXAW_BC  /* add XAW support stuff */

(I found that Xtetris 2.x needed this flag turned on).

Now edit the site.def and the rest of the tmpls as needed by your site.
(I have /usr/lib/X11 where all of my X11R4 libs are stashed and
/usr/bin/X11 where the binaries are stashed and /usr/include/X11 for my
include files). 

Make the Imake (just "make" in the config directory) and then a "make
install" to install the Imake in /usr/bin/X11.  (Make sure that it really
installs in /usr/bin/X11.  My first try installed Imake as the FILE
/usr/bin/X11 instead of in the directory /usr/bin/X11.  I had this happen
to me a couple of times running the installation scripts from a "make
install" command so watch out.)

Get a copy of /usr/include/sundev/cg6reg.h from somewhere and copy it to
/usr/include/sundev/cg6reg.h on your machine.  SunOS 4.1.1 for Sun 4C and
for Sun 3X no longer include this file and X11R4 needs to have it.  (You
did remember to save it didn't you?)

Cd to mit (cd ..) and do a make World.  Go to dinner or come back in the
morning (about 2-3 hours).  

Do a "make install" and watch that it installs O.K.

Type "ldconfig" and now X11R4 should be able to run (make sure you add
/usr/bin/X11 to your path) by cding to /usr/bin/X11, making a link between
Xsun and X, and typing "xinit".  If you get funny messages about
OpenWindows problems, mv your ~/.xinitrc file to something else and try
again.

OpenWindows Support:

I have found that OpenWindows and X11R4 have a few files in common (e.g.
.xinitrc) so you can either run one or the other but not both
simultaneously (although you can run X11R4 APPLICATIONS under
OpenWindows).  You need to add a few lines to your .cshrc to support
OpenWindows and make sure that any X11R4 applications will run properly.
These lines are:

    setenv OPENWINHOME /usr/openwin
    setenv LD_LIBRARY_PATH /usr/openwin/lib:/usr/lib/X11

and I would suggest the following ordering in your PATH variable:

    set path=( $home        \
               /usr/openwin/bin \
               /usr/openwin/demo \
               /usr/openwin/demo/xview \
               /usr/bin/X11 \
               $path        \
             )

Conclusions and disclaimers:

With this set up I've been able to run both X11R4 and OpenWindows
applications simultaneously.  I haven't tried using Motif yet but I will
in the not too distant future.  

I am not a Sun demiGod nor even a guru.  I did a lot of stumbling around
before I finally got something working.  If there is someone out there
that sees something that I did wrong (especially in the Imake Makefile
mods or the Imake and Project template mods) please enlighten us all.
These mods worked for ME with MY configuration.  Your milage may vary, but
at least you should be able to get the gist of it.  Most of this stuff
simply took the defaults and tweeked them slightly to achieve the desired
results.

My primary operating environment is now OpenWindows (hence the ordering of
the OpenWindows stuff before the X11R4 stuff) using all of the OpenWindows
libraries where supplied.  I found that many applications looked for the
Xaw and Xmu wiget libraries and this configuration enabled me to get at
them while keeping the libraries common to the two windowing systems
separate.  (Make sure to turn on these widget sets in your site.def before
the X11R4 make).

Mike Anderson        "It is useless for sheep to pass resolutions in favor
SPARTA, Inc.          of vegetarianism while wolves remain of a different
mea at sparta.com        opinion."
(703) 448-0210                     William R. Inge, D.D.  1860-1954



More information about the Comp.sys.sun mailing list