2012-11-11 04:14:42 +01:00
|
|
|
// -*- mode:doc; -*-
|
2013-02-13 13:59:02 +01:00
|
|
|
// vim: set syntax=asciidoc:
|
2011-10-10 10:46:39 +02:00
|
|
|
|
2014-08-19 21:41:46 +02:00
|
|
|
== Buildroot quick start
|
2011-10-10 10:46:39 +02:00
|
|
|
|
2014-08-12 22:20:13 +02:00
|
|
|
*Important*: you can and should *build everything as a normal user*. There
|
|
|
|
is no need to be root to configure and use Buildroot. By running all
|
|
|
|
commands as a regular user, you protect your system against packages
|
|
|
|
behaving badly during compilation and installation.
|
|
|
|
|
|
|
|
The first step when using Buildroot is to create a configuration.
|
2011-10-10 10:46:39 +02:00
|
|
|
Buildroot has a nice configuration tool similar to the one you can
|
|
|
|
find in the http://www.kernel.org/[Linux kernel] or in
|
2014-08-12 22:20:13 +02:00
|
|
|
http://www.busybox.net/[BusyBox].
|
|
|
|
|
|
|
|
From the buildroot directory, run
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make menuconfig
|
|
|
|
--------------------
|
|
|
|
|
2014-08-12 22:20:13 +02:00
|
|
|
for the original curses-based configurator, or
|
2013-12-09 01:07:40 +01:00
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make nconfig
|
|
|
|
--------------------
|
|
|
|
|
2014-08-12 22:20:13 +02:00
|
|
|
for the new curses-based configurator, or
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make xconfig
|
|
|
|
--------------------
|
|
|
|
|
2014-08-12 22:20:13 +02:00
|
|
|
for the Qt-based configurator, or
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make gconfig
|
|
|
|
--------------------
|
|
|
|
|
2014-08-12 22:20:13 +02:00
|
|
|
for the GTK-based configurator.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
All of these "make" commands will need to build a configuration
|
2012-11-11 04:14:44 +01:00
|
|
|
utility (including the interface), so you may need to install
|
|
|
|
"development" packages for relevant libraries used by the
|
2014-08-12 22:20:13 +02:00
|
|
|
configuration utilities. Refer to xref:requirement[] for more details,
|
|
|
|
specifically the xref:requirement-optional[optional requirements]
|
2012-11-27 12:59:16 +01:00
|
|
|
to get the dependencies of your favorite interface.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
For each menu entry in the configuration tool, you can find associated
|
2014-08-19 21:41:46 +02:00
|
|
|
help that describes the purpose of the entry. Refer to xref:configure[]
|
|
|
|
for details on some specific configuration aspects.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
Once everything is configured, the configuration tool generates a
|
2014-08-12 22:20:13 +02:00
|
|
|
+.config+ file that contains the entire configuration. This file will be
|
|
|
|
read by the top-level Makefile.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
2014-08-12 22:20:13 +02:00
|
|
|
To start the build process, simply run:
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make
|
|
|
|
--------------------
|
|
|
|
|
2014-08-12 22:20:13 +02:00
|
|
|
You *should never* use +make -jN+ with Buildroot: top-level parallel
|
|
|
|
make is currently not supported. Instead, use the +BR2_JLEVEL+ option
|
|
|
|
to tell Buildroot to run the compilation of each individual package
|
|
|
|
with +make -jN+.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
2012-11-27 12:59:16 +01:00
|
|
|
The `make` command will generally perform the following steps:
|
2011-10-10 10:46:39 +02:00
|
|
|
|
2012-11-27 12:59:16 +01:00
|
|
|
* download source files (as required);
|
2014-08-12 22:20:13 +02:00
|
|
|
* configure, build and install the cross-compilation toolchain, or
|
|
|
|
simply import an external toolchain;
|
|
|
|
* configure, build and install selected target packages;
|
2012-11-27 12:59:16 +01:00
|
|
|
* build a kernel image, if selected;
|
|
|
|
* build a bootloader image, if selected;
|
|
|
|
* create a root filesystem in selected formats.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
Buildroot output is stored in a single directory, +output/+.
|
|
|
|
This directory contains several subdirectories:
|
|
|
|
|
|
|
|
* +images/+ where all the images (kernel image, bootloader and root
|
2014-08-12 22:20:13 +02:00
|
|
|
filesystem images) are stored. These are the files you need to put
|
|
|
|
on your target system.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
2014-08-12 22:20:13 +02:00
|
|
|
* +build/+ where all the components are built (this includes tools
|
|
|
|
needed by Buildroot on the host and packages compiled for the
|
|
|
|
target). This directory contains one subdirectory for each of these
|
|
|
|
components.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
* +staging/+ which contains a hierarchy similar to a root filesystem
|
2014-08-12 22:20:13 +02:00
|
|
|
hierarchy. This directory contains the headers and libraries of the
|
2011-10-10 10:46:39 +02:00
|
|
|
cross-compilation toolchain and all the userspace packages selected
|
|
|
|
for the target. However, this directory is 'not' intended to be
|
|
|
|
the root filesystem for the target: it contains a lot of development
|
|
|
|
files, unstripped binaries and libraries that make it far too big
|
|
|
|
for an embedded system. These development files are used to compile
|
|
|
|
libraries and applications for the target that depend on other
|
|
|
|
libraries.
|
|
|
|
|
|
|
|
* +target/+ which contains 'almost' the complete root filesystem for
|
|
|
|
the target: everything needed is present except the device files in
|
|
|
|
+/dev/+ (Buildroot can't create them because Buildroot doesn't run
|
2012-11-27 12:59:18 +01:00
|
|
|
as root and doesn't want to run as root). Also, it doesn't have the correct
|
|
|
|
permissions (e.g. setuid for the busybox binary). Therefore, this directory
|
2014-12-19 08:12:33 +01:00
|
|
|
*should not be used on your target*. Instead, you should use one of
|
2011-10-10 10:46:39 +02:00
|
|
|
the images built in the +images/+ directory. If you need an
|
|
|
|
extracted image of the root filesystem for booting over NFS, then
|
|
|
|
use the tarball image generated in +images/+ and extract it as
|
|
|
|
root. Compared to +staging/+, +target/+ contains only the files and
|
|
|
|
libraries needed to run the selected target applications: the
|
2012-11-27 12:59:17 +01:00
|
|
|
development files (headers, etc.) are not present, the binaries are
|
|
|
|
stripped.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
* +host/+ contains the installation of tools compiled for the host
|
|
|
|
that are needed for the proper execution of Buildroot, including the
|
|
|
|
cross-compilation toolchain.
|
|
|
|
|
2013-12-09 01:07:40 +01:00
|
|
|
These commands, +make menuconfig|nconfig|gconfig|xconfig+ and +make+, are the
|
2012-11-11 04:14:44 +01:00
|
|
|
basic ones that allow to easily and quickly generate images fitting
|
2014-08-12 22:20:13 +02:00
|
|
|
your needs, with all the features and applications you enabled.
|
2011-10-10 10:46:39 +02:00
|
|
|
|
2012-11-11 04:14:44 +01:00
|
|
|
More details about the "make" command usage are given in
|
|
|
|
xref:make-tips[].
|