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.
TFTP
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.
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.
FTP
telnet
rlogin
rsh
rexec
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.
10/8 - 255.0.0.0 (/8)
172.16/12 - 255.255.0.0 (/16)
192.168/16 - 255.255.255.0 (/24)
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.
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)
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
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/
Remove the miniroot's opt and usr because they point to another location.
cd /home/client
rm -rf usr opt
Copy over the CD-ROM's miniroot /usr directory
cd /cdrom/export/exec/sparc.Solaris_*
find . -print | cpio -dumpv /home/client/usr
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
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 ../../
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 -
Update the etc/netmasks file.
echo '172.16.1.0 255.255.0.0' >> etc/netmasks
Create the hostname.
echo '172.16.1.23 netmask 255.255.0.0 up' >> etc/hostname.le0
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
Edit the etc/hosts file.
cat << EOF >> ./etc/hosts
172.16.1.1 server
172.16.1.22 client
EOF
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
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.
Using the hexnumbers, make a symlink or copy the boot.sun4
cd /tftpboot
ln -s inetboot AC100116.SUN4M OR cp inetboot AC100116.SUN4M
Boot the Solaris miniroot into single user mode.
boot net kernel/unix -s
Start the KornShell shell.
ksh
Set the terminal to be a VT100.
TERM=vt100
export TERM
Enter the Solaris package directory
cd Solaris_*
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
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
Install the packages to /a.
list=$(<list)
pkgadd -na admin_file -R /a -d . $list
Halt the machine.
halt -q
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
Move the contents of /a to the /home/client directory.
cd a
mv * ../
cd ../
rm -rf a
Edit the etc/hosts file.
cat << EOF >> ./etc/hosts
172.16.1.1 server
172.16.1.22 client
EOF
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 -
Boot the client machine to Solaris. The machine will then prompt for the user terminal and then configure the box.
boot net kernel/unix