Installing NetBSD is a relatively complex process, but if you have this document in hand it shouldn't be too much trouble. There are several ways to install NetBSD onto a disk. The easiest way in terms of preliminary setup is to use the NetBSD miniroot that can be booted off your local disk's swap partition. Alternatively, if your Sparcstation is hooked up in a network you can find a server and arrange for a diskless setup which is a convenient way to install on a machine whose disk does not currently hold a usable operating system (see the section `Installing NetBSD by using a diskless setup' below). Installing NetBSD by using the NetBSD miniroot. The miniroot is a self-contained NetBSD filesystem holding all utilities necessary to install NetBSD on a local disk. It is distributed as a plain file designed to be transferred to a raw disk partition from which it can be booted using the appropriate PROM command. Usually, the miniroot will be loaded into the swap partition of a disk. If needed, you can use any other unused partition, but remember that the partition will then not available during the installation process. Loading the miniroot onto your raw partition is simple. On NetBSD as well as SunOS you use a command like: # dd if=miniroot-_VER.fs of=/dev/rsd0b bs=20b conv=sync (here `/dev/rsd0b' is assumed to be your swap partition). There's a potential 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 partition to spare, you can usually get away with running this command anyway after first booting into single-user mode to ensure a quiet system. After transferring the miniroot to disk, bring the system down by: # halt Then boot the miniroot 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 miniroot onto some other disk than `sd0' 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 miniroot 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 diskless setup. First, you must setup a diskless client configuration on a server. If you are using a NetBSD system as the boot-server, have a look at the diskless(8) manual page for guidelines on how to proceed with this. If the server runs another operating system, you'll have to consult documentation that came with it (on SunOS systems, add_client(8) is a good start). Your Sparcstation expects to be able to download a second stage bootstrap program via TFTP after having acquired its IP address through RevARP when instructed to boot "over the net". 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'. Normally, this file is a symbolic link to an appropriate 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). You can find the boot program in `/usr/mdec/boot.net' in the NetBSD/sparc distribution. [ Note that 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 (if it comes in) contains 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 (if it comes in) is used to issue a REMOTE MOUNT request to the client's root filesystem server, asking for an NFS file handle corresponding to the root filesystem. If successful, the boot program starts reading from the remote root filesystem in search of the kernel which is then read into memory. 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 *.tar.gz files you want to install into the root directory for your client on the server. Next, unpack `base.tar.gz' and `etc.tar.gz' on the server in the root directory for your machine. If you elect to use a separately NFS-mounted filesystem for `/usr' with your diskless setup, make sure the "./usr" base files in base.tar.gz end up in the correct location. One way to do this is to temporarily use a loopback mount on the server, re-routing /usr to your server's exported NetBSD "/usr" directory. Also put the kernel and the install/upgrade scripts into the root directory. A few configuration files need to be edited: /etc/hosts Add the IP addresses of both server and client. /etc/myname This files contains the client's hostname; use the same name as in /etc/hosts. /etc/fstab Enter the entries for the remotely mounted filesystems. For example: server:/export/root/client / nfs rw 0 0 server:/export/exec/sun4.netbsd /usr nfs rw 0 0 Now you must populate the the `/dev' directory for your client. If you server runs SunOS 4.x, you can simply change your working directory to `/dev' and run the MAKEDEV script: `sh MAKEDEV all'. On SunOS 5.x systems, MAKEDEV can also be used, but there'll be error messages about unknown user and groups. These errors are inconsequential for the purpose of installing NetBSD. However, you may want to correct them if you plan to use the diskless setup regularly. In that case, you may re-run MAKEDEV on your NetBSD machine once it has booted. 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 -s # for sun4 monitors ok boot le()netbsd -s # for version 1 OpenBOOT ROMs ok boot net netbsd -s # for version 2 OpenBOOT ROMs This will boot the NetBSD kernel in single-user mode. [[ NOTE: the latter two examples assume you operate the OpenBOOT ROM in "new command mode". If your machine comes up and gives you a `>' prompt instead of `ok', type: >n # enter native OpenBOOT mode ok setenv sunmon-compat? false # make it permanent ok ]] If you use a diskless setup with a separately NFS-mounted /usr filesystem, mount /usr by hand now: netbsd# mount /usr At this point, it's worth checking the disk label and partition sizes on the disk you want to install NetBSD onto. NetBSD understands SunOS-style disklabels, so if your disk was previously used by SunOS there will be a usable label on it. Use `disklabel -e ' (where is the device name assigned by the NetBSD kernel, e.g. `sd0') to view and modify the partition sizes. See the section `Preparing your System for NetBSD Installation' above for suggestions about disk partition sizes. If you are installing on a SCSI disk that does *not* have a SunOS or NetBSD label on it, you may still be able to use disklabel(8) but you'll have to create all partitions from scratch. If your disk is listed in `/etc/disktab', you may use the entry (which in most cases only defines a `c' partition to describe the whole disk) to put an initial label on the disk. Then proceed with `disklabel -e ' to create a partition layout that suits your needs. NOTE: Because of the built-in compatibility with SunOS-style labels, ALWAYS MAKE SURE ALL YOUR PARTITIONS START AND END ON CYLINDER BOUNDARIES. Here follows an example of what you'll see while in the dislabel editor. Do not touch any of the parameters except for the `label: ' entry and the actual partition size information at the bottom (the lines starting with `a:', `b:', ...). The size and offset fields are given in sector units. Be sure to make these numbers multiples of the of the number of sectors per cylinder: the kernel might be picky about these things, but aside from this you'll have the least chance of wasting disk space. Partitions on which you intend to have a mountable filesystem, should be given fstype `4.2BSD'. Remember, the `c' partition should describe the whole disk. The `(Cyl. x - y)' info that appears after the hash (`#') character is treated as a comment and need not be filled in when altering partitions. Special note: the line containing `8 partitions:' is best left alone, even if you define less then eight partitions. If this line displays a different number and the program complains about it (after you leave the editor), then try setting it to `8 partitions:'. netbsd# disklabel sd2 # /dev/rsd2c: type: SCSI disk: SCSI disk label: Hold Your Breath flags: bytes/sector: 512 sectors/track: 64 tracks/cylinder: 7 sectors/cylinder: 448 cylinders: 1429 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0 8 partitions: # size offset fstype [fsize bsize cpg] a: 50176 0 4.2BSD 0 0 0 # (Cyl. 0 - 111) b: 64512 50176 swap # (Cyl. 112 - 255) c: 640192 0 unknown # (Cyl. 0 - 1428) d: 525504 114688 4.2BSD 0 0 0 # (Cyl. 256 - 1428) If you are upgrading a NetBSD installation, start the upgrade script: netbsd# sh upgrade.sh else, start the installation script: netbsd# sh install.sh Running the installation scripts. The installation scripts will do most of the work of transferring the system from the distribution sets onto your disk. You will frequently be asked for confirmation before the script proceeds with each phase of the installation process. Occasionally, you'll have to provide a piece of information such as the name of the disk you want to install on 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. The installation script goes through the following phases: - determination of the disk to install NetBSD on - checking of the partition information on the disk - creating and mounting the NetBSD filesystems - setup of IP configuration - extraction of the distribution tar files - installation of boot 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 _VER. When you reboot into NetBSD, you should log in as "root" at the login prompt. There is no initial password, but if you're using the machine in a networked environment, you should create yourself an account and protect it and the "root" account with good passwords. Some of the files in the NetBSD _VER distribution might need to be tailored for your site. In particular, the /etc/sendmail.cf file will almost definitely need to be adjusted, and other files in /etc will probably need to be modified. If you are unfamiliar with UN*X-like system administration, it's recommended that you buy a book that discusses it.