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
|
|
|
|
manual: use one-line titles instead of two-line titles (trivial)
Asciidoc supports two syntaxes for section titles: two-line titles (title
plus underline consisting of a particular symbol), and one-line titles
(title prefixed with a specific number of = signs).
The two-line title underlines are:
Level 0 (top level): ======================
Level 1: ----------------------
Level 2: ~~~~~~~~~~~~~~~~~~~~~~
Level 3: ^^^^^^^^^^^^^^^^^^^^^^
Level 4 (bottom level): ++++++++++++++++++++++
and the one-line title prefixes:
= Document Title (level 0) =
== Section title (level 1) ==
=== Section title (level 2) ===
==== Section title (level 3) ====
===== Section title (level 4) =====
The buildroot manual is currenly using the two-line titles, but this has
multiple disadvantages:
- asciidoc also uses some of the underline symbols for other purposes (like
preformatted code, example blocks, ...), which makes it difficult to do
mass replacements, such as a planned follow-up patch that needs to move
all sections one level down.
- it is difficult to remember which level a given underline symbol (=-~^+)
corresponds to, while counting = signs is easy.
This patch changes all two-level titles to one-level titles in the manual.
The bulk of the change was done with the following Python script, except for
the level 1 titles (-----) as these underlines are also used for literal
code blocks.
This patch only changes the titles, no other changes. In
adding-packages-directory.txt, I did add missing newlines between some
titles and their content.
----------------------------------------------------------------------------
#!/usr/bin/env python
import sys
import mmap
import re
for input in sys.argv[1:]:
f = open(input, 'r+')
f.flush()
s = mmap.mmap(f.fileno(), 0)
# Level 0 (top level): ====================== =
# Level 1: ---------------------- ==
# Level 2: ~~~~~~~~~~~~~~~~~~~~~~ ===
# Level 3: ^^^^^^^^^^^^^^^^^^^^^^ ====
# Level 4 (bottom level): ++++++++++++++++++++++ =====
def replace_title(s, symbol, replacement):
pattern = re.compile(r'(.+\n)\%s{2,}\n' % symbol, re.MULTILINE)
return pattern.sub(r'%s \1' % replacement, s)
new = s
new = replace_title(new, '=', '=')
new = replace_title(new, '+', '=====')
new = replace_title(new, '^', '====')
new = replace_title(new, '~', '===')
#new = replace_title(new, '-', '==')
s.seek(0)
s.write(new)
s.resize(s.tell())
s.close()
f.close()
----------------------------------------------------------------------------
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-05-02 07:47:30 +02:00
|
|
|
== Using Buildroot
|
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-05-31 09:55:35 +02:00
|
|
|
http://www.busybox.net/[BusyBox]. Note that you can *and should build
|
2012-11-11 04:14:44 +01:00
|
|
|
everything as a normal user*. There is no need to be root to configure
|
2011-10-10 10:46:39 +02:00
|
|
|
and use Buildroot. The first step is to run the configuration
|
|
|
|
assistant:
|
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make menuconfig
|
|
|
|
--------------------
|
|
|
|
|
2013-12-09 01:07:40 +01:00
|
|
|
or
|
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make nconfig
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
to run the old or new curses-based configurator, or
|
2011-10-10 10:46:39 +02:00
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make xconfig
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
or
|
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make gconfig
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
to run the Qt or GTK-based configurators.
|
|
|
|
|
|
|
|
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
|
2012-11-27 12:59:16 +01:00
|
|
|
configuration utilities. Check xref:requirement[] to know what
|
|
|
|
Buildroot needs, and specifically the xref:requirement-optional[optional requirements]
|
|
|
|
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
|
|
|
|
help that describes the purpose of the entry.
|
|
|
|
|
|
|
|
Once everything is configured, the configuration tool generates a
|
|
|
|
+.config+ file that contains the description of your
|
|
|
|
configuration. It will be used by the Makefiles to do what's needed.
|
|
|
|
|
|
|
|
Let's go:
|
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
You *should never* use +make -jN+ with Buildroot: it does not support
|
|
|
|
'top-level parallel make'. Instead, use the +BR2_JLEVEL+ option to
|
|
|
|
tell Buildroot to run each package compilation with +make -jN+.
|
|
|
|
|
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);
|
|
|
|
* 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.
|
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
|
|
|
|
filesystem images) are stored.
|
|
|
|
|
2014-03-26 19:46:09 +01:00
|
|
|
* +build/+ where all the components are built
|
|
|
|
(this includes tools needed to run Buildroot on
|
2011-10-10 10:46:39 +02:00
|
|
|
the host and packages compiled for the target). The +build/+
|
|
|
|
directory contains one subdirectory for each of these components.
|
|
|
|
|
|
|
|
* +staging/+ which contains a hierarchy similar to a root filesystem
|
|
|
|
hierarchy. This directory contains the installation of the
|
|
|
|
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
|
2011-10-10 10:46:39 +02:00
|
|
|
*should not be used on your target*. Instead, you should use one of
|
|
|
|
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
|
|
|
|
your needs, with all the supports 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[].
|