From 7c61ca6f0c76c66adfdb4b09341f42e18b805857 Mon Sep 17 00:00:00 2001 From: Ulf Samuelsson Date: Thu, 12 Jul 2007 17:04:05 +0000 Subject: Fix Document style --- docs/buildroot.html | 136 ++++++++++++++++++++++++++-------------------------- 1 file changed, 68 insertions(+), 68 deletions(-) (limited to 'docs') diff --git a/docs/buildroot.html b/docs/buildroot.html index c70b98576..98a91e592 100644 --- a/docs/buildroot.html +++ b/docs/buildroot.html @@ -16,7 +16,7 @@

Buildroot usage and documentation by Thomas Petazzoni. Contributions from - Karsten Kruse, Ned Ludd, Martin Herren and others.

+ Karsten Kruse, Ned Ludd, Martin Herren and others.

$LastChangedDate$

@@ -47,12 +47,12 @@ generate both a cross-compilation toolchain and a root filesystem for your target. The cross-compilation toolchain uses uClibc (http://www.uclibc.org/), a tiny C standard - library.

+ library.

Buildroot is useful mainly for people working with embedded systems. Embedded systems often use processors that are not the regular x86 processors everyone is used to have on his PC. It can be PowerPC - processors, MIPS processors, ARM processors, etc.

+ processors, MIPS processors, ARM processors, etc.

A compilation toolchain is the set of tools that allows to compile code for your system. It consists of a compiler (in our @@ -71,7 +71,7 @@ generally, the machine on which it is running, and on which you're working is called the "host system". The compilation toolchain is provided by your distribution, and Buildroot has nothing to do - with it.

+ with it.

As said above, the compilation toolchain that comes with your system runs and generates code for the processor of your host system. As your @@ -81,7 +81,7 @@ example, if your host system uses x86 and your target system uses ARM, the regular compilation toolchain of your host runs on x86 and generates code for x86, while the cross-compilation toolchain runs on x86 and generates - code for ARM.

+ code for ARM.

Even if your embedded system uses a x86 processor, you might interested in Buildroot, for two reasons:

@@ -92,10 +92,10 @@ Libc on your target system, you can use uClibc which is a tiny C standard library. If you want to use this C library, then you need a compilation toolchain to generate binaries linked with it. Buildroot can do it for - you. + you.
  • Buildroot automates the building of a root filesystem with all needed - tools like busybox. It makes it much easier than doing it by hand.
  • + tools like busybox. It makes it much easier than doing it by hand.

    You might wonder why such a tool is needed when you can compile @@ -105,17 +105,17 @@ version it very time-consuming and uninteresting. Buildroot automates this process through the use of Makefiles, and has a collection of patches for each gcc and binutils version to make them work - on most architectures.

    + on most architectures.

    Obtaining Buildroot

    Buildroot is available as daily SVN snapshots or directly using - SVN.

    + SVN.

    The latest snapshot is always available at http://buildroot.uclibc.org/downloads/snapshots/buildroot-snapshot.tar.bz2, and previous snapshots are also available at http://buildroot.uclibc.org/downloads/snapshots/.

    + href="http://buildroot.uclibc.org/downloads/snapshots/">http://buildroot.uclibc.org/downloads/snapshots/.

    To download Buildroot using SVN, you can simply follow the rules described on the "Accessing SVN"-page (

    For each entry of the configuration tool, you can find associated help - that describes the purpose of the entry.

    + that describes the purpose of the entry.

    One of the key configuration items is the PROJECT which determines where some board specific packages are built and where the @@ -152,7 +152,7 @@

    Once everything is configured, the configuration tool has generated a .config file that contains the description of your - configuration. It will be used by the Makefiles to do what's needed.

    + configuration. It will be used by the Makefiles to do what's needed.

    Let's go:

    @@ -176,7 +176,7 @@ $ make source

    You can now disconnect or copy the content of your dl - directory to the build-host.

    + directory to the build-host.

    Environment variables

    @@ -214,7 +214,7 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD You can simply make your changes here, and run make afterwards, which will rebuild the target filesystem image. This method allows to do everything on the target filesystem, but if you decide to completely rebuild your - toolchain and tools, these changes will be lost. + toolchain and tools, these changes will be lost.
  • Customize the target filesystem skeleton, available under target/generic/target_skeleton/. You can customize @@ -222,7 +222,7 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD is not yet present, because it's created during the compilation process. So you can't do everything on this target filesystem skeleton, but changes to it remain even if you completely rebuild the cross-compilation - toolchain and the tools.
    + toolchain and the tools.
    You can also customize the target/generic/device_table.txt file which is used by the tools that generate the target filesystem image to properly set permissions and create device nodes. The @@ -230,11 +230,11 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD directories of a root filesystem and there is no obvious reason for which it should be changed. These main directories are in an tarball inside of inside the skeleton because it contains symlinks that would be broken - otherwise.
    + otherwise.
    These customizations are deployed into project_build_ARCH/root/ just before the actual image is made. So simply rebuilding the image by running - make should propagate any new changes to the image.
  • + make should propagate any new changes to the image.
  • When configuring the build system, using make menuconfig, you can specify the contents of the /etc/hostname and /etc/issue @@ -247,17 +247,17 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD

    Busybox is very configurable, and you may want to customize it. You can follow these simple steps to do it. It's not an optimal way, but it's - simple and it works.

    + simple and it works.

    1. Make a first compilation of buildroot with busybox without trying to - customize it.
    2. + customize it.
    3. Invoke make busybox-menuconfig. The nice configuration tool appears and you can - customize everything.
    4. + customize everything. -
    5. Run the compilation of buildroot again.
    6. +
    7. Run the compilation of buildroot again.

    Otherwise, you can simply change the @@ -265,7 +265,7 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD know the options you want to change without using the configuration tool.

    If you want to use an existing config file for busybox, then see - section environment variables.

    + section environment variables.

    Customizing the uClibc configuration

    @@ -273,7 +273,7 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD

    Just like BusyBox, uClibc offers a lot of configuration options. They allow to select various - functionalities, depending on your needs and limitations.

    + functionalities, depending on your needs and limitations.

    The easiest way to modify the configuration of uClibc is to follow these steps :

    @@ -281,19 +281,19 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD
    1. Make a first compilation of buildroot without trying to - customize uClibc.
    2. + customize uClibc.
    3. Invoke make uclibc-menuconfig. The nice configuration assistant, similar to the one used in the Linux Kernel or in Buildroot appears. Make - your configuration as appropriate.
    4. + your configuration as appropriate.
    5. Copy the .config file to toolchain/uClibc/uClibc.config or toolchain/uClibc/uClibc.config-locale. The former is used if you haven't selected locale support in Buildroot configuration, and the latter is used if you have selected - locale support.
    6. + locale support.
    7. Run the compilation of Buildroot again
    8. @@ -302,10 +302,10 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD

      Otherwise, you can simply change toolchain/uClibc/uClibc.config or toolchain/uClibc/uClibc.config-locale without running - the configuration assistant.

      + the configuration assistant.

      If you want to use an existing config file for uclibc, then see - section environment variables.

      + section environment variables.

      How Buildroot works

      @@ -314,7 +314,7 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD configure and compiles software with the correct options. It also includes some patches for various software, mainly the ones involved in the cross-compilation tool chain (gcc, binutils and - uClibc).

      + uClibc).

      There is basically one Makefile per software, and they are named with the .mk extension. Makefiles are split into three @@ -324,13 +324,13 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD

    9. package (in the package/ directory) contains the Makefiles and associated files for all user-space tools that Buildroot can compile and add to the target root filesystem. There is one - sub-directory per tool.
    10. + sub-directory per tool.
    11. toolchain (in the toolchain/ directory) contains the Makefiles and associated files for all software related to the cross-compilation toolchain : binutils, ccache, gcc, gdb, kernel-headers and - uClibc.
    12. + uClibc.
    13. target (in the target directory) contains the Makefiles and associated files for software related to the generation of @@ -338,18 +338,18 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD : ext2, jffs2, cramfs and squashfs. For each of them, there's a sub-directory with the required files. There is also a default/ directory that contains the target filesystem - skeleton.
    14. + skeleton.

      Each directory contains at least 2 files :

      • something.mk is the Makefile that downloads, configures, - compiles and installs the software something.
      • + compiles and installs the software something.
      • Config.in is a part of the configuration tool description file. It describes the option related to the current - software.
      • + software.
      @@ -360,7 +360,7 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD
    15. Create the download directory (dl/ by default). This is where the tarballs will be downloaded. It is interesting to know that the tarballs are in this directory because it may be useful to save them - somewhere to avoid further downloads.
    16. + somewhere to avoid further downloads.
    17. Create the shared build directory (build_ARCH/ by default, where ARCH is your architecture). This is where all @@ -381,7 +381,7 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD
    18. Create the project specific result directory (binaries/$(PROJECT) by default, where ARCH - is your architecture). This is where the root file system images are + is your architecture). This is where the root filesystem images are stored, It is also used to store the linux kernel image and any utilities, boot-loaders etc. needed for a target.
    19. @@ -389,7 +389,7 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD
    20. Create the toolchain build directory (toolchain_build_ARCH/ by default, where ARCH is your architecture). This is where the cross compilation toolchain will - be compiled.
    21. + be compiled.
    22. Setup the staging directory (build_ARCH/staging_dir/ by default). This is where the cross-compilation toolchain will be @@ -398,7 +398,7 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD build_ARCH/staging_dir/usr/bin to your PATH, and then use arch-linux-gcc to compile your application. In order to setup this staging directory, it first removes it, and then it creates - various subdirectories and symlinks inside it.
    23. + various subdirectories and symlinks inside it.
    24. Create the target directory (project_build_ARCH/root/ by default) and the target filesystem skeleton. This directory will contain @@ -406,12 +406,12 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD uncompress the target/generic/skel.tar.gz file to create the main subdirectories and symlinks, copies the skeleton available in target/generic/target_skeleton and then removes useless - .svn/ directories.
    25. + .svn/ directories.
    26. Add the TARGETS dependency. This should generally check if the configuration option for this package is enabled, and if so then "subscribe" this package to be compiled by adding it to the - TARGETS global variable.
    27. + TARGETS global variable.

    Using the @@ -419,14 +419,14 @@ $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD

    You may want to compile your own programs or other software that are not packaged in Buildroot. In order to do this, you can - use the toolchain that was generated by Buildroot.

    + use the toolchain that was generated by Buildroot.

    The toolchain generated by Buildroot by default is located in build_ARCH/staging_dir/. The simplest way to use it is to add build_ARCH/staging_dir/usr/bin/ to your PATH environnement variable, and then to use arch-linux-gcc, arch-linux-objdump, - arch-linux-ld, etc.

    + arch-linux-ld, etc.

    For example, you may add the following to your .bashrc (considering you're building for the MIPS @@ -448,10 +448,10 @@ mips-linux-gcc -o foo foo.c gcc configuration. If the default toolchain directory doesn't suit your needs, please refer to the Using the uClibc toolchain outside of - buildroot section.

    + buildroot section.

    If you are using a current gcc-4.x, then use --sysroot and -isysroot since these toolchains have fully functional sysroot support. No - hardcoded paths do exist in these configurations.

    + hardcoded paths do exist in these configurations.

    Using the uClibc toolchain outside of buildroot

    @@ -462,13 +462,13 @@ mips-linux-gcc -o foo foo.c or by other users. Moving the build_ARCH/staging_dir/ directory elsewhere is not possible if using gcc-3.x, because they are some hardcoded paths in the toolchain configuration. This works, thanks - to sysroot support, with current, stable gcc-4.x toolchains, of course.

    + to sysroot support, with current, stable gcc-4.x toolchains, of course.

    If you want to use the generated gcc-3.x toolchain for other purposes, you can configure Buildroot to generate it elsewhere using the option of the configuration tool : Build options -> Toolchain and header file location, which defaults to - $(BUILD_DIR)/staging_dir/.

    + $(BUILD_DIR)/staging_dir/.

    Location of downloaded packages

    @@ -480,18 +480,18 @@ mips-linux-gcc -o foo foo.c version of Buildroot which is know to be working with the associated tarballs. This will allow you to regenerate the toolchain and the target filesystem with exactly the same - versions.

    + versions.

    Extending Buildroot with more software

    This section will only consider the case in which you want to - add user-space software.

    + add user-space software.

    Package directory

    First of all, create a directory under the package - directory for your software, for example foo.

    + directory for your software, for example foo.

    Config.in file

    @@ -511,7 +511,7 @@ config BR2_PACKAGE_FOO

    Of course, you can add other options to configure particular - things in your software.

    + things in your software.

    The real Makefile

    @@ -519,7 +519,7 @@ config BR2_PACKAGE_FOO foo.mk. It will contain the Makefile rules that are in charge of downloading, configuring, compiling and installing the software. Below is an example that we will comment - afterwards.

    + afterwards.

          1  #############################################################
    @@ -587,7 +587,7 @@ config BR2_PACKAGE_FOO
         binary software. For other software such as libraries or more
         complex stuff with multiple binaries, it should be adapted. Look at
         the other *.mk files in the package
    -    directory.

    + directory.

    At lines 6-11, a couple of useful variables are defined :

    @@ -595,33 +595,33 @@ config BR2_PACKAGE_FOO
    • FOO_VERSION : The version of foo that - should be downloaded.
    • + should be downloaded.
    • FOO_SOURCE : The name of the tarball of foo on the download website of FTP site. As you can see - FOO_VERSION is used.
    • + FOO_VERSION is used.
    • FOO_SITE : The HTTP or FTP site from which foo archive is downloaded. It must include the complete path to the directory where FOO_SOURCE can be - found.
    • + found.
    • FOO_DIR : The directory into which the software will be configured and compiled. Basically, it's a subdirectory of BUILD_DIR which is created upon decompression of - the tarball.
    • + the tarball.
    • FOO_BINARY : Software binary name. As said - previously, this is an example for a single binary software.
    • + previously, this is an example for a single binary software.
    • FOO_TARGET_BINARY : The full path of the binary - inside the target filesystem.
    • + inside the target filesystem.

    Lines 13-14 defines a target that downloads the tarball from the remote site to the download directory - (DL_DIR).

    + (DL_DIR).

    Lines 16-18 defines a target and associated rules that uncompress the downloaded tarball. As you can see, this target @@ -631,7 +631,7 @@ config BR2_PACKAGE_FOO to mark the software has having been uncompressed. This trick is used everywhere in Buildroot Makefile to split steps (download, uncompress, configure, compile, install) while still - having correct dependencies.

    + having correct dependencies.

    Lines 20-31 defines a target and associated rules that configures the software. It depends on the previous target (the @@ -643,14 +643,14 @@ config BR2_PACKAGE_FOO /usr, not because the software will be installed in /usr on your host system, but in the target filesystem. Finally it creates a .configured file to - mark the software as configured.

    + mark the software as configured.

    Lines 33-34 defines a target and a rule that compiles the software. This target will create the binary file in the compilation directory, and depends on the software being already configured (hence the reference to the .configured file). It basically runs make inside the source - directory.

    + directory.

    Lines 36-38 defines a target and associated rules that install the software inside the target filesystem. It depends on the @@ -661,7 +661,7 @@ config BR2_PACKAGE_FOO the software inside host /usr but inside target /usr. After the installation, the /usr/man directory inside the target filesystem is - removed to save space.

    + removed to save space.

    Line 40 defines the main target of the software, the one that will be eventually be used by the top level @@ -678,18 +678,18 @@ config BR2_PACKAGE_FOO once for later offline build. Note that if you add a new package providing a foo-source target is mandatory to support users that wish to do offline-builds. Furthermore it eases checking - if all package-sources are downloadable.

    + if all package-sources are downloadable.

    Lines 44-46 define a simple target to clean the software build by calling the Makefiles with the appropriate option. The -clean target should run make clean on $(BUILD_DIR)/package-version and MUST uninstall all files of the - package from $(STAGING_DIR) and from $(TARGET_DIR).

    + package from $(STAGING_DIR) and from $(TARGET_DIR).

    Lines 48-49 define a simple target to completely remove the directory in which the software was uncompressed, configured and compiled. The -dirclean target MUST completely rm $(BUILD_DIR)/ - package-version.

    + package-version.

    Lines 51-58 adds the target foo to the list of targets to be compiled by Buildroot by first checking if @@ -699,7 +699,7 @@ config BR2_PACKAGE_FOO global variable. The name added to the TARGETS global variable is the name of this package's target, as defined on line 40, which is used by Buildroot to download, - compile, and then install this package.

    + compile, and then install this package.

    Conclusion

    @@ -707,7 +707,7 @@ config BR2_PACKAGE_FOO

    As you can see, adding a software to buildroot is simply a matter of writing a Makefile using an already existing example and to modify it according to the compilation process of - the software.

    + the software.

    If you package software that might be useful for other persons, don't forget to send a patch to Buildroot developers !

    -- cgit v1.2.3