• Manually building a target system involves downloading, configuring, compiling and installing all the components of the system.
  • All the libraries and dependencies must be configured, compiled and installed in the right order.
  • Sometimes, the build system used by libraries or applications is not very cross-compile friendly, so some adaptations are necessary.
  • There is no infrastructure to reproduce the build from scratch, which might cause problems if one component needs to be changed, if somebody else takes over the project, etc.

  • Manual system building is not recommended for production projects

  • However, using automated tools often requires the developer to dig into specific issues
  • Having a basic understanding of how a system can be built manually is therefore very useful to fix issues encountered with automated tools
    • We will first study manual system building, and during a practical lab, create a system using this method
    • Then, we will study the automated tools available, and use one of them during a lab

System foundations

  • A basic root file system needs at least
    • A traditional directory hierarchy, with /bin, /etc, /lib, /root, /usr/bin, /usr/lib, /usr/share, /usr/sbin, /var, /sbin
    • A set of basic utilities, providing at least the init program, a shell and other traditional Unix command line tools. This is usually provided by Busybox
    • The C library and the related libraries (thread, math, etc.) installed in /lib
    • A few configuration files, such as /etc/inittab, and initialization scripts in /etc/init.d
  • On top of this foundation common to most embedded Linux system, we can add third-party or in-house components

Target and build spaces

  • The system foundation, Busybox and C library, are the core of the target root filesystem
  • However, when building other components, one must distinguish two directories
    • The target space, which contains the target root filesystem, everything that is needed for execution of the application
    • The build space, which will contain a lot more files than the target space, since it is used to keep everything needed to compile libraries and applications. So we must keep the headers, documentation, and other configuration files

Build systems

Each open-source component comes with a mechanism to configure, compile and install it

  • A basic Makefile
    • Need to read the Makefile to understand how it works and how to tweak it for cross-compilation
  • A build system based on the Autotools
    • As this is the most common build system, we will study it in details
  • CMake,
    • Newer and simpler than the autotools. Used by large projects such as KDE or Second Life
  • Scons,
  • Waf,
  • Other manual build systems

results matching ""

    No results matching ""