3.2. Busybox

If we look in the directory ${IMAGE} (${BASE}/target/powerpc-603e-linux-gnu/powerpc-603e-linux-gnu) we'll see that we have the beginnings of our target filesystem. But what we're missing are things like: an init system, a shell, and all the dozens of little utilities that make UNIX life easier.

When the Linux kernel is done booting it will look in a number of locations for the init program and run it. If it can't find the init program it will panic. The init system is generally responsible for running a bunch of user-space scripts that help to initialise the system (e.g. configure networking, starting daemons, etc). Sometimes init systems incorporate the idea of "run-levels" which a user can select from to determine the type of system and range of services to start or terminate. A shell is useful not just as a program to run after you logon, but is also often used by scripts, especially those which are part of the init process. A system will often run a number of daemons such as getty processes or sshd.

There are two ways to go about getting these things, we can either search in dozens of places downloading all the sources to the individual programs themselves or we can use something like Busybox. Busybox was designed for this purpose with embedded systems in mind. As such it provides many of the things we are now looking for in one convenient package. Since it was developed with code size considerations in mind, many of the utilities aren't quite as full-featured as the commands we might be accustomed to, but it's still a good place to start.

Unfortunately Busybox doesn't support building in a different directory, so you'll want different Busybox directories for each platform you want to support. To build Busybox go into the directory containing its sources and type:

$ make menuconfig
       

You will then be presented with a curses-based screen that will present you with various categories. Inside those categories are items you can select or unselect for inclusion into your system. Offering specific advice here is difficult because it depends on what you're looking for and what you want out of your system. However, some pieces of advice I can offer are:

Once you're done the regular "make dep", "make", and "make install" should be all you need.