Early Solaris Diskless Installation Guide

Overview

This article documents how to setup a diskless early Solaris (2.0 through 2.5.1) machine. It also documents several issues that will come up due to various reasons. These are noticed as the procedure encounters them.

The boot server uses NetBSD 9.2, which is current as of this writing (October 2021).

The server must have the following services available.

  1. TFTP

  2. bootparamd. If the boot server is multi-homed (multiple IP addresses), add the -r option to the bootparams options (e.g bootparamd -s ) so that the traffic is routed properly. This causes unusual errors in Solaris.

  3. NFS v2/v3

You can enable the following services so that the diskless client can interact more with the server. SunOS 4 predates SSH. These plain text protocols can be used on a trusted network.

  1. FTP

  2. telnet

  3. rlogin

  4. rsh

  5. rexec

Network Setup

Early Solaris was when classless routing (CIDR) started to be developed. It was not shipped as part of Solaris until 2.6, which means that care has to be taken when setting up clients on a modern network.

Wikipedia's entry on Classful Networking provides a table of which networks had which subnet masks. RFC1918 networks (10/8, 172.16/12, and 192.168/16) should use the following network masks.

In my case, I have a preexisting network of 192.168.1.1/16, which made the bootparam client have issues because it hard coded itself to a /24 network. The fix was to use the 172.16 network for my diskless clients and setup the NFS/TFTP/bootparamd server and other devices with a 172.16/16 address alias.

Server Setup

A full installation of early Solaris is about 400MB. The Sun recommended setup with shared read-only fileystems maximized available space through symbolic linking and common mount points.

The full client used here uses more disk space, but these sizes are negligible on modern hard drives.

The boot server puts the filesystem for each client under its own directory.

/home/client1

/home/client2

/etc/exports

echo '/home/client -alldirs -maproot=root' >> /etc/exports

/etc/bootparams

echo 'client root=server:/home/client  swap=server:/home/client/swap gateway=server:0xffff0000' >> /etc/bootparams

/etc/ethers

echo '*mac_address* *client*' >> /etc/ethers

/etc/inetd

uncomment out tftpd (optionally telnet,ftp, rsh,rlogin, exec, time, etc)

Client Setup

  1. Mount the Solaris ISO and copy the Solaris_2* package directory

    mount /dev/vnd0a /cdrom

    cd /cdrom

    find -name Solaris_* -print | cpio -dumpv /home/client

  2. Copy over the CD-ROM's miniroot to act as a base for client's root. Solaris 2.5.1's minroot is slightly different and is listed below. Replace X in the command below with your machine's architecture. sun4m is used here. The other options are sun4 (original SPARC 4/XXX devices), sun4c, or sun4u. Consult the Sun Hardware Reference for your device if you are unsure. If the wrong architecture is installed, certain commands will cause a kernel panic.

    cd /home/client

    dd if=/dev/zero of=swap bs=32m count=1

    cd /cdrom/export/exec/kvm/sparc.sun4X.Solaris_* # 2.4 and lower

    cd /cdrom/export/exec/kvm/sparc.Solaris_2.5.1 # 2.5.1 only

    find . -print | cpio -dumpv /home/client/

  3. Remove the miniroot's opt and usr because they point to another location.

    cd /home/client

    rm -rf usr opt

  4. Copy over the CD-ROM's miniroot /usr directory

    cd /cdrom/export/exec/sparc.Solaris_*

    find . -print | cpio -dumpv /home/client/usr

  5. Extract the root prototype cpio archive to /home/client/tmp. There are many files in the miniroot that will point to files in /tmp.

    cd /home/client/tmp

    cpio -dimv < ../root.proto

  6. Copy the files in etc and var to /home/client so that when the miniroot is booted, key files are available.

    cd root

    find etc | cpio -dumpv ../../

    find var | cpio -dumpv ../../

  7. Create the client's /etc/vfstab file.

    cd ../../

    rm etc/vfstab

    vi etc/vstab

    Contents of /etc/vfstab

    /proc - /proc proc - no -

    fd - /dev/fd fd - no -

    swap - /tmp tmpfs - yes -

    server:/home/client - / nfs - yes rw

    server:/home/client/swap - - swap - no -

  8. Update the etc/netmasks file.

    echo '172.16.1.0 255.255.0.0' >> etc/netmasks

  9. Create the hostname. file, which contains the ifconfig to bring up the interface. le0 is used below.

    echo '172.16.1.23 netmask 255.255.0.0 up' >> etc/hostname.le0

  10. Remove the nodename and defaultrouter file and create new ones.

    rm etc/nodename etc/defaultrouter

    echo '172.16.1.1' > etc/defaultrouter

    echo 'tauri' > etc/nodename

  11. Edit the etc/hosts file.

    cat << EOF >> ./etc/hosts

    172.16.1.1 server

    172.16.1.22 client

    EOF

  12. Copy the bootloader to /tftpboot. As before, this file is architecture-specific. Solaris 2.5.1's location for inetboot is slightly different and is listed below.

    cp usr/lib/fs/nfs/inetboot /tftpboot # Solaris 2.4 and below

    cp usr/platform/sun4X/lib/fs/inetboot /tftpboot # Solaris 2.5.1 only

  13. Calculate the hex number for the client's IP address using the bc command. The decimal is given in bold and the hex is in italics.

    obase=16

    172

    AC

    16

    10

    1

    1

    22

    16

    Press Control-D to quit out of bc.

  14. Using the hexnumbers, make a symlink or copy the boot.sun4 file to it.

    cd /tftpboot

    ln -s inetboot AC100116.SUN4M OR cp inetboot AC100116.SUN4M

  15. Boot the Solaris miniroot into single user mode.

    boot net kernel/unix -s

  16. Start the KornShell shell.

    ksh

  17. Set the terminal to be a VT100.

    TERM=vt100

    export TERM

  18. Enter the Solaris package directory

    cd Solaris_*

  19. Create an admin file so that package installation will be silent.

    vi admin_file

    contents of admin_file

    mail=

    instance=unique

    partial=nocheck

    runlevel=nocheck

    idepend=nocheck

    rdepend=nocheck

    space=nocheck

    setuid=nocheck

    conflict=nocheck

    action=nocheck

    basedir=default

  20. Create a package list so that the packages are installed in the correct order. The .m is for the sun4m archtecture. Use .c for sun4c or .u for sun4u

    A=".m"

    while read pkg

    do

    if [ -d ${pkg}$A ];

    then

    pkg="${pkg}$A"

    fi

    echo "${pkg}" >> list

    done < .order

  21. Install the packages to /a.

    list=$(<list)

    pkgadd -na admin_file -R /a -d . $list

  22. Halt the machine.

    halt -q

  23. On the boot server, remove all but the a directory under /home/client. Re-create the swap partition.

    cd /home/client

    rm -rf [b-z]* .[a-z]* Solaris*

    dd if=/dev/zero of=swap bs=32m count=1

  24. Move the contents of /a to the /home/client directory.

    cd a

    mv * ../

    cd ../

    rm -rf a

  25. Edit the etc/hosts file.

    cat << EOF >> ./etc/hosts

    172.16.1.1 server

    172.16.1.22 client

    EOF

  26. Recreate the client's /etc/vfstab file.

    vi etc/vstab

    Contents of /etc/vfstab

    /proc - /proc proc - no -

    fd - /dev/fd fd - no -

    swap - /tmp tmpfs - yes -

    server:/home/client - / nfs - yes rw

    server:/home/client/swap - - swap - no -

  27. Boot the client machine to Solaris. The machine will then prompt for the user terminal and then configure the box.

    boot net kernel/unix