Table of Contents
This chapter is based on Rudi van Drunen's m0n0wall Hackers Guide, used with permission.
m0n0wall is open-source software: if it doesn't quite do what you want, you can change it yourself, or have someone else of your choice change it for you. This chapter describes how to do that.
Note that the instructions in this guide are meant as guidelines, your mileage may vary. Also, hacking low level things may seriously mess up your development system, target system, or other systems, please take care.
In order to get a development environment for m0n0wall you will need the target hardware and a host system. typically this will be a soekris NET45xx board and a FreeBSD 4.8-RELEASE (Intel x86) system.
You will be booting the m0n0wall from the host system, so no CF card is needed. The boot image is located on the host and changes in the kernel or root filesystem are easily made by hacking them on the host machine. Once ready, the root filesystem or kernel image can be created and put in the /tftpboot directory (as described below) and the target (soekris) can be booted from this image over the network.
Now you can test the image, make your desired changes on the host, rebuild the root and / or kernel and test again. If you are confident with the changes you made, you will be able to build an image for the CF card. This image can then be used to "firmware upgrade" the m0n0wall (when running from CF) as usual though the WEB user interface.
As you will be network (PXE (Preboot Execution Environment)) booting the soekris from your host system and be able to generate image files to load you will have to set up some environment on the host to support just that. First of all, be sure that you have a kernel running that contains the vnode driver. You will need this feature to be able to turn a file into a device. Add the following to your kernel config and rebuild the kernel:
pseudo-device vn # Vnode driver (turns a file into a device)
Instructions for rebuilding the kernel can be found in chapter 9 of the FreeBSD handbook.