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