Netbooting and NFS root for NetBSD on sparc64
So, you got a sparc64 machine (e.g. a Sun Fire V100) that you want to run
NetBSD on. For ... reasons you want/need to netboot it and run it with a
NFS rootfs. And your hosting environment for all that is mostly Linux.
Well, let me describe what you need.
This is written for Linux hosts running Debian or Ubuntu.
requirements
- rarpd: apt install rarpd
- tftpd: apt install tftp-hpa tftpd-hpa
- dhcpd: apt install isc-dhcp-server
- NFS server: apt install nfs-kernel-server
assumptions
- MAC address of our sparc64 machine: 02:25:45:67:89:01
- hostname of our sparc64 machine: sparc64box
- IP address of our sparc64 machine: 192.168.1.1
- all necessary services hosted on a single Linux machine running
Debian or Ubuntu
Please ensure appropriate name resolution either via local DNS or via
/etc/hosts on the Linux server.
basic sparc64 NetBSD boot process
- At the firmware ok prompt trigger a netboot with:
boot net
- The firmware netboot routine uses RARP (Reverse ARP) to ask
"Hey, this is MAC address, what is my IP address?"
With the answer from that, it sets its IP address and we can do
local networking.
- Next, the firmware tries to load a netboot loader via TFTP from the
RARP server.
- Control is transferred to this netboot loader which continues the
process. We'll assume NetBSD here.
- A DHCP request is issued to get network config and boot config
- Using the provided boot host and NFS path, /netbsd is loaded
and control transferred to it
- Once the kernel has come up, it issues a DHCP request again and then
- Configures the network with that information.
- Mounts, via NFS, the root file system based on the information
in the DHCP answer.
- Starts /sbin/init, which completes the boot process
Putting it all together
RARP
First, install the rarp service via: apt install rarpd. Then
edit /etc/ethers with the following content:
02:25:45:67:89:01 sparc64box
and restart rarpd.
TFTP
DHCP
I'm assuming isc-dhcpd here, if you prefer a different DHCP server, you
need to adjust accordingly. Further, general familiarity with that is
assumed.
- set up a standard DHCP entry for the host, with all the usual settings
(identify host by ethernet address, set router, hostname, ...)
-
To this host entry add the entries we need:
- TFTP server name: option server-name "tftp-server-name";
and next-server tftp-server-name;
- netboot loader file name: option filename "ofwboot";
- NFS root path: option root-path "/nfsroots/sparcbox";
- restart the DHCP server
NFS server
- First, set up the root directory under /nfsroots/sparcbox -
this can be done by either copying an existing installation from
disk (and adjusting /etc/fstab along the way) or just
unpacking the install image, which enables net install
- The NetBSD netboot loader only speaks NFSv2, so we need to enable
support for that:
- Add an entry to /etc/exports for this:
/nfsroots/sparcbox 192.168.1.1/32(rw,sync,subtree_check,no_root_squash)
- Restart the NFS service.
Boot
To boot via the network to an NFS root, power up your sparc64 box to the
OK prompt and initiate the net boot process with: boot net.
Your machine should now boot via the network, mount the NFS root and
complete the boot process. For troubleshooting, tcpdump can be very
useful.
Last modified 2024-03-10 by Alexander Schreiber