Using Hudson to build Linux

Hudson is a great utility that is provided by Sun Microsystems.  It is designed as a continuous integration engine for Java development, but it has other uses as well. Recently, I began using Hudson as a build environment for my embedded Linux projects.  Using this tool has benefitted my Software development in all phases, development, test and release.

Hudson is run as a standalone Java application.  You launch it once in a command window, or on boot up, and then you access it via a web browser. A typical Hudson job consists of a pointer to a revision control project, a build script, instructions for what to do with the built artifacts, and optionally a pointer to another Hudson job to execute.  At the end of the build, Hudson can post the Build number as a tag to the repository.

In my Linux projects, I have used Hudson to build both the Linux Kernel, as well as the root filesystems. For the Linux Kernel, Hudson updates the source tree, executes a build, and stores away the kernel image in whatever format I specify.  This image is version numbered, and fingerprinted, so that at a later date, I can check a customer’s kernel image against my Hudson repository and find the build number, source version in the repository, as well as all console output from the build.  It’s very handy!

Hudson also provides a great way to build root filesystems.  Typically, a root filesystem is built with a utility such as buildroot which fetches packages from the network, configures them, and performs the build. I have had spotty results with buildroot, as it does not always generate reproducible results.  Hudson allows me to generate complex build scripts over which I can maintain complete control.  These scripts are customized to my individual customer’s requirements, fetching and building the packages that the customer needs, with known revisions and source locations. Furthermore, all builds are archived automatically, giving me full history of the project in one convenient location.

Leave a Reply