Subject: Re: standalone programs...
To: Paul Kranenburg <pk@cs.few.eur.nl>
From: Head Anarchy Conquest Knight Esquire of the Realm <jgraham@defender.VAS.viewlogic.com>
List: port-sparc
Date: 12/11/1995 16:17:35
#define AUTHOR "pk@cs.few.eur.nl (Paul Kranenburg)"

/*
 * > Has anyone made a standalone version of a 'copy' command for the SPARC
 * > port?
 * 
 * Once you know what to copy and where to, it would be trivial make one
 * given the support routines in libsa and sparc/stand.
 * 
 * > My intent is to make a bootable SPARC tape (I'm using a 4mm).
 * > 
 * > ...come to think of it, has anyone made a 'stboot'?  Is this something
 * > that someone would be interested in doing?  Is this something that folks
 * > would be interested in having?
 * 
 * It would be nice to complete the set of supported bootable devices.

Indeed.  I wonder what it would take to make a CD-ROM bootable...

 * 
 * Does anyone remember how Suns (sun3/sun4/sun4c) boot from tape? I guess
 * the PROM loads the first file on hte tape expecting it to be the second
 * stage boot program. This program should then probably copy a miniroot
 * from tape to disk.

The sun3s used to have a tpboot binary which was the first file on the
tape, which the PROM loads as you surmise, and it is indeed a second
stage boot program.  It entered interactive [-a] mode automagically.
The next program was a standalone copy program, which prompted you
for a source file (typically st(0,0,2)) and a destination file
(typically sd(0,0,1)).  The next file was the miniroot, and the
rest of the stuff was a tar extraction.

Continuing onward, I noticed that newfs(8) doesn't create plain files, and
mkproto(8) doesn't exist.  Strictly speaking, these don't need to be
present, but it's a boon if they are around when you don't happen to have
a spare partition to dedicate to hosting a miniroot.

What I used to do to generate a MINIROOT:

	Somewhere, have a MINIROOT directory populated with a hierarchy
	containing the bare minimum of programs needed to get to a miniroot,
	call this /export/MINIROOT.  It was not its own filesystem.

	Find a place with sufficient space, usually /var/tmp, in which
	to make a blank filesystem in user space (yes, mkfs/newfs used to
	do this).  Call it /var/tmp/MINIROOT

	Take the output of 'cd /export/MINIROOT; tar cf - | tar tvf -'
	and massage it to make a proto file.  SunOS mkproto will tell
	you the syntax of a proto file.  Call the proto file MINIROOT.proto.

	Run "mkproto /var/tmp/MINIROOT MINIROOT.proto".  This would
	essentially stuff the contents of /export/MINIROOT into the
	"filesystem" /var/tmp/MINIROOT.

	Move /var/tmp/MINIROOT to /var/tmp/M
	"dd if=/var/tmp/M of=/var/tmp/MINIROOT obs=1k conv=sync"
	Remove /var/tmp/M from disk.  This makes sure that there are no
	"holes" in the filesystem which would otherwise show up as short
	reads (I had used this as a network installation base).  This
	isn't necessary if you're dumping it to tape.

	The rest of the stuff is all (possibly compressed/gzipped) tar
	files.

The thing is, I don't know how long a tape block would have to be; I
think it's 1k when reading from a block device, but I'm not certain.

 * 
 * -pk
 * 
 */

#undef AUTHOR	/* "pk@cs.few.eur.nl (Paul Kranenburg)" */




				--*greywolf;
--
After 5 PM please slip brain through slot in door.