PXE booting with OpenWRT Kamikaze

As a small appliance fan, I really like OpenWRT. I use it almost everywhere on my home network because it is agile, flexible, and opens up new possibilities for what used to be just a box that connected you to the Internet. With some of the newer models, like the WRTSL54GS, you can attach external storage or devices which opens up even more possibilities.

I spent some part of my waking hours today figuring out how to perform PXE booting to install OpenBSD (to save burning an ISO). If you’re not using the Kamikaze release, dnsmasq, as far as I am aware has not changed greatly so the following should still work. By the way, the great thing is that a dedicated tftp daemon is not required for all of this either. dnsmasq has it all built-in.

In order to enable PXE booting:
1. Log in as root
2. Add to /etc/dnsmasq.conf the following configuration options 1:

# PXE Booting (For installs):
# Define your own tftp-root, the user/group for this directory was
# nobody:nogroup from a leftover atftpd install
# This is the file that will be tftp'd across

3. Restart dnsmasq. In Kamikzae, the init scripts allow you to do:
/etc/init.d/dnsmasq restart

For older releases, you may need to find the process with `ps` and either send a SIGHUP `kill $pid -HUP`, or SIGTERM `kill $pid`, then restart it. Either one works.

4. For OpenBSD, drop `pxeboot` and `bsd.rd` into the tftp-root directory. Both can be found here.

5. Since the `pxeboot` image looks for `bsd` to slurp, you may need to create a symlink from bsd.rd to bsd:
`ln -s bsd.rd bsd`

6. Reconfigure the target host for installation to boot from LAN, and that should be it.

1More documentation is available here: http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html


2 responses to “PXE booting with OpenWRT Kamikaze

  1. Hernan Martinez

    Hi. I am trying the opposite I guess heh
    I have a Ubuntu here and just started with buildroot-ng . I have a small itx board with cflash hdd Now i need to know how can I pxe boot my itx with the kernel and filesystem that buildrootng had built for me.
    If you know where can I find instructions for that I will really apprecitate.

  2. Pingback: Installing Debian over PXE (from a router) « Homunculus

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: