
uClibC Configuration
Originally uploaded by crafterm.
Recently I've been building a small Linux distribution based on the uClibC buildroot environment.
uClibC is a C library implementation, designed for embedded and/or small systems that have low resource footprint. uClibC buildroot is a build environment surrounding uClibC for constructing a fully deployable Linux installation to such devices, including the construction of a cross compiling toolchain (so you can build arm, i386, mips, etc binaries from your desktop machine), the skeleton root filesystem with all of the usual paths /bin, /dev, /usr, /var, /tmp, etc, and a package build infrastructure for building applications to run under this environment (eg. networking services or end user applications).
The whole buildroot environment comes with a configuration package similar to the Linux kernel's 'make menuconfig' environment where you can select the toolchain you'd like to use (eg. gcc/binutils/gdb versions, etc), and the packages you'd like built (eg. openssh, tinyx, etc). See the above screen capture for an example.
The build infrastructure then downloads and compiles your toolchain first (ie. cross compiling compiler, linker, assembler, debugger, etc) directly from gnu.org. It then downloads each package that you've selected (adhering to dependencies) from it's remote download area (eg. sourceforge, or the projects home site) and builds it using your cross compiling toolchain, and installs it into a root filesystem area which is later compressed via cramfs, ext3fs, or another format, to be used as your root Linux filesystem with a kernel image.
In our case I'm targeting i386 systems so I also have the added advantage of being able to chroot into the target filesystem before it's compressed and perform extra builds inside of the target as if it was running on the real device, and this has been a real saviour as things like libtool and pkg-config can cause issues with cross compiling environments and linking.
Once you've got your root filesystem built, you can download the Linux kernel sources and create a kernel image using the Linux 'make bzImage' target. Then using a bootloader like Grub - you're all set to boot your kernel and mount your image as the kernel's root filesystem.