Subject: install.sh
To: None <pk@NetBSD.ORG>
From: matthew green <mrg@eterna.com.au>
List: port-sparc
Date: 11/15/1995 00:29:46
hmm...

here's a list of the problems i had trying to use a nfs install with
netbooting.

a) my nfs/boot server was another netbsd/sparc machine.  the INSTALL.sparc
has this in it:

        Since the current NetBSD/sparc installation program uses
        a diskless setup for your workstation, you will already
        have prepared an NFS directory for use as a remote
        root filesystem (see the `install' document for details).
 
 o  i hadn't prepared an NFS directory.  what `install' document is this
    talking about ?

and then later on:

	First, you must setup a diskless client configuration on a server. Consult
	your server installation documents on how to proceed with this.
	Put all the *.tar.gz files you want to install into the root directory
	for your client on the server.

`server installation documents' ?  because i'm Smart (tm), i was able
to work out what to do here, but, it would be nice if we could meantion
how this is done if the install server is NetBSD...even just stating
that it's all in diskless(8) (which i found -after- i got it working).

also:  the INSTALL.sparc tells you to unpack the "base.tar.gz" set
in to the client's root directory tree, but, it fails to tell you to
also unpack the etc.tar.gz set -- which contains useful things like
/etc/group and /etc/services that the install uses later one (ftp
installs use `ftp/tcp' from services and MAKEDEV needs /etc/group).

i didn't actually do this as it wasn't until after i finished the
install that i realised that this is what was missing.



b) the boot program wasn't able to do diskless booting.  i had a chat
to theo about this on irc and he suggested this change to promdev.c
which fixes the problem:

Index: promdev.c
===================================================================
RCS file: /local/cvs/src/sys/arch/sparc/stand/promdev.c,v
retrieving revision 1.1.1.7
diff -c -r1.1.1.7 promdev.c
*** promdev.c	1995/10/17 11:18:14	1.1.1.7
- --- promdev.c	1995/11/14 10:45:27
***************
*** 503,509 ****
  			} while (--len > 0);
  		}
  		bcopy(sun4_idprom.id_ether, ea, 6);
! 	} else if (promvec->pv_romvec_vers < 2) {
  		(void)(*promvec->pv_enaddr)(fd, (char *)ea);
  	} else {
  		char buf[64];
- --- 503,509 ----
  			} while (--len > 0);
  		}
  		bcopy(sun4_idprom.id_ether, ea, 6);
! 	} else if (promvec->pv_romvec_vers <= 2) {
  		(void)(*promvec->pv_enaddr)(fd, (char *)ea);
  	} else {
  		char buf[64];


the problem that i was seeing was:

it had just finished loading the boot program, and then it printed
"mac-address ?" and hung.  this was the prom not understanding the
"mac-address" command and losing...

my hardware is:  sparc elc, rom rev. 2.4.



c) i got beyond that and boot tried to load the kernel, etc... i got
this from it initially:

root addr=<splode> path=/export/root/rupture
Can't open network device `/sbus/le@0,c00000'
open: netbsd: Unknown error: code -1
device[/sbus/le@0,c00000]:

this was caused by bogus export permissions on `splode' and other
related NFS lossage (*).   the error message is...less than informative.



d) the install script itself..  once i got all the other parts working,
i ran the install script.  this was the most robust part of the whole
install -- which isn't really saying all that much  :-(

the script lost when i broke my disklabel.
the script lost when i broke my fstab.
the script asked me if i wanted to configure anymore network devices
  even though i had done all of them and it had presented me with an
  empty list on them.
disklabel(8) is a crock  ;-(  it took me about 5 runs through the
  script before i got the disk partitioned how i wanted... there was
  very little help in the script itself about what i should use here.
  oh well.  this isn't a problem easily fixed  :-(
when i was extracting the sets over nfs, it just prompted me with:
  "File: []".  there was no list of the sets available!  i had to go
  back to the server and look at the files and then remember which
  ones i had extracted...
also, i had to go through the "nfs, <server>, <path>, <dir>, <file>"
  questions for *every* set i wanted to extract... which, from my
  quick look at the script meant that the remote FS was mounted every
  time through here.. seems a little silly.
the timezone query code only lists the first level of the Country/Area
  TZ codes -- my code is Australia/Victoria, but, unless i knew that, i
  would have been unable to do much cuz all i could get form it was that
  Australia was a valid TZ code -- indeed, this would be incorrect as
  Australia is *not* a valid TZ code.  perhaps something like the
  Solaris method could be used here ...
  but at least this section *did* tell you some of your options  :-)

there were more problems but i don't seem to remember anymore.


over all, i was kinda disappointed because it took so long to do..but
in reality, most of these problems were caused by `other' things that,
while being nessicary to the install, are not `part' of the install
process.  install.sh is useful  :-)

blah...this is longer than i intended...

.mrg.

(*) there is a patch in PR#1722 that i think is *REALLY*
important here. i was _NOT_ able export the filesystems i
wanted to without applying this patch to sbin/mountd/mountd.c
-- mountd would just complain that it was not able to change
attributes.

here's what the patch looks like:

Index: mountd.c
===================================================================
RCS file: /local/cvs/src/sbin/mountd/mountd.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** mountd.c	1995/11/14 12:43:16	1.1.1.1
- --- mountd.c	1995/11/14 12:46:26	1.2
***************
*** 653,658 ****
- --- 653,659 ----
  		    !strncmp(fsp->f_fstypename, MOUNT_MSDOS, MFSNAMELEN) ||
  		    !strncmp(fsp->f_fstypename, MOUNT_ADOSFS, MFSNAMELEN) ||
  		    !strncmp(fsp->f_fstypename, MOUNT_CD9660, MFSNAMELEN)) {
+ 			bzero((char *)&targs, sizeof(targs));
  			targs.ua.fspec = NULL;
  			targs.ua.export.ex_flags = MNT_DELEXPORT;
  			if (mount(fsp->f_fstypename, fsp->f_mntonname,

------- End of Unsent Draft