The buildroot distribution Blackfin is based on the buildroot mainline 2012.08 release. This repository can be cloned from git://blackfin.uclinux.org/git/buildroot open Internet or ssh://firstname.lastname@example.org/git/buildroot behind a firewall.
The buildroot distribution is made up of many configure scripts, make files and directories. No software source code is included directly. They are all downloaded from Internet when user starts building. Here we will explain necessary pieces that you may wish to customize.
The view from the top level:
board/— board specific configuration files and rootfs skeleton
board/AnalogDevices— configuration files and rootfs skeleton for ADI evaluation boards
board/AnalogDevices/blackfin/patches/linux-3.5— Patches to apply to the proper version of Linux kernel source
boot/— boot loader config scripts and make files; not used for blackfin
config/— the buildroot default configuration for different boards
dl/— the source tarballs that are downloaded during building process
docs/— how to configure and customize buildroot
fs/— config scripts and make files to build different kinds of root file system image.
linux/— config scripts, make files to build Linux kernel
linux/linux-kernel/— the Linux kernel source
output/— All building output files are put under this folder
output/build/— Contain binaries of all software packages
output/images/— Contain file system images and kernel booting up images.
output/staging/— locally installed (“staged”) target libraries; they may be linked with target applications later
output/target/— the compiled root file system image
packages/— config scripts and make files to download and build libraries and applications
scripts/— misc buildroot compile helper scripts
target/— architecture specific configuration files and makefiles
toolchain/— GNU toolchain and GDB config scripts and make files
The buildroot build system is based on kernel kconfig configuration system, and GNU make. It allows you to easily add configuration options, documentation, dependencies, and integrate into Makefiles. There are 8 sets of configuration files:
The top level
Makefile builds the Linux kernel kconfig system under
package/config at first. It then runs
output/build/buildroot-config/mconf to parse GNU configuration scripts defined in
Config.in under root directory. All sub level configuration options are sourced in the root
Config.in file, which allows the user to select libraries, applications, targets, toolchains, boot loaders and rootfs file systems. After it parses all configuration sources, it prompts the option menu to the user. When done, the selected options will be stored into to
.config. The configs/xxxx_defconfig files are minimal defconfig describing a particular configuration, that one can use as a sample to start a new configuration.
Arch and target general configure options are sourced in root
Config.in. Arch and binary format options are defined in
target/Config.in.arch, while system console settings are in
In Analog Devices case:
Because blackfin buildroot distribution always use external customer binary toolchain other than build internal toolchain from source, Only 3 toolchain option scripts are relative. External toolchain option is always selected in
A customer external toolchain option is defined in
toolchain/toolchain-external/Config.in, which allows to use pre-installed binaries other than downloading at building time. Toolchain name prefix defined in vendor options can be overridden here, but customer usually should use the vendor's name. C library type should be set to the same as that provided by the external toolchain. So do some C library prebuilt options, such as IPv6, WChar, Locale, Threads, etc.
The options to enable GDB server support for target boards is defined in
toolchain/gdb/Config.in rather than in buldroot package.
The buildroot for blackfin always use customer unpacked kernel tree under
linux/linux-kernel/. So, no building time download is necessary. kernel version specific customer patches can be put into
board/AnalogDevices/blackfin/patches/linux-3.5, which is applied automatically before building the kernel source and removed after user runs
make clean. Default kernel configuration under
linux/linux-kernel/arch/blackfin/configs/ are used by default. But, customer can set other path to their own kernel configuration. Only uImage is supported to pack Blackfin kernel, don't set customer kernel image name.
User can run make linux-menuconfig to customize the kernel option and the results are stored in
output/build/linux-custom/.config. Kernel object files and temporary files are put into
output/build/linux-custom. All kernel modules are installed into
output/target/lib/modules/ after building.
User space libraries, utilities, tools and applications are all defined in
package/Config.in and its sub options. All multimedia libraries and applications are put together under
package/multimedia/. Busybox options can be customized by run
make busybox-menuconfig. The result is stored in busybox's object output folder. In blackfin case, the default busybox configuration path is defined by vendor's Makefile. Customer can still override this path by their own configuration.
If customer wants to add their own packages, they are free to put everything under
package/customize/ and customize
package/customize/Config.in. Although this is preferred, they can put anywhere under
package/. Refer to Buildroot Howto about how to add Config.in and Makefile for different software packages.
Kernel uImage and rootfs image types are selected in file system image options. If initramfs is selected, initramfs rootfs is packed into the uImage by kernel. And kernel won't mount any other rootfs defined in boot command line when this uImage is booting. In order to generate a pure kernel uImage and mount individual rootfs image, user should disable “Initial RAM filesystem and RAM disk (initramfs/initrd) support” option in kernel configuration. In the bf609 buildroot release, only ext2, jffs2 and ubifs are tested. But, other file system types are also supported.
The top level
Makefile will copy the target file system skeleton from board's default skeleton, copy external toolchain libraries to target and staging, build up the GDB, libraries, applications, kernel and file system images as selected by the user. Each package will be compiled in its own sub-directory under
output/build/. Compiled libraries will be locally installed into the
output/staging/ directory so that other packages can easily find and link against them. Files that are meant to be used on the board at run time will be copied into the
output/target/ directory. This is the rootfs directory. Booting up images are created in
For information on make targets, visit the build_a_target page.