Subject: Installation, checklist, ala', AHJ
To: None <port-pmax@NetBSD.ORG>
From: Arne H. Juul <arnej@pvv.unit.no>
List: port-pmax
Date: 02/22/1996 07:16:51
Many people have had problems installing NetBSD/pmax.  The following
procedure isn't the official way to do it, and it's probably not the best
way either.  However, this is the way I used tonight (Thu Feb 22 07:15:26
MET 1996) when I did it on an Ultrix machine, and it worked for me!

I've tried to include all the commands I used verbatim and the relevant
information needed so others can use this as a guide.  If you try this
procedure and it doesn't work, please send a problem report to the list
port-pmax@NetBSD.ORG or directly to me.  I'll try to deal with your
problem, but probably not immediately.  Please be patient!

  -  Arne H. Juul

================================================
NetBSD installation procedure used by Arne H. J.
================================================

  YOU NEED:

A DECstation. I've done most of my work on a 3100.

Ultrix installed on the machine.  If you don't have ultrix you will
need to tell us what you've got and maybe someone can help you, but this
checklist assumes ultrix.

Two disks - one for running Ultrix, one for installing NetBSD on.
These instructions assume that the disk you're going to install
NetBSD on is rz2, substitute your own disk number.
Warning: The disk WILL BE COMPLETELY ERASED!

Another machine on the net where you can put the tar files and
either NFS export the disk (preferred) or make an .rhosts files for
rcp-ing.

The ultrix version of the disklabel program, from:
	ftp.unit.no:/pub/NetBSD/arch/pmax/tools/disklabel.tar.gz
The boot blocks, from:
	ftp.unit.no:/pub/NetBSD/arch/pmax/tools/rzboot  and  .../bootrz
The miniroot image, from:
	ftp.unit.no:/pub/NetBSD/arch/pmax/miniroot-1.1+tar+gzip+mount_ffs.gz
The binary files, from:
	ftp.unit.no:/pub/NetBSD/NetBSD-1.1/pmax/binary/*
	
All of these are available from ftp.netbsd.org and/or
gregorio.stanford.edu as well, and you can use the newer snapshot binaries
from gregorio that Jonathan makes instead of 1.1 if you want to.


   YOU DO:

-* 0 *-
   Zero out any old Ultrix partitioning information and/or bootblocks
from the disk, by doing:
   dd if=miniroot-1.1+tar+gzip+mount_ffs of=/dev/rrz2c bs=512 count=64

After this, using `chpt -q /dev/rrz2c' should complain:
"No partition table found in superblock...
 using default table from device driver."
while `disklabel -r rz2' should give just "no disklabel".



-* 1 *-
   Make a disklabel (partition table) for the target disk.

a) You need to know the disk geometry (well, you can cheat, but
   preferably it should be the "correct" geometry).
You can run the following ultrix program:

#include <sys/devio.h>
#include <sys/ioctl.h>

main(){
  DEVGEOMST g;
  ioctl(0, DEVGETGEOM, &g);
  printf("size %d:  sec/trk %d, trk/cyl %d, cyl %d  (attr %d)\n",
         g.geom_info.dev_size,
         g.geom_info.nsectors,
         g.geom_info.ntracks,
         g.geom_info.ncylinders,
         g.geom_info.attributes);
}

   Like this:
lise1:/tmp# ./a.out < /dev/rrz2a
size 832527:  sec/trk 62, trk/cyl 9, cyl 1481  (attr 0)

b) Make a disklabel file.
   The easiest way to use the disklabel program is to start with
a disk label for some disk and then modify it to suit.  I wanted to
install on rz2 which is really a rz25 or rz26 disk, and here's what
I ended up with:

# /dev/rrz2c:
type: SCSI
disk: rz25
label: 
flags:
bytes/sector: 512
sectors/track: 62
tracks/cylinder: 9
sectors/cylinder: 558
cylinders: 1492
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

4 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:    72540        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 129)
  b:     5580    72540      swap                        # (Cyl.  130 - 139)
  c:   832527        0    unused     1024  8192         # (Cyl.    0 - 1491*)
  d:   754407    78120    4.2BSD     1024  8192    16   # (Cyl.  140 - 1491*)

   You can start with this, or the 'sample' from disklabel.tar.gz. You
should modify these fields: sectors/track, tracks/cylinder,
sectors/cylinder, cylinders, and all the partitions of course.  You may
also update the 'disk' field as you wish.

Here I've used a=root, b=swap, d=/usr.  You're free to use d-h for whatever
you want of course, and many people prefer to have g=/usr, but if you
know what you want you probably also understand how to get it.  Rembember
to increase from '4 partitions' to '8 partitions' in the file if you'll use
more than a-d though (this has bitten me more than once).

   Note that the sizes and offset should be whole multiples of cylinders,
like here.  I'll assume from now that you've saved your disklabel file 
as "rz2.ok" (feel free to use a more original name if you want though :-)


-* 2 *-
   Label the disk.

   Under ultrix, using the ultrix version of the 'disklabel' program.
The command should probably look like this:

./disklabel -R -r rz2 rz2.ok

[This means: -R = restore from file, -r = raw device write,
 rz2 = /dev/rrz2c = the disk,  rz2.ok = the file name with the saved label.]

It may complain that your partitions are outside the disk, the math
is wrong, or fields are missing, but hopefully this will be easy to
understand and fix.  To check that it understood you OK, do

./disklabel -r rz2

and inspect the output carefully.



-* 3 *-
   Write the bootblocks.
   Again under ultrix, using the ultrix version of the
'disklabel' program.  The command should probably look like this:

./disklabel -B -r -b ./rzboot -s ./bootrz rz2

-* 4 *-
   Make a 'swapped' label.

   Copy the label file to a new name:
cp rz2.ok rz2.swp
   And edit the new file to swap the names of the 'a' and 'd' partitions.
The last 5 lines in my case then looked like:

#        size   offset    fstype   [fsize bsize   cpg]
  d:    72540        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 129)
  b:     5580    72540      swap                        # (Cyl.  130 - 139)
  c:   832527        0    unused     1024  8192         # (Cyl.    0 - 1491*)
  a:   754407    78120    4.2BSD     1024  8192    16   # (Cyl.  140 - 1491*)

   Then write the new label:
./disklabel -R -r rz2 rz2.swp

   This is so we can have a temporary small root file system on the
going-to-be /usr partition.

-* 5 *-
   Write the miniroot to disk.

   You need to write this into what's now the 'a' partition but actually
starts somewhere on the middle of the disk.  You can use the offset
from the disklabel, so with the disklabel shown above that would be:

dd if=miniroot-1.1+tar+gzip+mount_ffs of=/dev/rz2c bs=512 seek=78120

-* 6 *-
   Boot the new miniroot.

   Halt ultrix then either
boot -f rz(0,2,0)netbsd
   or
boot 3/rz2/netbsd
   (or something like that, depending on your machine type).
   If this works, the rest should be easy :-)
   You should get question about `Root device': answer rz2, and
then `press Return for /bin/sh'.

-* 7 *-
   Make a new root file system.

   The one you've booted from now is temporary, the real one is now
named 'd' (rz2d in my case).  So,
   newfs /dev/rrz2d
   mount /dev/rz2d /a

-* 8 *-
   Transfer the files to the "real" root file system.

   I used this command:

(cd /; tar clf - .) | (cd /a; tar -xvBpf -)

   [I used this now the last time; I vote we drop pax.]
Afterwards do:

umount /a
sync

-* 9 *-
   Bring the machine up in ultrix again.  There's no 'halt' on the
miniroot so... use the switch.  [The miniroot should have halt and reboot.]

-* 10 *-
   disklabel with the non-swapped label again like in 2.

./disklabel -R -r rz2 rz2.ok
   Halt ultrix and boot NetBSD again, this time with the right (and
   much bigger) root partition.

boot -f rz(0,2,0)netbsd

-* 11 *-
   Get the right file systems.

   First mount the new root partition read-write:
mount -u /dev/rz2a /
   Then make a new /usr file system and mount that:
newfs /dev/rrz2d
mount /dev/rz2d /usr

-* 12 *-

   Get the binary files (tarballs). 1.1 has:

base.tar.gz etc.tar.gz comp.tar.gz games.tar.gz misc.tar.gz
man.tar.gz text.tar.gz

You'll need to use rcp or NFS mount to get them.  If rcp, first
make some directory (like /usr/tmp) and go there.

Anyway, you will need to configure the network:

ifconfig le0 inet 192.0.0.33 netmask 0xffffff80 
route add default 192.0.0.1

(insert the right numbers yourself). 

For NFS, you should probably mount like this:

mount -o -P 192.0.0.10:/netbsd/disk /a

(insert the correct ip address and file system of your NFS server).

[Why isn't -P (privileged port) default?  It's annoying to have to say it
 explicitly all the time.]

For rcp, you'll have to make a .rhosts file with 'my.netbsd.machine root' in,
then just rcp 192.0.0.10:/netbsd/disk/*.tar.gz /usr/tmp

-* 13 *-
   Unpack the tar files.

   I used this command:

for x in *.tar.gz; do (cd /; gzip -d | tar --unlink -xvBpf -) < $x; done

-* 14 *-
   You should now have a complete NetBSD installation.  Here are some
things to be aware of:
   a) /etc/fstab will need editing.  [This file as distributed should
probably be renamed /etc/fstab.rz0 ?]
   b) /usr/include -- some files are wrong in the 1.1 "binary" release.
This doesn't matter until you start compiling things of course, and then
you'll probably want to get the full sources and reinstall the includes
anyway.
   c) strip -- the included strip in the 1.1 "binary" release is GNU
strip, which doesn't cooperate with NetBSD's install program.  There's
a patch for "install" you can use, or you can use the 'elf2elf' strip
program instead.
   d) if you haven't used NetBSD before: there are lots of configuration
files in /etc (like /etc/myname, /etc/mygate, /etc/hostname.le0,
/etc/netstart, and so on) you will need to look at and probably modify.