Skip to content

Source Layout

Calin Crisan edited this page Sep 14, 2018 · 10 revisions

The source code, being inherited from BuildRoot, is organized as follows:


board Folder

The board folder contains files required to put together the boot and root filesystems of the OS. It is divided into two parts: a common part (living under board/common), dealing with things that are common to all boards and a board-specific part, dealing with the particularities of each board (living under board/<board>.

board/common Scripts

In board/common you can find the following scripts:

  • postscript.sh - gives the final touches to the root filesystem
  • cleanups.sh - called from postscript.sh, removes unnecessary files installed by packages
  • mkimage.sh - combines the boot and root filesystems into a full OS image

board/common/skeleton Folder

The folders found in board/common/skeleton are used to create the initial folder structure of the root filesystem. This is part of the first root filesystem preparation stage, taking place before installing any packages.

board/common/overlay Folder

Contents of board/common/overlay are used to add common files to the root filesystem. New files can be added and existing files (provided by packages) can be overwritten. This is part of the final root filesystem preparation stage, taking place after installing all the packages.

Board-specific Files & Folders

Each supported board has a corresponding subfolder in board. In a board-specific subfolder you can find:

  • an overlay folder used in a similar way to board/common/overlay, but only for the respective board
  • an overlay-initramfs folder used to build the initramfs filesystem (see Firmware Updates)
  • postscript.sh, cleanups.sh and mkimage.sh scripts having the same role as the corresponding ones in board/common, but applied only for the respective board
  • various board-specific files, such as kernel or boot configurations

package Folder

The package folder contains all the available packages. See Add New Packages for understanding how to add your own packages to the source tree.

output Folder

The output folder is not actually part of the source tree but is rather created as soon as you start configuring and building the OS for a board.

For each board that you build the OS for, a subfolder will be created in output. Inside of the board subfolder, you'll find:

  • build - this is where packages are extracted and built
  • host - this is where stuff that needs to run on the host lives
  • staging - this is the staging directory required when cross-compiling packages
  • target - this is where the root filesystem of your OS is created
  • images - this is the folder where the various images are created

dl Folder

The dl folder is not actually part of the source tree but is rather created as soon as you start configuring and building the OS for a board.

Everything that needs to be downloaded goes to this dl folder.

build.sh Script

build.sh is the main script that should be used to configure, build and prepare the OS image. See Getting Started/Building for more details.

writeimage.sh Script

writeimage.sh is a helper script that should be used to transfer an OS image to an SD card. See Getting Started/Installing for more details.

Clone this wiki locally