Subject: Re: Suggestions for easing 1.1 i386 installations
To: quantum <brettw@io.com>
From: Simon J. Gerraty <sjg@zen.void.oz.au>
List: port-i386
Date: 10/09/1995 17:45:09
> released.  We need an improved install facility.  But, I don't want one
> that is i386 centric.  I run NetBSD on a PC clone, but also on an Amiga.
> NetBSD is a multi-platform OS.  It seems to me that in spite of that, the
> install could be fairly generic, once specific hardware was configured.
> Maybe an install script could run a platform specific install script followed
> by a generic install script.  Does this sound feasible to anyone else?

The constraint is what you can fit on the install floppies... but
otherwise what you ask can be done quite easily.  You just need a
framework. 

As it happens, I'm giving a talk tomorrow night at a local SAGE
meeting about a host config tool that handles multiple operating
systems, releases and hardware types... while perhaps over-kill for a
NetBSD install facility, the basic engine could be the same.

Basically config.sh processes config.d/S* (yes you guessed config.sh
is just a link to etc/rc.sh :-)

Scripts in config.d handle installing files, removing files setting
permissions etc etc (this is for host config reproduction remember).
In each case a host/os/release specific list of directories are
searched for various lists of files to install/remove as well as for
the files themselves.

Anyway, one of the scripts in config.d searches $DIR_LIST for other
config.d's and processes them too.  The DIR_LIST is constructed in
order of most specific to least specific, so you could easily process
all the hardware specific stuff before doing the machine independent
stuff.

For instance given:

OS=`uname -s`
OSREL=`uname -r`
OSMAJOR=`IFS=.; set -- $OSREL; echo $1`
MACHINE=`uname -m`

config_setup.sh looks for the following directories and adds them to
DIR_LIST if found:

$CONFIGS/$SITE/$HOST
$CONFIGS/$SITE/$OS/$OSREL/$MACHINE
$CONFIGS/$SITE/$OS/$OSREL
$CONFIGS/$SITE/$OS/$OSMAJOR.X/$MACHINE
$CONFIGS/$SITE/$OS/$OSMAJOR.X
$CONFIGS/$SITE/$OS/$MACHINE
$CONFIGS/$SITE/$OS
$CONFIGS/$OS/$OSREL/$MACHINE
$CONFIGS/$OS/$OSREL
$CONFIGS/$OS/$OSMAJOR.X/$MACHINE
$CONFIGS/$OS/$OSMAJOR.X
$CONFIGS/$OS/$MACHINE
$CONFIGS/$OS
$CONFIGS/$SITE
$CONFIGS

CONFIGS is normally the directory containing config.sh, and SITE can
be set to some site specific path to allow some extra flexibility.

At any such level, you might have a config.d directory which would be
processed.   Eg you could have;

NetBSD/1.1/i386/config.d
NetBSD/1.1/sparc/config.d
NetBSD/1.1/config.d
NetBSD/1.0/config.d
NetBSD/config.d
config.d

Like I said, over-kill for a single OS single release install
facility, but as you can see you can get very flexible...

--sjg