Subject: Need proofreaders for updated installation instructions
To: None <port-sparc@netbsd.org>
From: Michael Wolfson <mw@costello.cnf.cornell.edu>
List: port-sparc
Date: 10/19/2000 14:03:56
Howdy,

Could a few people who have just installed NetBSD take a look over these
revised installation instructions and let me know if there's anything
wrong, or if they have any suggestions?

Thanks!

  -- MW

   Preparing your System for NetBSD installation

     Before you start you might need to consider your disk configuration to
     sort out a quirk in SCSI-ID to SD-UNIT mapping that exists on Sun Sparc-
     stations.

     Upon leaving the factory, SunOS and the OpenBOOT ROM map according to
     this table:

           SCSI-ID    SunOS SD-Unit
              0          sd3
              1          sd1
              2          sd2
              3          sd0
              4          sd4
              5          sd5
              6          sd6

     Unlike SunOS and the OpenBOOT ROM, a generic NetBSD kernel numbers scsi
     drives sequentially as it finds them.  The drive with the lowest scsi-id
     will be called sd0, the next one sd1, etc.

     To ease the installation process, the default NetBSD kernel in the dis-
     tribution is setup to match the Sun mapping above by hard-wiring scsi-
     id#3 to sd0 and scsi-id#0 to sd3. The remaining drives will be dynamical-
     ly mapped to other sd* numbers.

     A truly generic NetBSD kernel is also provided as `/netbsd.GENERIC',
     which will do the standard NetBSD probe ordering. If your configuration
     differs from the default Sun setup, you can try to use this kernel to
     complete the installation.

     Note:  This is also a concern when you start building your own customised
            kernels.

     Your OpenBOOT ROM may need some setup.  make sure you boot from `new com-
     mand mode'.  If your machine comes up and gives you a `>' prompt instead
     of `ok', type:
           > n
           ok setenv sunmon-compat? false
           ok
     This is needed because the NetBSD kernel relies on functionality provided
     by OpenBOOT ROMs -- the ability to pass down Forth commands and have them
     executed in the ROM -- that appears to go away when the OpenBOOT ROM op-
     erates in `old monitor compatibility' mode.

     Also, you cannot use the security modes of the sparc OpenBOOT ROM.
           ok setenv security-mode none

     If you're installing NetBSD/sparc for the first time it's a good idea to
     look at the partition sizes of disk you intend installing NetBSD on.

     Asumming a classic partition scheme with root (`/') and /usr filesystems,
     a comfortable size for the NetBSD root filesystem partition is about 20
     MB; a good initial size for the swap partition is twice the amount of
     physical memory in your machine (though, unlike SunOS 4.x, there are no
     restrictions on the size of the swap partition that would render part of
     your memory unusable). A full binary installation takes about 60 MB in
     `/usr'.

     Some network devices (i.e. the built-in `le' interface on sun4m machines)
     allow a choice between operating on a UTP or a AUI port. The `le' driver
     supports automatic detection of the port which is actually connected to
     the wire. Additionally, some of the Fast ethernet devices (such as `be',
     `hme', `qec', and `qfe') support selection of various speeds and options.
     The default is to attempt to automatically detect the speed.

     If automatic detection is not available or not working properly in your
     environment, you may have to specify the type connection using the `me-
     dia' parameter of ifconfig(8). During installation, you'll get the oppor-
     tunity to specify the appropriate medium. Use ``10base5'' or ``AUI'' to
     select the AUI connector, or ``10baseT'' or ``UTP'' to select the UTP
     connector. Fast ethernet interfaces default to ``auto'', which usually
     does not detect properly and runs at ``10BaseT'' speed.  The options are
     ``10baseT'', ``100baseTX'', and ``auto''.  The hme and qfe interfaces al-
     so allow ``10baseT-FDX'' and ``100baseTX-FDX''.

   Installing the NetBSD System

     Installing NetBSD is a relatively complex process, but if you have this
     document in hand it shouldn't be too much trouble.

     NetBSD/sparc has two installation systems, an easy to use 'sysinst', and
     a more flexible 'miniroot' script based system.

     There are several ways to install NetBSD onto a disk. The easiest way is
     to use the 'syboot.fs' image copied to a floppy, your local disk's swap
     partition, or a scratch drive.  More advanced users may prefer booting
     the NetBSD miniroot from the local disk's swap partition or 'boot.fs'
     from a floppy.  Alternatively, if your sparc is hooked up in a network,
     you may configure another UNIX machine as a netboot server for your
     sparc.

     Installing NetBSD by placing a bootable filesystem on a

     Installing NetBSD by using a bootable CD-ROM

     Installing NetBSD by using the bootable floppy

     Installing NetBSD by using a netboot setup

     Installing NetBSD by placing a bootable filesystem on a partitioned hard
     drive

     The 'syboot.fs' image uses the easier sysinst tool.  The 'miniroot.fs'
     image uses the more flexible miniroot install tool.  You only need to use
     one of these to install NetBSD onto your system.

     syboot.fs and miniroot.fs are self-contained NetBSD filesystems holding
     all utilities necessary to install NetBSD on a local disk. They are dis-
     tributed as a plain files designed to be transferred to a raw disk parti-
     tion from which they can be booted using the appropriate PROM command.
     Usually, this filesystem will be loaded into the swap partition of a
     disk. If needed, you can use any other unused partition on any disk (such
     as a Zip disk).  If you choose to install using the miniroot method, the
     partition you install 'miniroot.fs' onto will be unavailable during the
     installation process.

     Loading the filesystem onto your raw partition is simple. On NetBSD as
     well as SunOS you use a command like:
           # dd if=syboot.fs of=/dev/rsd0b bs=4k conv=sync
     (Here, `/dev/rsd0b' is assumed to be your swap partition.) There's a po-
     tential problem here if /dev/rsd0b is actually in use as a swap partition
     by your currently running system. If you don't have another disk or par-
     tition to spare, you can usually get away with running this command any-
     way after first booting into single-user mode to ensure a quiet system.

     After transferring the filesystem to disk, bring the system down by:
           # halt

     Then boot the installer by typing the appropriate command at the PROM:
           > b sd(,,1)netbsd -s            # for sun4 monitors
           ok boot sd(,,1)netbsd -s        # for version 1 OpenBOOT ROMs
           ok boot disk:b netbsd -s        # for version 2 OpenBOOT ROMs

     If you've loaded the filesystem onto some other disk than `sd0b' adapt
     the boot specifier accordingly, e.g.:
           ok boot disk1:b netbsd -s
     to boot from SCSI disk target 1 from a version 2 OpenBOOT ROM.  If you
     have to use the old-style sd(c,u,p) syntax to boot from a SCSI disk, you
     can calculate the parameters as follows:

     c    specifies the controller number

     u    the hexadecimal number obtained from evaluating the expression `(8 *
          TARGET) + LUN'

     p    the partition number from which to boot (0=`a', 1=`b', etc).

     The monitor boot command will cause the NetBSD kernel contained in the
     filesystem image to be booted. After the initial probe messages you'll be
     asked to start the install or upgrade procedure. Proceed to the section
     Running the installation scripts.  below.

     Installing NetBSD by using a bootable CD-ROM

     If you wish to burn your own CD-R containing a bootable NetBSD installa-
     tion, then you should follow the directions on the NetBSD Bootable CD-ROM
     HOW-TO at:
           http://www.netbsd.org/Documentation/bootcd.html#sparcimage
     Once you have created the disk image, then you need to burn it to a CD-R.
     The CD-ROM attached to your machine must support 512 byte sectors to be
     bootable.  All Sun brand CD-ROMs will work, as well as many other manu-
     facturers.  See the Sun CD-ROM FAQ:
           http://saturn.tlug.org/suncdfaq/

     Sun sets their CD-ROM drives to SCSI ID 5.  We recommend you do the same.

     Boot the installer by typing the appropriate command at the PROM:
           > b sd(,,5)                     # for sun4 monitors
           ok boot sd(,,5)                 # for version 1 OpenBOOT ROMs
           ok boot cdrom                   # for version 2 OpenBOOT ROMs

     After the initial probe messages you'll be asked to start the install or
     upgrade procedure. Proceed to the section Running the installation
     scripts.  below.

     Installing NetBSD by using the bootable floppy

     The NetBSD install floppy works only on the sun4c and sun4m class ma-
     chines.  Making the install floppy is simple:

     The 'syboot.fs' image uses the easier sysinst tool.  The 'boot.fs' image
     uses the more flexible miniroot install tool.  You only need to use one
     of these to install NetBSD onto a floppy.

     On NetBSD as well as SunOS you use the following three commands:
           # fdformat
           # gunzip syboot.fs.gz
           # dd if=syboot.fs of=/dev/rfd0a bs=36k
     (Be sure that the `fdformat' command completes successfully before pro-
     ceeding to the `dd' step; on NetBSD , a string of all `V's, and on SunOS,
     a string of all `.'s.).

     On a Windows system you can use the rawrite.exe command provided with the
     NetBSD/i386 install tools.

     From the OpenBOOT prompt, the following should boot the floppy.
           ok boot fd(,,1)                 # Version 1 OpenBOOT ROMs
           ok boot /fd                     # or
           ok boot floppy                  # Version 2 OpenBOOT ROMs

     After the initial probe messages you'll be asked to start the install or
     upgrade procedure. Proceed to the section Running the installation
     scripts.  below.

     Installing NetBSD by using a netboot setup

     First, you must setup a netboot server to provide the services and files
     your client needs. If you are using a NetBSD system as the netboot serv-
     er, have a look at the diskless(8) manual page for a more detailed guide
     on how to proceed with this.  If the server runs another operating sys-
     tem, you should consult the NetBSD Diskless HOW-TO, which will walk you
     through the steps necessary to configure a netboot server on a variety of
     platforms.
           http://www.netbsd.org/Documentation/network/netboot/

     This section will briefly describe what happens during a sparc netboot,
     and the next section will give a brief set of directions on how to set up
     your server. Your sparc initially broadcasts a RARP request, and expects
     a server to reply with your client's IP address. Next, it downloads a
     second stage bootstrap program via TFTP from the server that responded to
     the RARP request. It will look for a filename composed of the machine's
     IP address followed by the machine's architecture, separated by a period.
     For example, a sun4c machine which has been assigned IP address
     130.115.144.11, will make an TFTP request for `8273900B.SUN4C'.  This
     file is a symbolic link to the second-stage boot program, which should be
     located in a place where the TFTP daemon can find it (remember, many TFTP
     daemons run in a chroot'ed environment).

     The boot program to use is installation/netboot/boot.net Alternatively,
     you can find the bootstrap program in /usr/mdec/boot.net in the
     NetBSD/sparc distribution.

     Note:  The only difference between /usr/mdec/boot.net and /usr/mdec/boot
            is in the a.out header, which has been magically transformed in a
            way that makes it usable on all versions of Sparc PROMs.

     After the boot program has been loaded into memory and given control by
     the PROM, it starts locating the machine's remote root directory through
     the BOOTPARAM protocol. First a BOOTPARAM WHOAMI request is broadcast on
     the local net. The answer to this request should contain the client's
     name. This name is used in next step, a BOOTPARAM GETFILE request -- sent
     to the server that responded to the WHOAMI request -- requesting the name
     and address of the machine that will serve the client's root directory,
     as well as the path of the client's root on that server.

     Finally, this information is used to issue a REMOTE MOUNT request to the
     client's root filesystem server, asking for an NFS file handle corre-
     sponding to the root filesystem. Once the NFS mount is complete, the boot
     program starts reading from the remote root filesystem in search of the
     kernel which is then read into memory.

     Configuring your netboot server

     Follow this section to configure a NetBSD machine as your netboot server.
     We will use ``CC:CC:CC:CC:CC:CC'' as the MAC address (ethernet hardware
     address) of your netboot client machine that you wish to install NetBSD
     on.  We use ``192.168.1.10'' as the IP address of your client, and
     ``client.test.net'' as the name.  The server name is ``server.test.net'',
     and the path on the server to the NFS exported directory is
     /export/client/root although you may choose to use a different path.
     Create an /etc/ethers file with the following line:
           CC:CC:CC:CC:CC:CC     client
     Add your client to the server's /etc/hosts file:
           192.168.1.10 client
     If rarpd is currently running, restart it (kill -HUP), otherwise start
     rarpd:
           # /usr/sbin/rarpd -a
     Next, create /etc/bootparams with the following line:
           client root=server:/export/client/root
     If rpc.bootparamd is currently running, restart it (kill -HUP), otherwise
     start rpc.bootparamd:
           # /usr/sbin/rpc.bootparamd
     Now, make sure the bootloader in /tftpboot is linked to, or a copy of,
     boot.net and is named appropriately for your client (in this case, it
     would be C0A8010A.SUN4C).  Now, you should edit /etc/inetd.conf and make
     sure that the line starting with tftp is uncommented.  You will need to
     kill -HUP the inetd process to enable tftp if this line was previously
     commented out.  The next step is to set up NFS exports.  Put the follow-
     ing line in /etc/exports to enable NFS sharing:
           /export/client/root -maproot=root client.test.net
     If your server is currently running NFS services, you only need to kill
     -HUP the mountd process.  Otherwise, you need to run:
           # /sbin/mountd
           # /sbin/nfsd -tun 4

     As noted above in the section Preparing your System for NetBSD
     Installation you have several options when choosing a location to store
     the installation filesets. However, the easiest way is to put the distri-
     bution files into the exported directory for your client on the server.

     Next you must select whether to use the easier 'sysinst' or the more
     flexible script based install.

     Netboot sysinst installation

     Follow this section and skip the next if you wish to use the easier
     'sysinst' installation method.

     Copy the installation/netboot/netbsd.syram.gz kernel into the exported
     root directory for your machine, /export/client/root then netboot your
     workstation from the server by entering the appropriate `boot' command at
     the monitor prompt.  Depending on the PROM version in your machine, this
     command takes one of the following forms:
           > b le()netbsd.syram.gz             # for sun4 monitors
           ok boot le()netbsd.syram.gz           # for version 1 OpenBOOT ROMs
           ok boot net netbsd.syram.gz           # for version 2 OpenBOOT ROMs

     After the initial probe messages you'll be asked to start the install or
     upgrade procedure. Proceed to the section Running the installation
     scripts.  below.

     Netboot script installation from a NetBSD server

     Follow this section and skip the previous if you wish to use the more
     flexible 'miniroot' script installation method and your netboot server is
     running the NetBSD operating system.  If your server is not running NetB-
     SD you should follow the instructions on the Diskless HOW-TO
           http://www.netbsd.org/Documentation/network/netboot/

     Run the following two commands to mount the miniroot filesystem image
     from installation/miniroot/miniroot.fs and export it to the client.
           # vnconfig -c /dev/vnd0c miniroot.fs
           # mount /dev/vnd0c /export/client/root

     then boot your workstation from the server by entering the appropriate
     `boot' command at the monitor prompt.  Depending on the PROM version in
     your machine, this command takes one of the following forms:
           > b le()netbsd.syram.gz             # for sun4 monitors
           ok boot le()netbsd.syram.gz           # for version 1 OpenBOOT ROMs
           ok boot net netbsd.syram.gz           # for version 2 OpenBOOT ROMs

     After the initial probe messages you'll be asked to start the install or
     upgrade procedure. Proceed to the section Running the installation
     scripts.  below.

     When you have completed installation of NetBSD you should run the follow-
     ing commands on your server to clean up:
           # umount /export/client/root
           # vnconfig -u /dev/vnd0c

     Running the installation scripts

     The installation system will do most of the work of installing NetBSD on-
     to your disk. You will frequently be asked for confirmation before the
     system proceeds with each phase of the installation process.

     Occasionally, you will have to provide a piece of information such as the
     name of the disk you want to install on, partitioning information, or IP
     addresses and domain names you want to assign. If your system has more
     than one disk, you may want to look at the output of the dmesg(8) command
     to see how your disks have been identified by the kernel.

     Note:  If you repartition a hard drive, be certain that every partition
            starts on a cylinder boundary for compatability with the OpenBOOT
            ROM.

     The installation script goes through the following phases:
     o   determination of the disk on which to install NetBSD
     o   checking/creation of the partition information on the disk
     o   creating and mounting the NetBSD filesystems
     o   setup of network configuration
     o   extraction of the distribution tar files
     o   installation of bootstrap programs

     Now try a reboot.  Initially I'd suggest you "boot sd()netbsd -bs", then
     try multiuser after that. If you boot single-user the NetBSD incantation
     to make the root filesystem writable is
           netbsd# mount -u /dev/sd0a /
     The Sun monitor might have been setup to instruct the boot program to
     load a file called "vmunix". On OpenBOOT ROM systems you can change it to
     load "netbsd" instead using the following commands:

     On version 1 OpenBOOT ROMs:
           >n
           ok setenv boot-from sd(0,0,0)netbsd
           ok

     On version 2 OpenBOOT ROMs:
           ok setenv boot-file netbsd
           ok setenv boot-device /sbus/esp/sd@0,0

     Congratulations, you have successfully installed NetBSD 1.5_FOO.