SunOS 4.1 Diskless Installation Guide

Overview

This article documents how to setup a diskless SunOS 4.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). It uses LVM to contain each client in its own logical volume. This allows you to keep a client within the limits of SunOS 4's filesystem reporting limits. This is 2 GB by default and can be extended a bigfs fix.

The bigfs fix is available at tcp4me.com/code/bigfs.tar.gz

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 and may come up in SunOS.

  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

  6. time

The rdate command is executed by default when SunOS 4.1 is booted. Rdate uses the time protocol, which will overflow on Februrary 7. 2036. If you plan on using rdate after that date, set the boot server's date to somewhere before this. Due to Y2K and other date issues, use dates in the 1980s through 1990s.

Network Setup

SunOS 4 predates the use of classless routing (CIDR), which means that care has to be taken when setting up clients on a modern network. Even with a CIDR fix, SunOS 4 will have issues booting if the network configuration is not what it is expecting. A disk install of SunOS with the CIDR fix will work on modern networks, but will fail on diskless clients. This is because the bootparam client would have be updated to accept a custom netmask.

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 SunOS 4.1.4 is about 200MB. 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 SunOS 4.1 ISO. You can also use the tape files, but will need change the commands below.

    mount /dev/vnd0a /cdrom

  2. Setup the client's root filesystem and swap file.

    cd /home/client

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

    mkdir -p usr/kvm

    tar -xvpf /cdrom/export/exec/proto_root_sunos_4_1_4

    cd /home/client/usr

  3. Install the common OS packages.

    for x in /cdrom/export/exec/sun4_sunos_4_1_4/*

    do

    tar -xpf $x

    done

    tar -xpf /cdrom/export/share/sunos_4_1_4/manual

  4. Install the architecture specific packages. sun4c is used here. The other options are sun4 (original SPARC 4/XXX devices) or sun4m. 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 kvm

    tar -xpf /cdrom/export/exec/kvm/sun4c_sunos_4_1_4/kvm

    tar -xpf /cdrom/export/exec/kvm/sun4c_sunos_4_1_4/sys

  5. Edit the etc/hosts file.

    cd ../../

    cat << EOF >> ./etc/hosts

    172.16.1.1 server

    172.16.1.22 client

    EOF

  6. Create the /dev entries. The pty0 line is needed in order to login remotely to the machine.

    cd dev

    sed -i 's|^PATH=|PATH=/sbin:|g' MAKEDEV

    ./MAKEDEV std

    ./MAKEDEV pty0

    ./MAKEDEV win

    cd ..

  7. Setup /etc/fstab. The /tmp filesystem is need because socket files created on NFS file systems will not work correctly. This causes errors when starting OpenWindows, X11, or applications that put socket files in /tmp. Make sure to remove the # before mount /tmp in etc/rc.local so that /tmp will be mounted correctly.

    echo 'server:/home/client/ / nfs rw 0 0' > etc/fstab

    echo 'server:/home/client/usr /usr nfs rw 0 0' >> etc/fstab

    echo 'swap /tmp tmp rw 0 0' >> etc/fstab

  8. Copy critical files to sbin and the kernel to the root directory

    cp usr/kvm/boot/* sbin

    cp usr/kvm/stand/sh sbin

    cp usr/bin/hostname sbin

    cp usr/kvm/stand/vmunix .

  9. Copy the bootloader to /tftpboot. As before, this file is architecture-specific.

    cp usr/kvm/stand/boot.sun4c /tftpboot

  10. 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.

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

    cd /tftpboot

    ln -s boot.sun4c AC100116.SUN4C OR cp boot.sun4c AC100116.SUN4C

  12. Copy in any relevant patches or fixes into the /home/client directory and unpack them so that they be worked in the next section.

  13. Boot to Single User Mode so that you can apply pathes and recompile the kernel.

    boot net -s

  14. Apply the NFS Jumbo Patch 102394. The number after the - is a revision, so any version can be used. The instructions are provided in the README.

  15. Apply any other patches as needed.

  16. Compile a new kernel. For diskless clients, the DS (Diskless) config is useful. Make sure that the tmpfs device is configured in the kernel as well.

    cd /sys/`arch -k`/conf

    config DS

    cd ../DS

    make

    cp /vmunix /vmunix.save

    cp vmunix /vmunix

    reboot