Skip to content

Source Layout

Calin Crisan edited this page May 5, 2022 · 10 revisions

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

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 and cleanups.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

configs Folder

In the configs folder you'll find two files for each supported board:

  • <board>_defconfig - the default thingOS configuration corresponding to that board
  • <board>_initramfs_defconfig - the default initramfs configuration corresponding to that board

See Board Configurations for more details.

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