You need various components for a full build.
- Logic: FPGA or CPLD
- initrd (ram filesystem)
There are also ancilliary tools such as bbl to help install this stuff. Here we cover how to build all these parts.
The default build is now based on make menuconfig - it is frequently referred to as Menuconfig2 elsewhere in this Wiki. See HowItWorks for more information.
The menuconfig2 branch now supports retaining selected tarballs for easier rebuilds. The downloads directory is not managed automatically, any tarballs you want to retain for future builds need to be copied out of the relevant build directory and into downloads. Copies of the linux kernel sources, yaffs sources and buildroot sources will be located by the build if the relevant version exists in downloads/. The tarballs which buildroot itself normally downloads for it's own build can also be retained and re-used, those tarballs go into a downloads/dl directory (which needs to be created if you are using this support).
Any change in the build configuration which causes a change in the version of any other the tarballs required will cause that version to be downloaded.
The downloads directory is never cleaned out, it is up to individual maintainers to monitor the directory for unnecessary files.
There is a default, generic, build which can be used without needing to make selections within make menuconfig. This default configuration is set in the defconfigs/defconfig file and will be used if a .config file does not exist. To use the default build, remove any existing .config and run make without arguments:
Certain known products also have pre-defined default configurations within the balloonboard menuconfig layout, e.g. to use with autobuilders and production systems. These builds will overwrite previous configurations and restart with a clean tree so take care in how these are used. In particular, once a particular default build has completed or if it fails or is interrupted, remember that it will be quicker to just run make with the .config file already created by the default than to re-run the default build itself.
Default build targets use a defconfig prefix, followed by the name of the variant. e.g.
Current default builds are:
To add a default build to the target list, create a .config file which asserts all the values needed for your default build and submit it to the balloonboard mailing list.
Toolchains from Debian 5.0 Lenny are recommended, based on gcc-4.3.
deb http://www.emdebian.org/debian squeeze main
or the mirror:
deb http://ftp.uk.debian.org/emdebian/toolchains squeeze main
Then install the Emdebian armel toolchain:
apt-get update apt-get install g++-4.3-arm-linux-gnueabi linux-libc-dev-armel-cross
Building a chain boot system
Chain booting is described on the ChainBooting page. Here's how to build a system using it.
Configuration options for your balloon build are chosen by menu instead of by editing makefiles. There should be no need to create or edit a Makefile.local.
First, check out the code:
svn co svn+ssh://<you>@balloonboard.org/home/balloon/svn/balloon/trunk
Note that the file structure checked out of svn relies on a certain number of symbolic links. For that reason, we recommend checking it out using svn on Linux. Using a tool like TortoiseSVN on Windows can lead to the symbolic links becoming short nonsense files, which breaks things. One symptom is that chain booting won't work.
To get the configuration menu:
With a clean tree, the defaults will be set for a basic working system. If you have run make menuconfig already, you can always revert to the defaults by deleting the .config file in the top level directory. (Note the dot at the start of the filename). Alternatively, just move the file aside and re-run make menuconfig to view the default set.
Now build the lot:
Program bootldr (from build/bootldr/bootldrpxa.fast) into NOR using JTAG or load bootldr at existing bootldr prompt. Program zImageInitrd (fron build/kernel) into NOR using load kernel at bootldr prompt. boot at bootldr prompt
Username is root, no password.
Mount the boot partition as a YAFFS partition (the default):
and put your boot kernel into it:
and put zImageBoot there from wherever you have it - ZMODEM over the console serial port can be convenient.
When loaded, create a symlink to it:
ln -s zImageBoot vmlinuz
Now mount the root filesystem (YAFFS is the default):
Somehow shovel your rootfs into this. There are many ways of doing this. If your Balloon setup has a USB host connector, use a USB stick or similar. Mine doesn't, so I use the procedure in Balloon3SingleSidedRootFS.
Now you can exit and reboot the system:
Press space bar to get into bootldr prompt very quickly!
Configure the bootldr for chain booting:
set bootscript=chainboot_nand params save
(note that bootldr params are now saved in NOR Flash rather than NAND, so bootldr doesn't need to know anything about NAND filesystems).
Boot the system:
and chain booting should happen.
To get into the recovery kernel, go to the bootldr prompt (press space immediately after power-up) and do
set bootscript=exit boot flash
This mechanism does not build the vhdl code as that needs the Xilinx Webpack tools (and GUI).
The patches are managed with quilt. See QuiltHowto for details on how that works so you can use it to easily make changes, update patches and check changes back in.
To check code back in you will need svn access on balloonboard.org. email firstname.lastname@example.org with an ssh key to get access.
Tools and libraries you might need
The build procedure needs various tools and libraries to be present on your system. The makefiles will warn you about some things, and on a Debian system, automatically install the needed packages if you have sudo rights. You need make, glibc headers, bzip2, wget, quilt, module-init-tools, fakeroot, texinfo, bison and flex in addition to the ARM toolchain, see below.
You shouldn't need to manually install anything - it should just be taken care of. But here we detail the steps needed so you can sort out problems.
Manual installation of tools and libraries
apt-get install build-essential bzip2 quilt module-init-tools fakeroot texinfo bison flex wget apt-get install libncurses5-dev debhelper multistrap (On an amd64 machine: apt-get install libc6-dev-i386)
The symptoms of module-init-tools not being installed are non-intuitive: if building the modules results in a lot of messages complaining about ELF files not being for this architecture, then module-init-tools probably isn't installed.
From rel v0.8 onwards the Balloon software build procedure also needs multistrap, the Emdebian multiple repository bootstrap tool. This is not present in the Debian 'lenny' release, so if you're running a 'lenny' machine you'll have to install it manually.
For squeeze or later:
sudo aptitude update sudo aptitude install multistrap
For lenny: Get the dpkg file from http://packages.debian.org/squeeze/main/multistrap and do
apt-get install libparse-debian-packages-perl dpkg -i multistrap_2.1.7_all.deb
ARM EABI GCC toolchain
The ARM EABI GCC 4.1 or later toolchain is also required, which is also available from http://www.emdebian.org/tools/crosstools.html. Makefile.tools (which is run automatically by make) will check to see if this is presenet and whinge (or on a debian machine try to install it for you). If this fails you might need to install it manually. In principle any cross-toolchain (for arm OABI or EABI, as desired) will work, but we've only ever tried using the emdebian ones. Currently you need and OABI ('arm'/'arm-linux-gnu') toolchain to buid bootloader even if everything else is EABI ('armel'/'arm-linux-gnueabi')
To install this on a Debian machine check your /etc/apt/sources.list.d/emdebian.list file.
sudo aptitude update sudo aptitude install g++-4.3-arm-linux-gnueabi linux-libc-dev-armel-cross