Building TanoWrt
Contents
Preparing Build Environment
The recommended Linux distribution on host system is Ubuntu 20.04 or higher.
Install Required Packages
For a successful build, additional packages must be installed. To do this, run the command:
# sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping file
If you are using Ubuntu, you will need to configure the default system shell command interpreter for shell scripts to bash. You can do it with the command:
# sudo dpkg-reconfigure dash
Select No when it asks you to install dash as /bin/sh
.
Install kas
To build TanoWrt the kas utility is used. kas is a setup tool for BitBake based projects by Siemens.
To install kas into your python site-package repository, run:
$ pip3 install kas==3.1.0
See official kas documentation for more details about kas utility.
Clone TanoWrt Repository
Clone TanoWrt core layer repository to your home directory (this document uses ~/tanowrt
for example):
$ cd ~
$ git clone https://github.com/tano-systems/meta-tanowrt tanowrt
Initialize and Update Submodules
When using the kas utility, it is required to have BitBake at the root of the meta-tanowrt layer. The BitBake submodule must be initialized and updated before building:
$ cd ~/tanowrt
$ git submodule update --init
Build
In general to build TanoWrt you need to use the following command:
$ kas build [--target <target-recipe>] <target-yml>
Where:
- --target <target-recipe>
Optional
Recipe name for the build. Typically, you need to specify this option when you want to build an image (or recipe) other than the default image used for the chosen target.
This option is not limited to choosing the image to build. This option allows you to build any recipe, be it an image or an individual application recipe.
- <target-yml>
Required
Path to the target YAML file. All target YAML files in TanoWrt are located at
kas/targets
directory of themeta-tanowrt
repository.
Tip
If you see Command 'kas' not found
just add ~/.local/bin
to your $PATH
,
for example by adding the following line to your .bashrc
file:
export PATH="$HOME/.local/bin:$PATH"
After that, restart your shell and things should work as expected.
For example, to build TanoWrt images for internal eMMC flash of the NXP LS1028A RDB board
you need to run following commands from meta-tanowrt
root directory:
# cd ~/tanowrt
# kas build kas/targets/ls1028ardb-emmc.yml
See Demonstration Boards Support to select the proper target YML file.
Local Configuration
The build configuration build/conf/local.conf
is generated
automatically by the kas utility depending on the chosen build target.
To define your own local build configuration, it must be stored in
the local.conf
file located at the root of the meta-tanowrt
repository (cloned to ~/tanowrt
in this example).
When building, the local.conf
file is included after the
build/conf/local.conf
file, allowing any directives declared
in build/conf/local.conf
to be overridden if necessary.
In local.conf
file you can specify any standard
configuration variables. In other words, you can do everything
in the local.conf' file that you do in the standard
:file:`build/conf/local.conf
. For example, you can specify
an external directory for storing downloaded content, as well
as configure build parallelism settings:
DL_DIR = "/home/build-user/downloads"
BB_NUMBER_THREADS = "8"
PARALLEL_MAKE = "-j 8"
Note
Normally, the parallelism configuration variables BB_NUMBER_THREADS
and PARALLEL_MAKE
do not need to be configured, because if they are
not defined, the build system sets them automatically, depending on
the number of available processors.
Examples
QEMU (x86_64)
Clone TanoWrt core layer repository with submodules to your home directory (this document uses ~/tanowrt
for example):
$ cd ~
$ git clone --recursive https://github.com/tano-systems/meta-tanowrt tanowrt
$ cd ~/tanowrt
Build TanoWrt image by running the kas build
command with the path to the target YML-file as an argument:
$ kas build kas/targets/qemux86-64-screen.yml
Run the built image in QEMU:
$ kas shell -c "DISPLAY=:0 runqemu qemux86-64-screen" kas/targets/qemux86-64-screen.yml
or without graphics:
$ kas shell -c "runqemu qemux86-64-screen nographics" kas/targets/qemux86-64-screen.yml
Intel Core i7 (x86_64)
Clone TanoWrt core layer repository with submodules to your home directory (this document uses ~/tanowrt
for example):
$ cd ~
$ git clone --recursive https://github.com/tano-systems/meta-tanowrt tanowrt
$ cd ~/tanowrt
Build TanoWrt image by running the kas build
command with the path to the target YML-file as an argument:
$ kas build kas/targets/intel-x86_64-corei7.yml
Run the built image in QEMU:
$ kas shell -c "DISPLAY=:0 runqemu intel-x86_64-corei7" kas/targets/intel-x86_64-corei7.yml