FreeBSD/sparc64 5.0-CURRENT Installation Instructions

The FreeBSD 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 for 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 porting 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.

Unlike FreeBSD/i386 or FreeBSD/alpha, there is no version of sysinstall(8) for FreeBSD/sparc64. The installation procedure consists of loading a kernel (either from CDROM or the network) onto the sparc64 machine, with a root filesystem on CDROM or exported via NFS. The utilities on the root filesystem can then be used to partition the local disk on the sparc64 machine and optionally to copy the FreeBSD distribution to the local disk to make a stand-alone machine.


1.1 Preparation

Currently, there are two ways to install FreeBSD/sparc64 on a new machine. By far the easier of the two is to install from CDROM; this method allows you to install FreeBSD without any dependencies on any other computers.

If installing from CDROM is impossible or undesirable, the alternative is to install over the network. This requires another machine, suitably configured, to serve the boot loader, kernel, and root filesystem to the new machine, via a combination of RARP, TFTP, and either BOOTP or DHCP. This netboot server can be another FreeBSD machine, but is not required to be.

You will need to decide which of these methods you want to use for installation, as this will determine the set of files you need to download (if any), as well as the steps required to do the installation.


1.1.1 Downloading Required Files

This section describes the files you will need for a FreeBSD/sparc64 installation. The links in this document point to the main FreeBSD FTP server. Please use a mirror site instead if possible.

Important: The URLs in this section are provisional and subject to change. Please see the archives of the FreeBSD SPARC porting mailing list for the most recent locations of files. This notice will be removed when more permanent URLs have been determined.


1.1.1.1 Required Files for CDROM Installation

If you want to do a CDROM installation, an ISO image with a snapshot of FreeBSD/sparc64 can be found at ftp://ftp.FreeBSD.org/pub/FreeBSD/development/sparc64/. This file can be used to create a bootable CDROM which contains everything necessary to boot and load at least a minimal FreeBSD installation.


1.1.1.2 Required Files for Network Installation

For a network installation, you will need several files. First, you will need to download a FreeBSD/sparc64 loader for tftpd(8) to serve to your sparc64 client. The loader will use either TFTP or NFS to retrieve the FreeBSD kernel from the netboot server. There is a separate loader for each of these methods (i.e. a loader for TFTP and a loader for NFS). You should download one of the following files, as appropriate:

A network installation also requires a kernel to be served to the netboot client. A suitable kernel can be found at ftp://ftp.FreeBSD.org/pub/FreeBSD/development/sparc64/.

Finally, you will need a tar(1) archive which contains the binaries and configuration files from the base system. This file is available from ftp://ftp.FreeBSD.org/pub/FreeBSD/development/sparc64/distrib.tar.gz.


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 CDROM, which requires you to break into the PROM (OpenFirmware).

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 to press L1+A or Stop+A on the keyboard, or send a BREAK over the serial console (using for example ~# in tip(1) or cu(1)) to get to the PROM prompt. It looks like this:

    ok         (1)                        
    ok {0}     (2)              
(1)
This is the prompt used on systems with just one CPU.
(2)
This is the prompt used on SMP systems, the digit indicates the number of the active CPU.

1.2 Installing from CDROM

Place the CDROM 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 the disk label and install the base system archive as described in Section 1.4 and Section 1.5.


1.3 Installing over the Network

1.3.1 Configuring the Netboot Server

A FreeBSD/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(8) and tftpd(8) (for the firmware) and bootpd(8) (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 add the Ethernet address of your FreeBSD/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 address). Then, start rarpd(8) on a network interface that is on the same subnet as the FreeBSD/sparc64 system.


1.3.1.2 tftpd

Activate tftpd(8) in your inetd(8) configuration by uncommenting the following line in /etc/inetd.conf:

    tftp dgram udp  wait nobody /usr/libexec/tftpd tftpd /tftpboot

Copy the unpacked loader to your /tftpboot directory, and name it with the FreeBSD/sparc64 host's IP address in upper-case hexadecimal notation without dots (or use appropriately-named symbolic links). For example, your setup may look like this, for an IP address 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(1) 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

You can use either BOOTP or DHCP (both not both) to provide some parameters to the boot loader, such as a machine's IP address. If you are using another FreeBSD machine as a netboot server, the BOOTP functionality is provided by bootpd(8), which is a part of the FreeBSD base system. Several DHCP servers are provided in the FreeBSD Ports Collection.

If you are going to use bootpd(8), create entries for your FreeBSD/sparc64 system in the server's /etc/bootptab (see bootptab(5) for more details):

    .default:\
      :bf="kernel":dn=local:ds=name-server-ip-address:\
      :gw=gateway-ip-address:ht=ether:hd="/tftpboot/boot/kernel":hn:\
      :sa="tftp-server-ip-address":\
      :rp="tftp-server-ip-address:nfs-root-directory":\
      :sm=ip-netmask
    
    name-of-the-entry:\
      ha=sparc64-ethernet-address:ip=sparc64-ip-address:tc=.default

The Ethernet address must be the same as the one in the TFTP example above, but it is specified hexadecimal notation without colons (for the example above, this would be 0003ba0b92d4). NFS/TFTP specific entries can be omitted if the given method is not used. The strings given in the hd and bf properties are concatenated to give 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.

For a DHCP server, add an entry similar to the following to your dhcpd.conf file. An example entry for ISC DHCP version 2 (available in the FreeBSD Ports Collection as net/isc-dhcp2) is shown below:

    host name-of-entry {
      hardware ethernet sparc64-ethernet-address;
      option host-name "sparc64-fully-qualified-domain-name";
      fixed-address sparc64-ip-address;
      always-reply-rfc1048 on;
      filename "kernel";
      option root-path "tftp-server-ip-address:nfs-root-directory";
    }

The filename option corresponds to the concatenation of hd and bf in /etc/bootptab. The Ethernet address is specified in hexadecimal with colons, just like in the rarpd(8) example above. options root-path corresponds to rp in /etc/bootptab. If the name given in option host-name is resolvable, i.e. has a DNS entry or is associated with an address in /etc/hosts, the fixed-address specification can be omitted.


1.3.2 Loading the Kernel

With the daemons on the netboot server configured, the next step is to copy the kernel (obtained during the steps of Section 1.1.1) to an appropriate directory. There are two ways of retrieving a kernel over the network: TFTP and NFS. (You specified one of these two alternatives by picking a loader.)

For both TFTP and NFS, the loader will use the parameters that it obtained via BOOTP or DHCP to find the kernel.


1.3.2.1 Loading the Kernel over TFTP

Place the kernel in the directory you specified using bf and hd in the /etc/bootptab or the filename parameter to dhcpd.conf.


1.3.2.2 Loading the Kernel over NFS

Export the directory that was specified by the rp property in /etc/bootptab or the root-path parameter in dhcpd.conf (see exports(5)). Copy the kernel to the directory you specified using bf and hd in the /etc/bootptab or the filename parameter to dhcpd.conf.


1.3.3 Loading the Base System to the Netboot Server

You must extract the base system distribution image to the NFS root directory specified either by the rp option in /etc/bootptab or the root-path option in dhcpd.conf. This directory tree will become the sparc64's root filesystem once the kernel is booted. Besides providing a normal userland environment, it also contains all of the necessary utilities for you to install the distribution on the sparc64 client's local disk.

Using whatever editing tools you have on the netboot server, you probably will want to edit the sparc64's /etc/fstab and /etc/rc.conf and set a root password.


1.3.4 Booting

If all goes well, you can now boot the FreeBSD on your sparc64 machine by dropping into the PROM prompt as described in Section 1.1.2. Now, just type boot net and the system should boot. Specifically, the loader is retrieved via TFTP, it then does a BOOTP request and will proceed to load the kernel (either using TFTP or NFS, depending on your choice of loader). 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 (available in the FreeBSD Ports Collection as net/ethereal) is usually helpful. The most common problems are related to bad file permissions. Also note that rarpd(8) 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(8) is not yet available on FreeBSD/sparc64. Please refer to the FreeBSD Handbook for more information about labels and special partitions.

On FreeBSD/sparc64, a Sun compatibility 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:

  1. Run disklabel -w -r device auto to 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).

  2. Use disklabel -e device to 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 disklabel(8) 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, save your changes and 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. Any existing filesystems on this disk must have their respective partition entries in the old and new label match exactly, or they will be lost.

  3. Use disklabel -B if you want to make the 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 Creating the Root Fileystem

If you want to boot from a local disk, you will need to create a root filesystem to hold the base system binaries and configuration files (and optionally other filesystems mounted in places such as /usr and /var).

The kernel contains support for Sun disklabels, so you can use Solaris disks, which may even be prepared using newfs under Solaris. NetBSD disk labels and filesystems are also usable from FreeBSD.

Warning: Do not run Solaris fsck on filesystems modified by FreeBSD. Doing so will damage the file permissions.

To create filesystems and to install the base system, boot from CDROM or via NFS and create a disk label as described in Section 1.4.

When booting the first time and you have not entered your root partition into /etc/fstab yet, you may need to specify your root partition on the mountroot prompt when booting (use a format like ufs:diskpartition, i.e. leave the slice specification out). If the kernel does automatically attempt to boot from another filesystem, press 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 filesystem 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 filesystem via NFS.


1.6 Installing the Base System

If you booted the kernel from the network, you downloaded a tar(1) archive with the base system and exported it from the netboot server via NFS. You can unpack this same archive to your local disk to create a stand-alone system (remember to copy the kernel over as well).

If you booted from CDROM, the same archive is available in /root/ on the CDROM.

Before booting the system stand-alone, you will want to edit /etc/fstab and /etc/rc.conf and set a root password.

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://ftp.FreeBSD.org/pub/FreeBSD/development/sparc64/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.

All users of FreeBSD 5-CURRENT should subscribe to the <current@FreeBSD.org> mailing list.

For questions about this documentation, e-mail <doc@FreeBSD.org>.