[comp.sys.sun] What's magic about "setup"

joe@uunet.uu.net (Joe Michel-Angelo) (12/30/88)

by geaclib!lethe!dave@uunet.uu.net:
> What is magic about the construction of the sun root filesystem?  Two
> different individuals here in Tranna have had the doubtful pleasure of
> building root filesystem with mkfs (or newfs), populating it with restore
> or tar and having the system hang somewhere in the booting sequence.  Who
> can tell me what "setup" knows that I don't?

"setup"'s only magic in 3.X is that it can partition the disk for you
(actually, it can make drive lables...). 

When rebuilding production 3/260's, I simply partition the disk via diag
and then make the machine a network client using a kernel w/ root on nd
(config root on nd swap on nd) ... the kernel also contains the xy and xt
drivers controller info. Once booted, it's a simple matter of "MAKEDEV
xy0" and loading a root, pub, and user dump tape (ps: dump/restore is a
better choice in this matter) and then install a boot block on xy0a.  (cd
/usr/mdec; installboot ...)

Restoring nd parts. is another matter. You can restore each individually
(then edit /nd/etc/rc.boot to change hostname=) or do your initial restore
as a dd of xy0c from your master copy host. (dd will copy drive lables
.... probably a good idea to have the same type drives on on both
machines...)

All a root partition needs is:

	boot block
	/boot
	/vmunix
	/etc/init
	/bin/sh  --> /pub/bin/sh

	maybe a few dirs as well...

Hey! Me think me know what your problem is....

Me thinks that when you installed / with tar, you also have /pub mounted.
In this case, /pub files will be placed in the /pub partition. 

When booting, /pub isn't initially mounted and because of your restore
method, the /pub on xy0a contains no files.... /pub should contain a
"basic set" of programs since /bin is linked to /pub and when booting,
/bin/sh is very required. This is easily overlooked...

Try using dump/restore to restore your root and install the boot block...
-- 
	Joe Angelo -- Senior Systems Engineer/Systems Manager
	Teknekron Software Systems, Palo Alto 415-325-1025
	joe@tss.com - uunet!tekbspa!joe - tekbspa!joe@uunet.uu.net

pease@sun.com (Roger Pease) (01/18/89)

We are Sun's second largest OEM, and we ship turn key networks to our
customers.  We install a LOT of SunOS, so we decided to Re-invent the
setup wheel and replace it with some scripts of our own.  We did this
because we did not need all the flexablity of setup and because we wanted
to install the OS over the network from a disk drive (and also to move all
the config tech's interaction to the beginning of the process, so that he
can start it and walk away).

So we did some extensive fooling around with setup.  In the process of all
this I managed to get in touch with the guys in the CIM group at Sun.
These guys implemented what Sun calls the ATS (Automated Test System),
whereby SunOS is down loaded over the net and then booted up in order to
burn it in in Manufacturing.  They were kind enough to give me a copy of
the script they use to do this.  They just set up a "standalone" system.
(Supposedly, they just remove /boot and /vmunix when the system has passed
and is ready to ship.  But I have never bothered to check this out...)
They create a master image of each filesystem on the the server for each
partition.  Then the whole thing gets dd'd (root, too) from the server.

ANYWAY, I think I am safe in saying that setup does nothing magic.  It can
write disk labels from UNIX, though I don't think you'd call that magic...

Try this: take a system you're installing SunOS on, run setup, but when
you're done, DON'T REBOOT, instead select Quit.  Then have a look around
especially in the /etc/install directory.  Notice that /dev/xy0a (or
/dev/sd0a) is mounted on /setup.root.  It's kind of fun actually...  Since
tar works, you can save these scripts for later examination.

If you look at the scripts in the install directory, you'll notice that
setup just tar's in the whole filesystems, then goes into root and sets
the hostname in /etc/rc.boot and /etc/hosts.  If there are diskless
clients, it gets more complicated than that (mmmmm, love that ND!), of
course.

Anyway we got the whole thing working w/o setup and then we decided to
start shipping SunOS 4.0.  It has suninstall instead of setup.  Suninstall
is itself a script.  You can see how much was carried over from the setup
scripts...

Have fun...

	Roger Pease
	Valid Logic Systems, Inc.
	2820 Orchard Parkway
	San Jose CA 95134
	(408) 432-9400