Difference between revisions of "Creating a RFS with Buildroot"

From DAVE Developer's Wiki
Jump to: navigation, search
m
m (Building the root file system)
Line 144: Line 144:
 
Buildroot output is stored in a single directory, ''output'', and you'll find all the built images (kernel image, bootloader and root filesystem images) stored into the ''images'' subdirectory. In particular, the root file system is saved as a '''rootfs.tar''' file. This file can be decompressed to a NFS share and used to boot the target from the network for testing and further customization steps.
 
Buildroot output is stored in a single directory, ''output'', and you'll find all the built images (kernel image, bootloader and root filesystem images) stored into the ''images'' subdirectory. In particular, the root file system is saved as a '''rootfs.tar''' file. This file can be decompressed to a NFS share and used to boot the target from the network for testing and further customization steps.
  
 
+
For more information, please refer to [http://buildroot.uclibc.org/downloads/manual/manual.html#_using_buildroot Using Buildroot Section] on the User Manual.
 
 
For further information, please refer to [http://buildroot.uclibc.org/downloads/manual/manual.html#_using_buildroot Using Buildroot Section] on the User Manual.
 

Revision as of 14:12, 9 January 2013

Info Box
Tux.png Applies to Linux
Naon am387x-dm814x.png Applies to Naon

Introduction[edit | edit source]

Buildroot is a set of scripts and patches for the creation of a cross-compilation toolchain as well as the creation of a complete root file system. Buildroot provides:

  • support for prebuilt or external toolchains
  • configuration through menuconfig, gconfig and xconfig interfaces
  • lots of available libraries, tools, packages and utilities
  • support for all the major filesystems (JFFS2, UBIFS, CRAMFS, ...)
  • uClibc, glibc, eglibc generation, or use of the libc from the external toolchain
  • easy customization through Makefiles

References[edit | edit source]

Starting up[edit | edit source]

Requirements[edit | edit source]

Buildroot needs some software to be already installed on the GNU/Linux host system. Please check:

Please make sure that at least the mandatory packages are installed before launching a build.

Getting Buildroot[edit | edit source]

Buildroot releases can be downloaded from http://buildroot.net/downloads/

Daily Snapshots of the latest Buildroot source tree can be downloaded from http://buildroot.uclibc.org/downloads/snapshots/

The source tree can be browsed online: http://git.buildroot.net/buildroot/ and a copy of the repository can be grabbed with the following commands:

The following is the project directory tree:

.
├── arch
├── board
├── boot
├── CHANGES
├── Config.in
├── Config.in.legacy
├── configs
├── COPYING
├── docs
├── fs
├── linux
├── Makefile
├── Makefile.legacy
├── package
├── support
├── system
└── toolchain

Configuring Buildroot[edit | edit source]

For modifying the Buildroot configuration, enter the project directory and enter the following command:

make menuconfig

You can optionally use the O= parameter to set a specific build folder:

make O=<path_to_build_directory> menuconfig

Once everything is configured, the configuration tool generates a .config file that contains the description of the configuration. It will be used by the Makefiles to do what’s needed.

Setting up the target architecture[edit | edit source]

From the menuconfig interface, you need to select:

  • Target Architecture -> Select "ARM (little endian)"
  • Target Architecture Variant -> Select "cortex-A8"
  • Target ABI -> Select "EABI"

Buildroot-arch.jpg


Setting up the external toolchain[edit | edit source]

You need to set the path and prefix for the external toolchain:

  • Toolchain -> Toolchain type -> Select "External Toolchain"
  • Toolchain -> Toolchain -> Select "Custom Toolchain"
  • Toolchain -> Toolchain origin-> Select "Pre-installed toolchain"
  • Toolchain -> Toolchain path (eg. /home/shared/devel/dave/naon-DAA/sw/linux/sdk/arm-2009q1)
  • Toolchain -> Toolchain prefix (eg. $(ARCH)-none-linux-gnueabi-)

Buildroot-toolchain.jpg


System configuration[edit | edit source]

Entering the "System configuration" option you should set:

  • System hostname (NEW)
  • System banner (NEW)
  • Port to run a getty (login prompt) on -> Enter ttyO0
  • () Custom script to run before creating filesystem images -> If required, you can run custom scripts to do board-specific cleanups, add-ons and the like, so the generated files can be used directly without further processing.

Buildroot-system.jpg


Package selection[edit | edit source]

The list of available packages can be accessed entering the Package selection for the target option


Building the root file system[edit | edit source]

Once the configuration step is completed, launch

make O=<path_to_build_directory>

to start the build process, which will perform the following tasks:

  • download source files (as required);
  • configure, build and install the cross-compiling toolchain using the appropriate toolchain backend, or simply import an external toolchain;
  • build/install selected target packages;
  • build a kernel image, if selected;
  • build a bootloader image, if selected;
  • create a root filesystem in selected formats.

Buildroot output is stored in a single directory, output, and you'll find all the built images (kernel image, bootloader and root filesystem images) stored into the images subdirectory. In particular, the root file system is saved as a rootfs.tar file. This file can be decompressed to a NFS share and used to boot the target from the network for testing and further customization steps.

For more information, please refer to Using Buildroot Section on the User Manual.