.\" $NetBSD: install,v 1.40 2001/06/11 01:50:50 wiz Exp $ .\" .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the NetBSD .\" Foundation, Inc. and its contributors. .\" 4. Neither the name of The NetBSD Foundation nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" . Installing .Nx is a relatively complex process, but if you have this document in hand it shouldn't be too much trouble. .Pp There are several ways to install .Nx onto your system. The easiest way is to use the .Pa miniroot.fs image copied to your local disk's swap partition or a scratch drive. If your Sparc is hooked up in a network, you may configure another .Ul machine as a netboot server for your Sparc. Alternatively, there is a pair of floppy images that will boot your system and run the installer. .Pp For more information on the commands and variables available in the OpenBoot PROM (present in all sun4c and sun4m machines), go to .Lk http://docs.sun.com and search for .Dq openboot reference (without quotes). . .Ss2 Installing NetBSD by placing a bootable filesystem on a partitioned hard drive . .Pa installation/miniroot/miniroot.fs.gz is a compressed, self-contained .Nx filesystem holding all utilities necessary to install .Nx onto a disk attached to your system. It is distributed as a compressed plain file you will transfer to a raw disk partition. You will then boot this installer using the appropriate PROM command. The simplest case is where you place the .Pa miniroot.fs filesystem on the swap partition of your disk. Alternatively, you can place it on any other unused partition on any disk (such as a Zip disk). Be forewarned that you will not be able to install .Nx onto the partition that contains the .Pa miniroot.fs as this partition is needed during the install process. .Pp Loading the filesystem onto a raw partition is straightforward. First, download .Pa miniroot.fs to your system. Next, reboot in single-user mode (i.e. .Ic "boot -s" ) to ensure that your system will not be swapping. Finally, place the .Pa miniroot.fs on your partition of choice. On .Nx or SunOS the commands are: .Pp .Dl # Ic "gunzip miniroot.fs.gz" .Dl # Ic "dd if=miniroot.fs of=/dev/rsd0b bs=4k conv=sync" .Pp Here, .Li /dev/rsd0b is assumed to be your swap partition. If you decide to place .Pa miniroot.fs on a non-swap partition, it will overwrite all of the contents of that partition, but you will not need to reboot into single-user mode to write it. .Pp After transferring the filesystem to disk, bring the system down by: .Pp .Dl # Ic halt .Pp Then boot the installer by typing the appropriate command at the PROM prompt (this example is for the swap partition): .Pp .(tag OpenBoot\ PROM\ 2 -offset indent -compact .It sunmon .Li \*> Ic "b sd(,,1)netbsd -s" .It OpenBoot PROM 1 .Li ok Ic "boot sd(,,1)netbsd -s" .It OpenBoot PROM 2 .Li ok Ic "boot disk:b netbsd -s" .tag) .Pp The monitor boot command will load the .Nx kernel contained in the filesystem image. After the initial probe messages you'll be asked to start the install or upgrade procedure. Proceed to the section .Sx Running the installation scripts. below. . .Ss2 Installing NetBSD by using a bootable CD-ROM . If you wish to burn a CD-R containing a bootable NetBSD installation, then you can either burn the prepared disk image in .Pa installation/cdrom/netbsd-sparc.iso or create your own. If you wish to create your own, you should follow the directions on the .Nx Bootable CD-ROM HOW-TO at: .Lk http://www.netbsd.org/Documentation/bootcd.html#sparcimage .Pp Once you have downloaded .Pa netbsd-sparc.iso or created your own disk image, then you need to burn it to a CD-R. .Pp The CD-ROM attached to your Sparc must support 512 byte sectors to be bootable. All Sun brand CD-ROMs will work, as well as many other manufacturers. See the Sun CD-ROM FAQ: .Lk http://saturn.tlug.org/suncdfaq/ .Pp Sun sets their CD-ROM drives to SCSI ID 6. We recommend you do the same. .Pp Boot the installer by typing the appropriate command at the PROM prompt: .Pp .(tag OpenBoot\ PROM\ 2 -offset indent -compact .It sunmon .Li \*> Ic b "sd(,30,)" .It OpenBoot PROM 1 .Li ok Ic "boot sd(,30,)" .It OpenBoot PROM 2 .Li ok Ic "boot cdrom" .tag) .Pp After the initial probe messages you'll be asked to start the install or upgrade procedure. Proceed to the section .Sx Running the installation scripts. below. . .Ss2 Installing NetBSD by using the bootable floppies . The .Nx install floppies only work on the sun4c and sun4m machines. Making the install floppies is fairly straightforward. .Pp .Nx and SunOS use the same commands. First, get two 1.44 MB floppy disks and format them either using the .Xr fdformat 8 command or a PC. .Pp .Dl # Ic "fdformat" .Pp Be sure that the `fdformat' command completes successfully before proceeding; on .Nx success is a string of all .Sq Li V 's , and on .Tn SunOS success is a string of .Sq Li \&. 's . .Pp Next, transfer the two floppy images .Pq Pa installation/floppy/disk1.gz No and Pa installation/floppy/disk2 to the disks you just formatted. You can do this step from .Nx , .Tn SunOS , or a .Tn Windows machine using .Nm rawrite.exe (available in the NetBSD/i386 distribution). Insert the first floppy and run the following commands: .Pp .Dl # Ic "gunzip disk1.gz" .Dl # Ic "dd if=disk1 of=/dev/rfd0a bs=36k" .Dl # Ic "eject floppy" .Pp Insert the second floppy and run the following commands: .Pp .Dl # Ic "dd if=disk2 of=/dev/rfd0a bs=36k conv=sync" .Dl # Ic "eject floppy" .Pp Be sure to label your floppies so you can later identify them. .Pp Insert the floppy made from .Pa disk1 into your Sparc. From the OpenBoot prompt, boot the floppy with the following command: .Pp .(tag OpenBoot\ PROM\ 2\ (alternate) -offset indent -compact .It OpenBoot PROM 1 .Li ok Ic "boot fd(,,1)" .It OpenBoot PROM 1 (alternate) .Li ok Ic "boot /fd" .It OpenBoot PROM 2 .Li ok Ic "boot floppy" .tag) .Pp After the initial probe messages you'll be asked to insert the floppy labeled .Dq NetBSD disk2 . If the floppy is not automatically ejected, you can either use a straightened paperclip to eject the disk or do the following: .Pp Press the .Key STOP key (sometimes called the .Key L1 key, found on the left side of your keyboard) and the .Key a key, which will halt your system and give you a PROM prompt. .Dl ok Ic "eject" .Dl ok Ic "go" .Pp Now, insert the floppy labeled .Li disk2 . After the installation tools have been loaded, you'll be asked to start the install or upgrade procedure. Proceed to the section .Sx Running the installation scripts. below. . .Ss2 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 .Nx system as the netboot server, have a look at the .Xr diskless 8 manual page for a more detailed guide on how to proceed with this. If the server runs another operating system, you should consult the .Nx Diskless HOW-TO, which will walk you through the steps necessary to configure a netboot server on a variety of platforms. .Lk http://www.netbsd.org/Documentation/network/netboot/ .Pp 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 .Pa 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). .Pp The boot program to use is .Pa installation/netboot/boot.net Alternatively, you can find the bootstrap program in .Pa /usr/mdec/boot.net in the .Nx*M distribution. .(Note The only difference between .Pa /usr/mdec/boot.net and .Pa /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. .Note) .Pp 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. .Pp Finally, this information 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. 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. .Pp . .Ss2 Configuring your netboot server . Follow this section to configure a .Nx machine as your netboot server. We will use .Sq Li CC:CC:CC:CC:CC:CC as the MAC address (ethernet hardware address) of your netboot client machine that you wish to install .Nx on. We use .Sq Li 192.168.1.10 as the IP address of your client, and .Sq Li client.test.net as the name. The server name is .Sq Li server.test.net , and the path on the server to the NFS exported directory is .Pa /export/client/root although you may choose to use a different path. Create an .Pa /etc/ethers file with the following line: .Pp .Dl "CC:CC:CC:CC:CC:CC client" .Pp Add your client to the server's .Pa /etc/hosts file: .Pp .Dl "192.168.1.10 client" .Pp If .Ic rarpd is currently running, restart it (kill -HUP), otherwise start .Ic rarpd : .Pp .Dl # Ic "/usr/sbin/rarpd -a" .Pp Next, create .Pa /etc/bootparams with the following line: .Pp .Dl "client root=server:/export/client/root" .Pp If .Ic rpc.bootparamd is currently running, restart it .Pq Ic "kill -HUP" , otherwise start .Ic rpc.bootparamd : .Pp .Dl # Ic "/usr/sbin/rpc.bootparamd" .Pp Now, make sure the bootloader in .Pa /tftpboot is linked to, or a copy of, .Pa boot.net and is named appropriately for your client (in this case, it would be .Pa C0A8010A.SUN4C ) . .Pp .Dl # Ic "cp boot.net /tftpboot" .Dl # Ic "ln -s /tftpboot/boot.net /tftpboot/C0A8010A.SUN4C" .Pp Now, you should edit .Pa /etc/inetd.conf and make sure that the line starting with .Li tftp is uncommented. You will need to .Ic kill -HUP the .Ic inetd process to enable tftp if this line was previously commented out. The next step is to set up NFS exports. Create the directory you are exporting for the netboot client: .Pp .Dl # Ic "mkdir -p /export/client/root" .Pp Put the following line in .Pa /etc/exports to enable NFS sharing: .Pp .Dl "/export/client/root -maproot=root client.test.net" .Pp If your server is currently running NFS services, you only need to .Ic "kill -HUP" the .Ic mountd process. Otherwise, you need to run: .Pp .Dl # Ic "/usr/sbin/mountd" .Dl # Ic "/usr/sbin/nfsd -tun 4" .Pp Now, you need to place the files your netboot client will need. As noted above in the section .Sx Preparing your System for NetBSD Installation you have several options when choosing a location to store the distribution filesets. However, the easiest way is to put the distribution files into the exported directory for your client on the server. .Pp .Dl # Ic "mv *.tgz /export/client/root" .Pp Your client will need a kernel to boot (use .Pa binary/kernel/netbsd.GENERIC.gz ) . .Pp .Dl # Ic "gunzip netbsd.GENERIC.gz" .Dl # Ic "mv netbsd.GENERIC /export/client/root/netbsd" .Pp Your client will need installation tools (use .Pa installation/netboot/rootfs.tgz ) . .Pp .Dl # Ic "gunzip < rootfs.tgz | (cd /export/client/root && tar -xpf -)" .Pp Now, netboot your Sparc from the server by entering the appropriate .Ic boot command at the monitor prompt. Depending on the PROM version in your machine, this command takes one of the following forms: .(tag OpenBoot\ PROM\ 2 -offset indent -compact .It sunmon .Li \*> Ic "b le()netbsd" .It OpenBoot PROM 1 .Li ok Ic "b le()netbsd" .It OpenBoot PROM 2 .Li ok Ic "b net netbsd" .tag) .Pp After the initial probe messages you'll be asked to start the install or upgrade procedure. Proceed to the section .Sx Running the installation scripts. below. . .Ss2 Installing NetBSD by using a bootable tape . Sun sets their tape drives to SCSI ID 4. We recommend you do the same. .Pp Get the tape images .Pq Pa installation/tape/tapefile1.gz No and Pa installation/tape/tapefile2 and transfer them to a tape. Make sure you use the .Sq no rewind scsi tape device. Run the following commands: .Pp .Dl # Ic "gunzip tapefile1.gz" .Dl # Ic "mt -f /dev/nrst0 rew" .Dl # Ic "dd if=tapefile1 of=/dev/nrst0 bs=4k" .Dl # Ic "dd if=tapefile2 of=/dev/nrst0 bs=4k" .Pp Now you can transfer the .Nx \*V. distribution sets from .Pq Pa binary/sets to the tape by using a series of additional .Dl # Ic "dd if=.tgz of=/dev/nrst0 bs=4k" commands. See also the section .Sx Getting the NetBSD System on to Useful Media. Be sure to mark the location of these files on the tape; you'll need them during the installation procedure. .Pp Insert the tape into your Sparc's tapestation. Boot the installer by typing the appropriate command at the PROM prompt: .Pp .(tag OpenBoot\ PROM\ 2\ (alternate) -offset indent -compact .It sunmon .Li > Ic "b st()" .It OpenBoot PROM 1 .Li ok Ic "boot st()" .It OpenBoot PROM 2 .Li ok Ic "boot tape" .tag) .Pp After the initial probe messages you'll be asked to confirm the tape device and tape file number containing the installation tools. Then, proceed to the section .Sx Running the installation scripts. below. . .Ss2 Running the installation scripts . The first thing that the installation scripts will inquire about is the type of console you're using on your machine. If you're using a Sun frame buffer display, choose the terminal type .Ic sun .Pq this is presented as the default . .(Note if your frame buffer device is a cgsix Sbus board, you should change the terminal type to .Ic sun-cgsix to avoid triggering a bug in the board's firmware code that can garble your screen. .Note) .Pp If you're using a terminal device connected to a serial port, choose a terminal type appropriate for that device, e.g. .Ic vt100 or .Ic vt200 . .Pp Next, you will be presented with a choice of two installation methods: a new full-screen .Ic sysinst program, or the traditional script-based .Ic miniroot program. The .Ic sysinst program is easier to use, but the .Ic miniroot program is more flexible. Both of these installation methods will follow the same set of procedures and will fully install .Nx on your Sparc. .Pp You will frequently be asked for confirmation before the system proceeds with each phase of the installation process. .Pp 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 .Xr 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 compatibility with the Sparc ROM. .Note) .Pp The installation script goes through the following phases: .(bullet -compact determination of the disk on which to install .Nx .It checking/creation of the partition information on the disk .It creating and mounting the .Nx filesystems .It setup of network configuration .It extraction of the distribution tar files .It installation of bootstrap programs .bullet) .Pp Now try a reboot. Initially we'd suggest you .Ic "boot sd()netbsd -bs" , then try multiuser after that. If you boot single-user the .Nx incantation to make the root filesystem writable is .Pp .Dl # Ic "mount -u /dev/sd0a /" .Pp Your PROM might have been setup to instruct the boot program to load a file called .Pa vmunix . On OpenBoot PROM systems you can change it to load .Pa netbsd instead using the following commands: .Pp .(tag OpenBoot\ PROM\ 2 -offset indent -compact .It OpenBoot PROM 1 .Li ok Ic setenv boot-from sd(0,0,0)netbsd .It OpenBoot PROM 2 .Li ok Ic setenv boot-file netbsd .br .Li ok Ic setenv boot-device disk:a .tag) .Pp .Em Congratulations , you have successfully installed .Nx \*V.