There's been some discussion about this on the group, so I thought I should try to get something in the way of a kexec-based secondary bootloader. I've seen some examples of this on the internet, but they seem to involve uclibc, cross-compilers and all sorts of faffing about, so hopefully this is a bit simpler.

What we are trying to do is to have a generic firmware, with the kernel on a USB stick, thus getting round the bootloader's inability to boot directly from USB itself. Perhaps network or other 'boot devices' will be added later.


First, get the statically linked kexec binary helpfully contributed by Razvan, or compile your own.

Next, check out all the stuff from subversion for a compact initrd-based system:

$ svn co

I've added an example rc files under files/etc/rc-kexec, you probably want to copy that over files/etc/rc although of course you can type these commands manually once the initrd system has loaded.

Next, copy the kexec config kernel/ over the default config kernel/

Follow the instructions in readme.txt on how to build. unfortunately you need an old version of Nasm.

This should give you a binary in linux- that you can flash to the board.


My script (rc-kexec) expects the kexec program binary to be located on the first partition of the USB device at /boot/kexec, and the kernel image to be at /boot/bzImage.

You can use a line like:

kexec --append="`cat /proc/cmdline`" -l bzImage

To load the image with a specific command-line, however I've embedded the command-line into my kernel, which solved this, hence no mention of that in rc-kexec.


There seems to be no easy way to wait for the USB device to become available before attempting to mount it, so I just chucked in a 10 second delay to wait for it to come on line. I guess a clever script or dietlibc app could solve this problem.