Home | History | Annotate | Line # | Download | only in sparc
install revision 1.9
      1 Installing NetBSD is a relatively complex process, but if you have
      2 this document in hand it shouldn't be too much trouble.
      3 
      4 There are several ways to install NetBSD onto a disk. If your Sparcstation
      5 is hooked up in a network you can find find a server and arrange for a
      6 diskless setup which is a convenient way to install on a machine with
      7 a single disk attached. Alternatively, you could use SunOS (booted from
      8 a local disk) and install NetBSD onto a second disk. For the latter method,
      9 skip to the section "Installing from SunOS" below.
     10 
     11 
     12 Installing using a diskless setup.
     13 
     14 First, you must setup a diskless client configuration on a server. If
     15 you are using a NetBSD system as the boot-server, have a look at the
     16 diskless(8) manual page for guidelines on how to proceed with this.
     17 If the server runs another operating system, you'll have to consult
     18 documentation that came with it (on SunOS systems, add_client(8) is a
     19 good start).
     20 
     21 Your Sparcstation expects to be able to download a second stage bootstrap
     22 program via TFTP after havinf acquired its IP address through RevARP when
     23 instructed to boot "over the net". It will look for a filename composed of
     24 the machine's IP address followed by the machine's architecture, separated
     25 by a period. For example, a sun4c machine which has been assigned IP
     26 address 130.115.144.11, will make an TFTP request for `8273900B.SUN4C'.
     27 Normally, this file is symbolic link to an appropriate second-stage
     28 boot program, which should be located in a place where the TFTP daemon
     29 can find it (remember, many TFTP daemons run in a chroot'ed environment).
     30 You can find the boot program in `/usr/mdec/boot' in the NetBSD/sparc
     31 distribution. Unfortunately, it is necessary to install this file
     32 differently for sun4 and sun4c clients: the sun4 version needs to have its
     33 `a.out' header stripped off (otherwise the machine will crash), while the
     34 sun4c version must retain it (otherwise the PROM will complain).
     35 
     36 Here's an example to illustrate this whole mess:
     37 
     38     server# cd /<client-root-dir>/usr/mdec
     39     if client is a sun4:
     40 	server# set SKIP=1
     41 	server# set KARCH=SUN4
     42     else
     43 	server# set SKIP=0
     44 	server# set KARCH=SUN4C
     45     server# dd if=boot of=/tftpboot/boot.sparc.netbsd.$KARCH skip=$SKIP bs=32
     46     server# cd /tftpboot
     47     server# ln -s boot.sparc.netbsd.$KARCH 8273900B.$KARCH
     48 
     49 Note: some versions of Openboot ROMs (sun4c) seem to require that the
     50 boot program size is nicely rounded. Therefore it may be necessary to
     51 strip(8) off the symbol table.
     52 
     53 
     54 As noted above in the section `Preparing your System for NetBSD Installation',
     55 you have several options when choosing a location to store the installation
     56 filesets. However, the easiest way is to put the *.tar.gz files you want
     57 to install into the root directory for your client on the server.
     58 
     59 Next, unpack `base.tar.gz' and `etc.tar.gz' on the server in the root 
     60 directory for your machine. If you elect to use a separately NFS-mounted
     61 filesystem for `/usr' with your diskless setup, make sure the "./usr" base
     62 files in base.tar.gz end up in the correct location. One way to do this is
     63 to temporarily use a loopback mount on the server, re-routing <root>/usr to
     64 your server's exported NetBSD "/usr" directory. Also put the kernel and the
     65 install/upgrade scripts into the root directory.
     66 
     67 A few configuration files need to be edited:
     68 
     69 	<root>/etc/hosts
     70 		Add the IP addresses of both server and client.
     71 
     72 	<root>/etc/myname
     73 		This files contains the client's hostname; use the same
     74 		name as in <root>/etc/hosts.
     75 
     76 	<root>/etc/fstab
     77 		Enter the entries for the remotely mounted filesystems.
     78 		For example:
     79 			server:/export/root/client       /     nfs  rw 0 0
     80 			server:/export/exec/sun4.netbsd  /usr  nfs  rw 0 0
     81 
     82 Now you must populate the the `/dev' directory for your client. If you server
     83 runs SunOS 4.x, you can simply change your working directory to `<root>/dev'
     84 and run the MAKEDEV script: `sh MAKEDEV all'.
     85 
     86 On SunOS 5.x systems, MAKEDEV can also be used, but there'll be error
     87 messages about unknown user and groups. These errors are inconsequential
     88 for the purpose of installing NetBSD. However, you may want to correct them
     89 if you plan to the diskless setup regularly. In that case, you may re-run
     90 MAKEDEV on your NetBSD machine once it has booted.
     91 
     92 Boot your workstation from the server by entering the appropriate `boot'
     93 command at the monitor prompt. Depending on the PROM version in your machine,
     94 this command takes one of the following forms:
     95 
     96 	> b le()netbsd -s		# for sun4 monitors
     97 	ok boot le()netbsd -s		# for version 1 OpenBOOT ROMs
     98 	ok boot net netbsd -s		# for version 2 OpenBOOT ROMs
     99 
    100 This will boot the NetBSD kernel in single-user mode.
    101 
    102 [[
    103 NOTE: the latter two examples assume you operate the OpenBOOT ROM in
    104 "new command mode". If your machine comes up and gives you a `>' prompt
    105 instead of `ok', type:
    106 
    107     >n					# enter native OpenBOOT mode
    108     ok setenv sunmon-compat? false	# make it permanent
    109     ok
    110 ]]
    111 
    112 If you use a diskless setup with a separately NFS-mounted /usr filesystem,
    113 mount /usr by hand now:
    114 
    115 netbsd# mount /usr
    116 
    117 At this point, it's worth checking the disk label and partition sizes on
    118 the disk you want to install NetBSD onto. NetBSD understands SunOS-style
    119 disklabels, so if your disk was previously used by SunOS there will be
    120 a usable label on it. Use `disklabel -e <disk>' (where <disk> is the
    121 device name assigned by the NetBSD kernel, e.g. `sd0') to view and
    122 modify the partition sizes. A comfortable size for the root filesystem
    123 partition is about 20MB; a good initial size for the swap partition is
    124 twice the amount of physical memory in your machine (though, unlike
    125 SunOS 4.x, there are no restrictions on the size of the swap partition
    126 that would render part of your memory unusable). A full binary installation
    127 takes about 60MB in `/usr'. Make all your partitions start and end on
    128 cylinder boundaries.
    129 
    130 NOTE: if you are installing on a SCSI disk that does *not* have a SunOS
    131 or NetBSD label on it, you may still be able to use disklabel(8) but you'll
    132 have to create all partitions from scratch. If your disk is listed in
    133 `/etc/disktab', you may use the entry (which in most cases only defines
    134 a `c' partition to describe the whole disk) to put an initial label on
    135 the disk.
    136 
    137 Here follows an example of what you'll see while in the dislabel editor.
    138 Do not touch any of the parameters except for the `label: ' entry and
    139 the actual partition size information at the bottom (the lines starting
    140 with `a:', `b:', ...).
    141 
    142 The size and offset fields are given in sector units. Be sure to make
    143 these numbers multiples of the of the number of sectors per cylinder:
    144 the kernel might be picky about these things, but aside from this you'll
    145 have the least chance of wasting disk space.
    146 Partitions on which you intend to have a a mountable filesystem, should
    147 be given fstype `4.2BSD'. Remember, the `c' partition should describe
    148 the whole disk.
    149 The `(Cyl. x - y)' info that appears after the hash (`#') character is
    150 treated as a comment and need not be filled in when altering partitions.
    151 
    152 Special note: the line containing `8 partitions:' is best left alone,
    153 even if you define less then eight partitions. If this line displays
    154 a different number and the program complains about it (after you leave
    155 the editor), then try setting it to `8 partitions:'.
    156 
    157 
    158 <BEGIN SAMPLE DISKLABEL SCREEN>
    159 netbsd# disklabel sd2
    160  # /dev/rsd2c:
    161 type: SCSI 
    162 disk: SCSI disk
    163 label: Hold Your Breath
    164 flags:
    165 bytes/sector: 512
    166 sectors/track: 64
    167 tracks/cylinder: 7  
    168 sectors/cylinder: 448
    169 cylinders: 1429
    170 rpm: 3600
    171 interleave: 1
    172 trackskew: 0
    173 cylinderskew: 0
    174 headswitch: 0           # milliseconds
    175 track-to-track seek: 0  # milliseconds
    176 drivedata: 0
    177 
    178 8 partitions:
    179 #        size   offset    fstype   [fsize bsize   cpg]
    180   a:    50176        0    4.2BSD        0     0     0   # (Cyl.    0 - 111)
    181   b:    64512    50176      swap                        # (Cyl.  112 - 255)
    182   c:   640192        0   unknown                        # (Cyl.    0 - 1428)
    183   d:   525504   114688    4.2BSD        0     0     0   # (Cyl.  256 - 1428)
    184 <END SAMPLE DISKLABEL SCREEN>
    185 
    186 
    187 If you are upgrading a NetBSD installation, start the upgrade script:
    188 
    189 netbsd# sh upgrade.sh
    190 
    191 else, start the installation script:
    192 
    193 netbsd# sh install.sh
    194 
    195 
    196 These scripts will do most of the work of transferring the system from the
    197 tar files onto your disk. You will frequently be asked for confirmation
    198 before the script proceeds with each phase of the installation process.
    199 Occasionally, you'll have to provide a piece of information such as the
    200 name of the disk you want to install on or IP addresses and domain names
    201 you want to assign. If your system has more than one disk, you may want
    202 to look at the output of the dmesg(8) command to see how your disks
    203 have been identified by the kernel.
    204 
    205 The installation script goes through the following phases:
    206 
    207 	- determination of the disk to install NetBSD on
    208 	- checking of the partition information on the disk
    209 	- creating and mounting the NetBSD filesystems
    210 	- setup of IP configuration
    211 	- extraction of the distribution tar files
    212 	- installation of boot programs
    213 
    214 
    215 Now try a reboot.  (If needed, swap your scsi id's first).  Initially
    216 I'd suggest you "boot sd()netbsd -bs", then try multiuser after that.
    217 if you boot single-user the NetBSD incantation to make the root
    218 filesystem writable is
    219 
    220     netbsd# mount -u /dev/sd0a /
    221 
    222 The Sun monitor normally tries to load a file called "vmunix". On
    223 OpenBOOT ROM systems you can change it to load NetBSD instead using
    224 the following commands:
    225 
    226 On version 1 OpenBOOT ROMs:
    227     >n
    228     ok setenv boot-from sd(0,0,0)netbsd
    229     ok
    230 
    231 On version 2 OpenBOOT ROMs:
    232     ok setenv boot-file netbsd
    233     ok setenv boot-device /sbus/esp/sd@0,0
    234 
    235 
    236 Congratulations, you have successfully installed NetBSD RELEASE.  When you
    237 reboot into NetBSD, you should log in as "root" at the login prompt.
    238 There is no initial password, but if you're using the machine in a
    239 networked environment, you should create yourself an account and
    240 protect it and the "root" account with good passwords.
    241 
    242 Some of the files in the NetBSD RELEASE distribution might need to be
    243 tailored for your site.  In particular, the /etc/sendmail.cf file will
    244 almost definitely need to be adjusted, and other files in /etc will
    245 probably need to be modified.  If you are unfamiliar with UN*X-like
    246 system administration, it's recommended that you buy a book that
    247 discusses it.
    248 
    249 
    250 
    251 Installing from SunOS.
    252 
    253 You need a SunOS machine to install NetBSD.  You also need at
    254 least the following pieces:
    255 
    256     the *.tar.gz files you want to install (as a minimum, base.tar.gz)
    257     gzip (GNU gzip) SunOS binary
    258     gtar (GNU tar) SunOS binary
    259     the "install.sh" script
    260     a "/boot" file from a SunOS machine that matches your machine type
    261 	(e.g. sun or sun4c)
    262     a kernel, most likely "/netbsd"
    263 
    264 All these pieces, except "/boot", are supplied in the NetBSD/sparc
    265 distribution.
    266 
    267 You need to format and partition the disk using SunOS (since
    268 NetBSD/sparc uses SunOS disk labels.)  Give yourself adequate
    269 partition sizes.  Here is an example layout:
    270 
    271     partition    size   offset	  will be..
    272     sd2a        28140        0	  /
    273     sd2b        16170    28140	  swap
    274     sd2c       204540        0	  `whole disk'
    275     sd2g       160230    44310	  /usr
    276 
    277 BTW, These are not recommended sizes.  They simply match the first
    278 (tiny) disk that NetBSD/sparc ran on.
    279 
    280 Use SunOS to newfs the partitions which will have filesystems on them.
    281 (NetBSD's filesystem format is identical to SunOS).
    282 
    283     sunos# newfs /dev/rsd2a
    284     [... lots of output]
    285     sunos# newfs /dev/rsd2g
    286     [... lots of output]
    287 
    288 NOTE: If you are able to, there is a performance benefit from
    289 newfs'ing using NetBSD.  If you newfs using the NetBSD newfs command,
    290 be sure to use the -O flag for your / partition, so that newfs will
    291 use the 4.3BSD filesystem format, rather than the new 4.4BSD filesystem
    292 format.  If you forget, you will not be able to boot -- the SunOS boot
    293 blocks do not understand the extended 4.4BSD filesystem format.
    294 
    295 Mount those partitions in a tree formation, under /mnt; ie:
    296 
    297     sunos# df
    298     Filesystem            kbytes    used   avail capacity  Mounted on
    299     [...]
    300     /dev/sd2a              11501       0   11501     0%    /mnt
    301     /dev/sd2g             179529       0  179529     0%    /mnt/usr
    302 
    303 Place a standard SunOS "/boot" program in /mnt (your new root
    304 partition), and use the SunOS command "installboot" to make it work.
    305 The installboot man page says to do something like this:
    306 
    307     sunos# cp /boot /mnt/boot
    308     sunos# /usr/mdec/installboot -vlt /mnt/boot /usr/mdec/bootsd /dev/rsd2a
    309 
    310 You can now extract the provided "*.tar.gz files onto your disk.  The
    311 provided script, "install_from_sunos.sh" will help you:
    312 
    313     sunos# ls -FC
    314     base.tar.gz      etc.tar.gz       man.tar.gz       secr.tar.gz
    315     comp.tar.gz      games.tar.gz     misc.tar.gz      text.tar.gz
    316     install.sh       netbsd.id3_scsi
    317     sunos# ./install_from_sunos.sh
    318     [...]
    319 
    320 This script NEEDS gzip and gtar (GNU gzip and GNU tar) on your
    321 execution path!  The tar files are in a "new format" that includes
    322 directory information, and SunOS tar will not read them.  Statically
    323 linked versions of these programs for SunOS are supplied in the
    324 distribution.
    325 
    326 After the files have been extracted, repair /mnt/etc/fstab to match
    327 your actual disk layout.  (Minus the "/mnt" component of each path, of
    328 course :-)
    329 
    330 Now proceed to reboot the machine as described above in "Installing
    331 using a diskless setup".
    332