User:Hxp/Sparc Netboot
Work in progress
This is a guide on how to boot a sparc64 machine from the network for the purpose of installing FreeBSD. Much of this would also be useful in setting up a diskless workstation, or for booting pretty much any other OS for sparc64.
Contents |
The Boot Process
- Openboot will send out RARP requests for an IP address.
- When a rarpd server responds to the request, Openboot will then use TFTP to request a loader from the same machine that answered the RARP request.
- The tftpd server provides the loader, which Openboot then executes.
- In the case of the FreeBSD bootloader, it will then perform a DHCP request.
- The DHCP server responds with the IP address of the Sun box, and the location of the root file system on NFS.
- The loader loads the kernel from NFS and boots it.
So, that's pretty complicated. What's necessary on the server side is the following:
- rarpd to give the firmware its initial IP address.
- tftpd to transfer the bootloader.
- dhcpd to give the bootloader the location of the kernel and root file system.
- NFS to serve up the FS and kernel.
I used FreeBSD 9.0 for amd64 in a VM with bridged networking to install FreeBSD 9.0 for sparc64, but other combinations should work. In theory, any OS which can provide those four services can be the netboot server, including other BSDs, Linux, Mac OS X and even Windows but the configuration of those is beyond the scope of this article.
It's important for the machine to be on the same physical network -- rarpd in particular will not pass through routers. Modern PCs with Gigabit ethernet can be connected directly port-to-port with the Sun box and will enable crossover automatically.
Edit /etc/hosts
The first thing you should do is assign an IP on your network for your sparc box in /etc/hosts:
::1 localhost localhost.my.domain 127.0.0.1 localhost localhost.my.domain 192.168.2.2 sparky
Have a copy of FreeBSD for sparc64 handy
Mount FreeBSD-9.0-RELEASE-sparc64-disc1.iso at /cdrom or some similarly convenient location. Extracting the contents to a directory will also work.
Setting up rarpd
Rarpd listens for requests on an interface for IPs then responds based on what is in the file /etc/ethers. /etc/ethers has a very simple format of <ethernet address> <ip>. You can get the ethernet address of your device from Openboot on startup or by running the command .enet-addr at the Ok prompt. Create /etc/ethers with the ethernet address of your Sun box.
ff:ee:00:57:9d:8a sparkyAdd
rarpd_enable="YES"to /etc/rc.conf and start it with
/etc/rc.d/rarpd start
Setting up TFTP
On FreeBSD tftpd is part of inetd. Edit /etc/inet.d so that the tftp line is uncommented.tftp dgram udp wait root /usr/libexec/tftpd tftpd -l -s /tftpbootMake sure
inetd_enable="YES"is in /etc/rc.conf and make sure to start or restart inetd so that the configuration change registers.
Make the directory /tftpboot and copy the FreeBSD bootloader there.
# mkdir /tftpboot # cp /cdrom/boot/loader /tftpboot
The Sun box will request a file equivalent to the assigned IP address from rarpd in hexadecimal. Some sun4c and sun4m machines require HEXIP.SUN4C or HEXIP.SUN4M, respectively. Check what the machine requests using Wireshark if you're not certain. Use sipcalc (available in ports) or a similar tool:
# sipcalc 192.168.2.2 -[ipv4 : 192.168.2.2] - 0 [CIDR] Host address - 192.168.2.2 Host address (decimal) - 3232236034 Host address (hex) - C0A80202 Network address - 192.168.2.2 Network mask - 255.255.255.255 Network mask (bits) - 32 Network mask (hex) - FFFFFFFF Broadcast address - 192.168.2.2 Cisco wildcard - 0.0.0.0 Addresses in network - 1 Network range - 192.168.2.2 - 192.168.2.2 -
The hexadecimal IP for the Sun machine in this example is C0A80202. Link the firmware to that filename.
# ln -s /tftpboot/loader /tftpboot/C0A80202