Home | History | Annotate | Line # | Download | only in sparc
install revision 1.12
      1   1.1  deraadt Installing NetBSD is a relatively complex process, but if you have
      2   1.1  deraadt this document in hand it shouldn't be too much trouble.
      3   1.1  deraadt 
      4  1.11       pk There are several ways to install NetBSD onto a disk. The easiest way
      5  1.11       pk in terms of preliminary setup is to use the NetBSD miniroot that can
      6  1.11       pk be booted off your local disk's swap partition. Alternatively, if your
      7  1.11       pk Sparcstation is hooked up in a network you can find a server and arrange
      8  1.11       pk for a diskless setup which is a convenient way to install on a machine
      9  1.11       pk whose disk does not currently hold a usable operating system (see the
     10  1.11       pk section `Installing using a diskless setup' below).
     11  1.11       pk 
     12  1.11       pk 
     13  1.11       pk Installing using the NetBSD miniroot.
     14  1.11       pk 
     15  1.11       pk The miniroot is a self-contained NetBSD filesystem holding all utilities
     16  1.11       pk necessary to install NetBSD on a local disk. It is distributed as a plain
     17  1.11       pk file designed to be transferred to a raw disk partition from which it can
     18  1.11       pk be booted using the appropriate PROM command. Usually, the miniroot will
     19  1.11       pk be loaded into the swap partition of a disk. If needed, you can use any
     20  1.11       pk other unused partition, but remember that the partition will then not
     21  1.11       pk available during the installation process.
     22  1.11       pk 
     23  1.11       pk Loading the miniroot onto your raw partition is simple. On NetBSD as well
     24  1.11       pk as SunOS you use a command like:
     25  1.11       pk 
     26  1.11       pk 	# dd if=miniroot-RELEASE.fs of=/dev/rsd0b bs=20b conv=sync
     27  1.11       pk 
     28  1.11       pk (here `/dev/rsd0b' is assumed to be your swap partition). There's a
     29  1.11       pk potential problem here if /dev/rsd0b is actually in use as a swap
     30  1.11       pk partition by your currently running system. If you don't have another
     31  1.11       pk disk or partition to spare, you can usually get away with running this
     32  1.11       pk command anyway after first booting into single-user mode to ensure a
     33  1.11       pk quiet system.
     34  1.11       pk 
     35  1.11       pk After transferring the miniroot to disk, bring the system down by:
     36  1.11       pk 
     37  1.11       pk 	# halt
     38  1.11       pk 
     39  1.11       pk Then boot the miniroot by typing the appropriate command at the PROM:
     40  1.11       pk 
     41  1.11       pk 	> b sd(,,1)netbsd -s			# for sun4 monitors
     42  1.11       pk 	ok boot sd(,,1)netbsd -s		# for version 1 OpenBOOT ROMs
     43  1.11       pk 	ok boot disk:b netbsd -s		# for version 2 OpenBOOT ROMs
     44  1.11       pk 
     45  1.11       pk If you've loaded the miniroot onto some other disk than `sd0' adapt
     46  1.11       pk the boot specifier accordingly, e.g.:
     47  1.11       pk 
     48  1.11       pk 	ok boot disk1:b netbsd -s
     49  1.11       pk 
     50  1.11       pk to boot from SCSI disk target 1 from a version 2 OpenBOOT ROM.
     51  1.12       pk If you have to use the old-style `sd(c,u,p)' syntax to boot from a
     52  1.12       pk SCSI disk, you can calculate the parameters as follows:
     53  1.11       pk 
     54  1.12       pk 	`c'	- specifies the controller number
     55  1.12       pk 	`u'	- the hexadecimal number obtained from evaluating
     56  1.12       pk 		  the expression `(8 * TARGET) + LUN'
     57  1.12       pk 	`p'	- the partition number from which to boot (0=`a', 1=`b', etc).
     58   1.4       pk 
     59  1.12       pk 
     60  1.12       pk The monitor boot command will cause the NetBSD kernel contained in the
     61  1.12       pk miniroot image to be booted. After the initial probe messages you'll be
     62  1.12       pk asked to start the install or upgrade procedure. Proceed to the section
     63  1.12       pk `Running the installation scripts' below.
     64   1.5       pk 
     65   1.4       pk Installing using a diskless setup.
     66   1.4       pk 
     67   1.8       pk First, you must setup a diskless client configuration on a server. If
     68   1.8       pk you are using a NetBSD system as the boot-server, have a look at the
     69   1.8       pk diskless(8) manual page for guidelines on how to proceed with this.
     70   1.8       pk If the server runs another operating system, you'll have to consult
     71   1.8       pk documentation that came with it (on SunOS systems, add_client(8) is a
     72   1.8       pk good start).
     73   1.8       pk 
     74   1.9       pk Your Sparcstation expects to be able to download a second stage bootstrap
     75  1.11       pk program via TFTP after having acquired its IP address through RevARP when
     76   1.9       pk instructed to boot "over the net". It will look for a filename composed of
     77   1.9       pk the machine's IP address followed by the machine's architecture, separated
     78   1.9       pk by a period. For example, a sun4c machine which has been assigned IP
     79   1.9       pk address 130.115.144.11, will make an TFTP request for `8273900B.SUN4C'.
     80  1.11       pk Normally, this file is a symbolic link to an appropriate second-stage
     81   1.9       pk boot program, which should be located in a place where the TFTP daemon
     82   1.9       pk can find it (remember, many TFTP daemons run in a chroot'ed environment).
     83   1.9       pk You can find the boot program in `/usr/mdec/boot' in the NetBSD/sparc
     84   1.9       pk distribution. Unfortunately, it is necessary to install this file
     85  1.11       pk differently for sun4 and sun4c clients: the sun4 version needs to have its
     86  1.11       pk `a.out' header stripped off (otherwise the machine will crash), while the
     87  1.11       pk sun4c version must retain it (otherwise the PROM will complain).
     88   1.9       pk 
     89  1.11       pk Here's an example to illustrate this whole mess:
     90   1.9       pk 
     91   1.9       pk     server# cd /<client-root-dir>/usr/mdec
     92  1.11       pk     if client is a sun4:
     93  1.11       pk 	server# set SKIP=1
     94  1.11       pk 	server# set KARCH=SUN4
     95  1.11       pk     else
     96  1.11       pk 	server# set SKIP=0
     97  1.11       pk 	server# set KARCH=SUN4C
     98  1.11       pk     server# dd if=boot of=/tftpboot/boot.sparc.netbsd.$KARCH skip=$SKIP bs=32
     99  1.11       pk     server# cd /tftpboot
    100  1.11       pk     server# ln -s boot.sparc.netbsd.$KARCH 8273900B.$KARCH
    101  1.11       pk 
    102  1.11       pk Note: some versions of Openboot ROMs (sun4c/sun4m) seem to require that the
    103  1.11       pk boot program size is nicely rounded. Therefore it may be necessary to
    104  1.11       pk strip(8) off the symbol table.
    105  1.11       pk 
    106  1.11       pk After the boot program has been loaded into memory and given control by
    107  1.11       pk the PROM, it starts locating the machine's remote root directory through
    108  1.11       pk the BOOTPARAM protocol. First a BOOTPARAM WHOAMI request is broadcast
    109  1.11       pk on the local net. The answer to this request (if it comes in) contains
    110  1.11       pk the client's name. This name is used in next step, a BOOTPARAM GETFILE
    111  1.11       pk request -- sent to the server that responded to the WHOAMI request --
    112  1.11       pk requesting the name and address of the machine that will serve the client's
    113  1.11       pk root directory, as well as the path of the client's root on that server.
    114  1.11       pk 
    115  1.11       pk Finally, this information (if it comes in) is used to issue a REMOTE MOUNT
    116  1.11       pk request to the client's root filesystem server, asking for an NFS file
    117  1.11       pk handle corresponding to the root filesystem. If successful, the boot
    118  1.11       pk program starts reading from the remote root filesystem in search of the
    119  1.11       pk kernel which is then read into memory.
    120   1.9       pk 
    121   1.9       pk 
    122   1.8       pk As noted above in the section `Preparing your System for NetBSD Installation',
    123   1.8       pk you have several options when choosing a location to store the installation
    124   1.8       pk filesets. However, the easiest way is to put the *.tar.gz files you want
    125   1.8       pk to install into the root directory for your client on the server.
    126   1.8       pk 
    127   1.8       pk Next, unpack `base.tar.gz' and `etc.tar.gz' on the server in the root 
    128   1.8       pk directory for your machine. If you elect to use a separately NFS-mounted
    129   1.8       pk filesystem for `/usr' with your diskless setup, make sure the "./usr" base
    130   1.8       pk files in base.tar.gz end up in the correct location. One way to do this is
    131   1.8       pk to temporarily use a loopback mount on the server, re-routing <root>/usr to
    132   1.8       pk your server's exported NetBSD "/usr" directory. Also put the kernel and the
    133   1.8       pk install/upgrade scripts into the root directory.
    134   1.5       pk 
    135   1.4       pk A few configuration files need to be edited:
    136   1.4       pk 
    137   1.4       pk 	<root>/etc/hosts
    138   1.5       pk 		Add the IP addresses of both server and client.
    139   1.5       pk 
    140   1.4       pk 	<root>/etc/myname
    141   1.5       pk 		This files contains the client's hostname; use the same
    142   1.5       pk 		name as in <root>/etc/hosts.
    143   1.5       pk 
    144   1.4       pk 	<root>/etc/fstab
    145   1.7       pk 		Enter the entries for the remotely mounted filesystems.
    146   1.7       pk 		For example:
    147   1.7       pk 			server:/export/root/client       /     nfs  rw 0 0
    148   1.7       pk 			server:/export/exec/sun4.netbsd  /usr  nfs  rw 0 0
    149   1.5       pk 
    150   1.5       pk Now you must populate the the `/dev' directory for your client. If you server
    151   1.5       pk runs SunOS 4.x, you can simply change your working directory to `<root>/dev'
    152   1.5       pk and run the MAKEDEV script: `sh MAKEDEV all'.
    153   1.5       pk 
    154   1.5       pk On SunOS 5.x systems, MAKEDEV can also be used, but there'll be error
    155   1.5       pk messages about unknown user and groups. These errors are inconsequential
    156   1.5       pk for the purpose of installing NetBSD. However, you may want to correct them
    157  1.11       pk if you plan to use the diskless setup regularly. In that case, you may re-run
    158   1.5       pk MAKEDEV on your NetBSD machine once it has booted.
    159   1.4       pk 
    160   1.4       pk Boot your workstation from the server by entering the appropriate `boot'
    161   1.4       pk command at the monitor prompt. Depending on the PROM version in your machine,
    162   1.4       pk this command takes one of the following forms:
    163   1.4       pk 
    164   1.4       pk 	> b le()netbsd -s		# for sun4 monitors
    165   1.4       pk 	ok boot le()netbsd -s		# for version 1 OpenBOOT ROMs
    166   1.4       pk 	ok boot net netbsd -s		# for version 2 OpenBOOT ROMs
    167   1.4       pk 
    168   1.4       pk This will boot the NetBSD kernel in single-user mode.
    169   1.4       pk 
    170   1.4       pk [[
    171   1.4       pk NOTE: the latter two examples assume you operate the OpenBOOT ROM in
    172   1.4       pk "new command mode". If your machine comes up and gives you a `>' prompt
    173   1.4       pk instead of `ok', type:
    174   1.4       pk 
    175   1.4       pk     >n					# enter native OpenBOOT mode
    176   1.4       pk     ok setenv sunmon-compat? false	# make it permanent
    177   1.4       pk     ok
    178   1.4       pk ]]
    179   1.5       pk 
    180   1.5       pk If you use a diskless setup with a separately NFS-mounted /usr filesystem,
    181   1.5       pk mount /usr by hand now:
    182   1.5       pk 
    183   1.5       pk netbsd# mount /usr
    184   1.7       pk 
    185   1.7       pk At this point, it's worth checking the disk label and partition sizes on
    186   1.7       pk the disk you want to install NetBSD onto. NetBSD understands SunOS-style
    187   1.7       pk disklabels, so if your disk was previously used by SunOS there will be
    188   1.7       pk a usable label on it. Use `disklabel -e <disk>' (where <disk> is the
    189   1.7       pk device name assigned by the NetBSD kernel, e.g. `sd0') to view and
    190  1.11       pk modify the partition sizes. See the section `Preparing your System for
    191  1.11       pk NetBSD Installation' above for suggestions about disk partition sizes.
    192  1.11       pk Make sure all your partitions start and end on cylinder boundaries.
    193   1.7       pk 
    194   1.7       pk NOTE: if you are installing on a SCSI disk that does *not* have a SunOS
    195   1.7       pk or NetBSD label on it, you may still be able to use disklabel(8) but you'll
    196   1.7       pk have to create all partitions from scratch. If your disk is listed in
    197   1.7       pk `/etc/disktab', you may use the entry (which in most cases only defines
    198   1.7       pk a `c' partition to describe the whole disk) to put an initial label on
    199  1.11       pk the disk.  DO NOT USE `disklabel -r ...' TO INITIALIZE YOUR DISK LABEL;
    200  1.11       pk THIS WILL LEAD TO UNPREDICTABLE RESULTS. This deficiency will be fixed
    201  1.11       pk in a next release.
    202   1.7       pk 
    203   1.8       pk Here follows an example of what you'll see while in the dislabel editor.
    204   1.8       pk Do not touch any of the parameters except for the `label: ' entry and
    205   1.8       pk the actual partition size information at the bottom (the lines starting
    206   1.8       pk with `a:', `b:', ...).
    207   1.8       pk 
    208   1.8       pk The size and offset fields are given in sector units. Be sure to make
    209   1.8       pk these numbers multiples of the of the number of sectors per cylinder:
    210   1.8       pk the kernel might be picky about these things, but aside from this you'll
    211   1.8       pk have the least chance of wasting disk space.
    212  1.11       pk Partitions on which you intend to have a mountable filesystem, should
    213   1.8       pk be given fstype `4.2BSD'. Remember, the `c' partition should describe
    214   1.8       pk the whole disk.
    215   1.8       pk The `(Cyl. x - y)' info that appears after the hash (`#') character is
    216   1.8       pk treated as a comment and need not be filled in when altering partitions.
    217   1.8       pk 
    218   1.8       pk Special note: the line containing `8 partitions:' is best left alone,
    219   1.8       pk even if you define less then eight partitions. If this line displays
    220   1.8       pk a different number and the program complains about it (after you leave
    221   1.8       pk the editor), then try setting it to `8 partitions:'.
    222   1.8       pk 
    223   1.8       pk 
    224   1.8       pk <BEGIN SAMPLE DISKLABEL SCREEN>
    225   1.8       pk netbsd# disklabel sd2
    226   1.8       pk  # /dev/rsd2c:
    227   1.8       pk type: SCSI 
    228   1.8       pk disk: SCSI disk
    229   1.8       pk label: Hold Your Breath
    230   1.8       pk flags:
    231   1.8       pk bytes/sector: 512
    232   1.8       pk sectors/track: 64
    233   1.8       pk tracks/cylinder: 7  
    234   1.8       pk sectors/cylinder: 448
    235   1.8       pk cylinders: 1429
    236   1.8       pk rpm: 3600
    237   1.8       pk interleave: 1
    238   1.8       pk trackskew: 0
    239   1.8       pk cylinderskew: 0
    240   1.8       pk headswitch: 0           # milliseconds
    241   1.8       pk track-to-track seek: 0  # milliseconds
    242   1.8       pk drivedata: 0
    243   1.8       pk 
    244   1.8       pk 8 partitions:
    245   1.8       pk #        size   offset    fstype   [fsize bsize   cpg]
    246   1.8       pk   a:    50176        0    4.2BSD        0     0     0   # (Cyl.    0 - 111)
    247   1.8       pk   b:    64512    50176      swap                        # (Cyl.  112 - 255)
    248   1.8       pk   c:   640192        0   unknown                        # (Cyl.    0 - 1428)
    249   1.8       pk   d:   525504   114688    4.2BSD        0     0     0   # (Cyl.  256 - 1428)
    250   1.8       pk <END SAMPLE DISKLABEL SCREEN>
    251   1.8       pk 
    252   1.5       pk 
    253   1.6       pk If you are upgrading a NetBSD installation, start the upgrade script:
    254   1.4       pk 
    255   1.8       pk netbsd# sh upgrade.sh
    256   1.6       pk 
    257   1.8       pk else, start the installation script:
    258   1.4       pk 
    259   1.8       pk netbsd# sh install.sh
    260   1.4       pk 
    261   1.4       pk 
    262  1.11       pk Running the installation scripts.
    263  1.11       pk 
    264  1.11       pk The installation scripts will do most of the work of transferring the
    265  1.11       pk system from the distribution sets onto your disk. You will frequently be
    266  1.11       pk asked for confirmation before the script proceeds with each phase of the
    267  1.11       pk installation process.
    268  1.11       pk 
    269   1.4       pk Occasionally, you'll have to provide a piece of information such as the
    270   1.4       pk name of the disk you want to install on or IP addresses and domain names
    271   1.8       pk you want to assign. If your system has more than one disk, you may want
    272   1.8       pk to look at the output of the dmesg(8) command to see how your disks
    273   1.8       pk have been identified by the kernel.
    274   1.4       pk 
    275   1.4       pk The installation script goes through the following phases:
    276   1.4       pk 
    277   1.4       pk 	- determination of the disk to install NetBSD on
    278   1.4       pk 	- checking of the partition information on the disk
    279   1.4       pk 	- creating and mounting the NetBSD filesystems
    280   1.4       pk 	- setup of IP configuration
    281   1.4       pk 	- extraction of the distribution tar files
    282   1.4       pk 	- installation of boot programs
    283   1.4       pk 
    284   1.4       pk 
    285  1.11       pk Now try a reboot.  Initially I'd suggest you "boot sd()netbsd -bs", then
    286  1.11       pk try multiuser after that. If you boot single-user the NetBSD incantation
    287  1.11       pk to make the root filesystem writable is
    288   1.4       pk 
    289   1.4       pk     netbsd# mount -u /dev/sd0a /
    290   1.4       pk 
    291  1.11       pk The Sun monitor might have been setup to instruct the boot program to load
    292  1.11       pk a file called "vmunix". On OpenBOOT ROM systems you can change it to load
    293  1.11       pk "netbsd" instead using the following commands:
    294   1.4       pk 
    295   1.4       pk On version 1 OpenBOOT ROMs:
    296   1.4       pk     >n
    297   1.4       pk     ok setenv boot-from sd(0,0,0)netbsd
    298   1.4       pk     ok
    299   1.4       pk 
    300   1.4       pk On version 2 OpenBOOT ROMs:
    301   1.4       pk     ok setenv boot-file netbsd
    302   1.4       pk     ok setenv boot-device /sbus/esp/sd@0,0
    303   1.4       pk 
    304   1.4       pk 
    305   1.9       pk Congratulations, you have successfully installed NetBSD RELEASE.  When you
    306   1.4       pk reboot into NetBSD, you should log in as "root" at the login prompt.
    307   1.4       pk There is no initial password, but if you're using the machine in a
    308   1.4       pk networked environment, you should create yourself an account and
    309   1.4       pk protect it and the "root" account with good passwords.
    310   1.4       pk 
    311   1.9       pk Some of the files in the NetBSD RELEASE distribution might need to be
    312   1.4       pk tailored for your site.  In particular, the /etc/sendmail.cf file will
    313   1.4       pk almost definitely need to be adjusted, and other files in /etc will
    314   1.4       pk probably need to be modified.  If you are unfamiliar with UN*X-like
    315   1.4       pk system administration, it's recommended that you buy a book that
    316   1.4       pk discusses it.
    317   1.4       pk 
    318