Netbooting into Linux from a MacOS X Netboot Server

I spent the last few days trying to get Linux on to an Apple XServe which is a couple of thousand kilometers away and I have no access to the console. I have access to the lights out management and to machines next to it but I can't see what the console says. The last attemt to install Linux actually worked up to the point where linux was properly installed and at the first boot, it started to hang due to some wrong kernel parameter. I wasn't able to figure that one out so I left the location. A couple of weeks later, I got the right hint of which kernel parameter worked so I wanted to try again but now I'm far away. So I spent some time on figuring out how NetBooting works on a Mac which is different from traditional PXE netbooting.

Step 1: you need a NetBoot Server.

I use a MacOS X Server which is next to it. You can also use BSDPy under Linux.

Also very useful tended to be Deploy Studio as it allowed me to boot into a mini OS X and then remote control the Mac via RemoteDesktop to set up a startup volume or do things like partitioning etc.

Step 2: you need to download IPXE sources

You should do this on a Linux machine as the current version of IPXE doesnt build under OS X due to some GCC compiler flags which make the OS X compiler spill out errors. (probably very easy to fix).

git clone git://git.ipxe.org/ipxe.git

Step 3: Install dependencies

Debian/Ubunut:
	apt-get install binutils-dev curl libiberty-dev zip

under Fedora/Redhat/CentOS it's probably something like 
	yum install binutils-devel curl libiberty-devel zip

Step 4: Download and run my build script and run it

cd ipxe/src
curl --url "http://www.fink.org/netboot/build_ipxe_nbi.txt" > build_ipxe_nbi.sh
bash ./build_ipxe_nbi.sh

this will build the 64bit ipxe efi binary and bundle it with the needed files to make up a netbootable nbi folder as OS X Server requires it.

If you want to build a IPXE booter which automatically loads an URL and executes the IPXE script there, then you can pass it on the command like like this

bash ./build_ipxe_nbi.sh http://bootserver/boot.php

The output you get is now a ipxe.nbi.zip which you can copy on to your OS X server unpack it there and put it into /Library/NetBoot/NetBootSP0/