FreeBSD/sparc64 5.0-CURRENT Installation Instructions The FreeBSD Project Copyright (c) 2000, 2001, 2002 by The FreeBSD Documentation Project ---------------------------------------------------------------------- This article gives some brief instructions on installing FreeBSD/sparc64 5.0-CURRENT. Please keep in mind that this port is a work in progress, and as such, the installation procedure is much more involved than FreeBSD/i386 or FreeBSD/alpha. ---------------------------------------------------------------------- 1 Installing FreeBSD This text describes how to install and boot the sparc64 port. Users of this port are encouraged to subscribe to the freebsd-sparc mailing list. Warning: The kernel and userland binaries mentioned below are highly experimental (for example, the kernel contains some ATA changes and eeprom handling code which could potentially be dangerous). Unless you know what you are doing and are willing to cope with any damage that might arise, you should probably not be trying this! So, use at your own risk! ---------------------------------------------------------------------- 1.1 Preparations. 1.1.1 Downloading Required Files If you are not installing from a CD-ROM, you will need to download some files via ftp (the URLs are given below). The links in this document point to the main FreeBSD FTP server. Please use a mirror instead if possible. ---------------------------------------------------------------------- 1.1.2 Getting to the PROM Prompt Most sparc64 systems are set up to boot automatically from disk; to install FreeBSD, you need to boot over the network or from a CD-ROM, which requires you to break into the PROM. To do this, reboot the system, and wait until the boot message appears. It depends on the model, but should look about like: Sun Blade 100 (UltraSPARC-IIe), Keyboard Present Copyright 1998-2001 Sun Microsystems, Inc. All rights reserved. OpenBoot 4.2, 128 MB memory installed, Serial #51090132. Ethernet address 0:3:ba:b:92:d4, Host ID: 830b92d4. If your system proceeds to boot from disk at this point, you need press L1-A or Stop-A on the keyboard, or send a BREAK over the serial console (using for example ~# in tip and cu, refer to their manual pages for more details) to get to the PROM prompt. It looks like ok or ok {0} (on SMP systems). ---------------------------------------------------------------------- 1.2 Installing from CD-ROM Place the CD-ROM into your drive, and break into the PROM as described above. On the PROM prompt, type boot cdrom. The system should boot into single-user mode now, and you can create a root file system and install the base system archive as described below. ---------------------------------------------------------------------- 1.3 Installing over the Network 1.3.1 Configuring the Netboot Server A sparc64 kernel is booted by having the firmware retrieve and execute a loader, which in turn fetches and executes the actual kernel. For this boot process, you need to set up rarpd and tftpd (for the firmware) and bootpd (for the loader) on another networked system. The loader can fetch a kernel using TFTP or NFS. All of this is covered in detail below. ---------------------------------------------------------------------- 1.3.1.1 rarpd You need to the Ethernet address of your sparc64 system to /etc/ethers on the netboot server. An entry looks like: 0:3:ba:b:92:d4 your.host.name The ethernet address is usually displayed in the boot message. Make sure your.host.name is in /etc/hosts or has a valid DNS entry (or use an IP). Then, start rarpd on a network interface that is on the same segment as the sparc64 system. For example, if you were using a the first xl network card, you would type rarpd xl0. ---------------------------------------------------------------------- 1.3.1.2 tftpd Activate tftp in your inetd configuration by uncommenting the following line in your /etc/inetd.conf: tftp dgram udp wait nobody /usr/libexec/tftpd tftpd /tftpboot You will then need to download a FreeBSD/sparc64 loader for tftpd to serve to your sparc64 client. There are currently two loaders to choose from: * ftp://ftp.FreeBSD.org/pub/FreeBSD/development/sparc64/loader-tftp.gz - (for loading the kernel over TFTP). * ftp://ftp.FreeBSD.org/pub/FreeBSD/development/sparc64/loader-nfs.gz - (for loading the kernel via NFS). Copy the unpacked loader to /tftpboot, and name it after host IP in upper-case hexadecimal notation without dots (or use symlinks). For example, your setup may look like this, for an IP of 192.168.0.16: lrwx------ 1 tmm users 9 Jul 24 17:05 /tftpboot/C0A80010 -> boot/loader -rw-r--r-- 1 tmm users 1643021 Oct 20 18:04 /tftpboot/boot/loader If you have trouble booting, it is very helpful to use tcpdump to monitor the TFTP requests. This will allow you to see the file name you need to use for the loader. Error replies by the TFTP server are most often due to incorrect file permissions. ---------------------------------------------------------------------- 1.3.1.3 Setting up bootpd/dhcpd If you are going to use bootpd, create entries for you sparc64 system in /etc/bootptab: .default:\ :bf="kernel":dn=local:ds=:\ :gw=:ht=ether:hd="/tftpboot/boot/kernel":hn:\ :sa="":\ :rp=":":\ :sm= :\ ha=:ip=:tc=.default The Ethernet address must be the same like the one in the TFTP example above, but it is specified differently: also in hexadecimal notation, but without colons (for the example above, this would be 0003ba0b92d4). NFS/TFTP specific entries can be ommitted if the given method is not used. The strings given in the bf and hd properties are assembled to the boot file name. If your kernel is named differently or you use another directory, change these values as required. If you are booting using NFS, remove the bf and hd settings (or change them to specify the directory and file inside the NFS root hierarchy in which the kernel will reside). The name of the host entry is conventionally the host name without the domain appended. Note that bootpd conflicts with dhcpd. dhcpd can also be set up accordingly, with an entry like the following (for dhcpd 2.x): host { hardware ethernet ; option host-name ""; fixed-address ; always-reply-rfc1048 on; filename "kernel"; option root-path ":"; } The filename option corresponds to the concatenation of bf and hd above. The ethernet address is specified in hexadecimal with colons, just like in the rarpd example above. options root-path corresponds to rp. If the name given in option host-name is resolvable, i.e. has DNS entry or is associated with an address in /etc/hosts, the fixed-address specification can be ommitted. ---------------------------------------------------------------------- 1.3.1.4 Loading the Kernel over TFTP Place the kernel in the directory specified using bf and hd in the bootpd propertiess or the corresponding dhcpd options as described above. That should be all that is needed. ---------------------------------------------------------------------- 1.3.1.5 Loading the kernel over NFS Export the root directory that was specified in bootp over NFS, and place the kernel as boot/kernel/kernel inside it (or, if you use bf and hd or the dhcpd equivalent, the file name you have specified this way). ---------------------------------------------------------------------- 1.3.2 Booting If all goes well, you can now boot the kernel from the sparc64 by dropping into OpenFirmware as described above. Now, just type boot net and the system should boot. Specifically, the loader is retrieved via TFTP, it does then do a bootp request and will proceed to load the kernel. Then, it should wait 10 seconds for user input and proceed to execute the kernel. If something does not work in between, and you suspect TFTP/NFS/bootp problems, ethereal is usually a good help. The most common problems are bad file permissions. Also note that rarpd will not answer to packets under some circumstances, refer to the manual page for details. ---------------------------------------------------------------------- 1.4 Creating a Disk Label The kernel supports the Sun disk label format, so you can label the disks you want to use with FreeBSD from Solaris. FreeBSD disk labels must currently be created by hand, as sysinstall is not yet available on sparc64. Plese refer to the handbook for more information about labels and special partitions. On sparc64, a Sun compatability label is embedded in the FreeBSD label; this is needed for the PROM to boot from disk. This imposes an additional restriction on the disk label format: partitions are required to start on a cylinder boundary. To create a disk label, the following procedure is the easiest: First, use: # disklabel -w -r auto This will create a basic disk label. The third argument you need specify here is just the name of the device, not the complete path to the device node (e.g. ad0 for the first ATA disk). Now, use: # disklabel -e auto This will open an editor in which you can edit the disk label. The information presented to you should look like: # /dev/ad6c: type: unknown disk: amnesiac label: flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 16 sectors/cylinder: 1008 cylinders: 79780 sectors/unit: 80418240 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 bps/cpg] c: 80418240 0 unused 0 0 # (Cyl. 0 - 79779) You can now add new partitions in the same format as the already present line. Using * in the offset field makes the procedure easier; please refer to the manual page for more information. To make sure the restriction mentioned above is met, the size of each partition must be a multiple of the number of sectors per cylinder as shown in the information that is presented in the editor (1008 in the example above). When you are done, quit the editor. This will cause the disk label to be written. Warning: This procedure will overwrite any disk label that may be already present on the disk. This will make file systems already existing on this disk unaccessible, unless the respective partitions in the old and new label match exactly! Use disklabel -B if you want to make disk bootable for FreeBSD/sparc64. Warning: Using disklabel -B on a disk will overwrite any preexisting boot block, so it will likely render any other operating system installed on the same disk unbootable. If you do not want to overwrite the boot block, it is possible to load the loader via TFTP as described above, but have it boot the kernel from disk. This requires a special loader binary, which is available at ftp://ftp.FreeBSD.org/pub/FreeBSD/development/sparc64/loader-ufs.gz ---------------------------------------------------------------------- 1.5 Root File Systems If you do not want to boot over the network, you will need to create a root file system to hold the base system binaries and configuration files (and optionally other file systems mounted in places like /usr and /var). The kernel contains support for Sun disklabels, so you can use Solaris disks, which may even be newfs'ed from Solaris. NetBSD disk labels and file systems are also usable from FreeBSD. Warning: DO NOT run Solaris fsck on file systems modified by FreeBSD, it will damage the file permissions! To create file systems and to install the base system, boot from CD-ROM or via NFS and create a disk label as described above. When booting the first time and you have not entered your root parition into /etc/fstab yet, you may need to specify your root partition partition on the mountroot prompt when booting (use a format like ufs:, i.e. leave the slice specification out). If the kernel does automatically attempt to boot from another file system, press a key a key other than enter on the loader prompt: Hit [Enter] to boot immediately, or any other key for command prompt. Then, boot the kernel using boot -a -s, which will cause the kernel to ask you for the root partition and then boot into single-user mode. Once the root file system has been entered into /etc/fstab, it should be automatically mounted as /on the next boot. If you are booting over the network (via NFS), the above bootp entries should suffice to have the kernel find and mount the root file system via NFS. ---------------------------------------------------------------------- 1.6 Base System A tar archive which contains almost all binaries and configuration files from the base system is available at ftp://ftp://ftp.FreeBSD.org/pub/FreeBSD/development/sparc64/distrib.tar.gz. Unpack it to the directory that will serve as root directory of the sparc64 system (on the NFS server when booting over the network). This should be sufficient to boot into multi-user mode. The system can then be configured like any other FreeBSD system. You probably will want to edit /etc/fstab and /etc/rc.conf and to set a root password first. Note that some programs from the base system may not be present in the archive, or may not work properly yet. ---------------------------------------------------------------------- This file, and other release-related documents, can be downloaded from ftp://current.FreeBSD.org/pub/FreeBSD/. For questions about FreeBSD, read the documentation before contacting . All users of FreeBSD 5-CURRENT should subscribe to the mailing list. For questions about this documentation, e-mail .