Mac Netboot

From PowerPC Kernel Archives

Contents

Booting NewWorld Macs Over a Network

With the right tools, netbooting Apple's NewWorld PowerPC machines is fairly simple.

Get DHCPD up and running

0) If you already have a DHCP server running, you can skip this section.

1) If your distribution doesn't supply a ready-made package, download the source for ISC's DHCP, version 3.0 or later. With the configuration customization capabilities of dhcpd 3.0+, it is no longer necessary to patch the source.

2) Build DHCP and install it.

3) Download my configuration template for dhcpd (dhcpd.conf), customize it to your needs, and copy it to /etc.

4) Start dhcpd, with debugging turned on, on the proper network interface.

If you prefer reading shell commands:

wget ftp://ftp.isc.org/isc/dhcp/dhcp-3.0.1.tar.gz
tar xzf dhcp-3.0.1.tar.gz
cd dhcp-3.0.1
./configure
make
make install
wget http://hermes.osuosl.org/~tmcnulty/macnb/dhcpd.conf
vim dhcpd.conf #or your favorite editor
cp dhcpd.conf /etc
dhcpd -d eth0

Install TFTPD

This is relatively simple, any decent TFTP server will work.

If your distribution provides a prebuilt TFTP server (such as tftp-hpa), once installed the server might already be setup with inetd. On Ubuntu, the TFTP boot directory is /var/lib/tftpboot.

If your distribution doesn't supply a package, download the tftp-hpa source and install it. However you start tftpd, either standalone, through inetd, or through xinetd, use the following command:

in.tftpd -v -v -v -v -v -s /tftpboot

The numerous -v's tell it to be as verbose as possible, the -s tells it to allow path names relative to its directory, and /tftpboot specifies the directory that will hold your yaboot binary and configuration file, kernel, and ramdisk if necessary.

Note: Some implementations don't support the -v option; if this is the case, just drop it (the server will probably log by default).

Setup the boot files

Install yaboot

1) Download the yaboot binary from the Yaboot page (make sure you get the binary, unless you're on a PowerPC and either a) have a copy of yaboot already or b) want to build it yourself)

2) Decompress the archive and copy the yaboot binary to /tftpboot

3) Download my yaboot configuration (yaboot.conf) and copy it to /tftpboot

wget http://penguinppc.org/bootloaders/yaboot/yaboot-binary-1.3.13.tar.gz
wget http://hermes.osuosl.org/~tmcnulty/macnb/yaboot.conf 
tar xzf yaboot-binary-1.3.13.tar.gz
cp usr/local/lib/yaboot/yaboot /tftpboot
cp yaboot.conf /tftpboot

Install a kernel and ramdisk

For the sake of having a working example, I'll show you how to boot the Debian installer over a network.

1) Get yourself a netbootable kernel; We recommend one from the Debian GNU/Linux sarge netboot installer or Ubuntu [1]. If you don't want to netboot the Debian installer, and/or you want to mount your root directory over NFS, check out our NetBoot kernels in the PowerPC Kernel Archives.

2) Download the ramdisk (if you're using the Debian kernel), initrd.gz, from the same location

3) Copy them both to /tftpboot

Note: Older machines may need the 2.4 kernel and ramdisk

cd /tftpboot

wget http://http.us.debian.org/debian/dists/sarge/main/installer-powerpc/current/images/powerpc/netboot/vmlinux
wget http://http.us.debian.org/debian/dists/sarge/main/installer-powerpc/current/images/powerpc/netboot/initrd.gz
mv vmlinux vmlinux-2.6
mv initrd.gz initrd-2.6.gz

wget http://http.us.debian.org/debian/dists/sarge/main/installer-powerpc/current/images/powerpc/netboot/2.4/vmlinux
wget http://http.us.debian.org/debian/dists/sarge/main/installer-powerpc/current/images/powerpc/netboot/2.4/initrd.gz
mv vmlinux vmlinux-2.4
mv initrd.gz initrd-2.4.gz

Boot the client

Connect a client node the network that dhcpd and tftpd are listening on, and start it up. There are two ways of booting from a network server (the first may only work on newer machines):

1) Hold down 'n' immediately after hitting the power button

2) Boot into Open Firmware (hold down option-command-o-f) and boot explicitly via ethernet:

boot enet:0

Alternatively, set your boot device (semi-permanently) to enet:0:

setenv boot-device enet:0
boot

Or, if your TFTP server is different from your DHCP server, you'll need to specify its IP address:

boot enet:192.168.1.48,yaboot

Now when you turn on your machine, it will automatically attempt to boot over the network.

You can revert to hard disk booting like so: popopo

setenv boot-device hd:,\\:tbxi
boot

If you have trouble booting, check the dhcpd debugging output (on the console) or the tftpd log file for assistance finding the problem. Once you have it working, go ahead and start dhcpd again without the -d option.

Good luck! If you're interested in diskless booting with NFS, check out the Gentoo Diskless Nodes HOWTO. This document is written for x86 users, so ignore all the PXE boot instructions and use the ones on this page instead.