Newer
Older
# Build scripts for Total Compute stack
This README is simply a quick-start guide on the build scripts themselves. For more
information on how to obtain and run the Total Compute stack, please refer to
the user guide.
## Prerequisites
Sergio Alves
committed
-------------
Install and allow access to docker
Sergio Alves
committed
```bash
sudo apt install docker.io
sudo chmod 777 /var/run/docker.sock
```
## Setup
1. Pull/Build a Docker image from Container registry;
2. Setup the environment to build TC images.
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Setting up a docker image involves pulling the prebuilt docker image from a docker registry. If that fails, it will build a local docker image.
To setup a docker image, patch the components, install the toolchains and build tools, please run the following listed commands according to the distro and variant of interest.
The various tools will be installed in the ``<TC2_WORKSPACE>/tools/`` directory.
## Build options
-------------
### Debian OS build variant
Currently, the Debian OS build distro support is limited to Mali GPU hardware rendering based on DDK source code compilation, by explicitly setting the build environment variable as ``TC_GPU=hwr``.
**Note:** GPU DDK source code is available only to licensee partners (please contact support@arm.com).
### Android OS build variants
**Note:** Android based stack takes considerable time to build, so start the build and go grab a cup of coffee!
#### Hardware vs Software rendering
The Android OS based build distro supports the following variants regarding the use of the GPU rendering:
| TC_GPU value | Description |
|:------------:|:-------------------------------------------------------------------------------|
| swr | Android display with Swiftshader (software rendering) |
| hwr | Mali GPU (hardware rendering based on DDK source code - please see below note) |
| hwr-prebuilt | Mali GPU (hardware rendering based on prebuilt binaries) |
If not explicitly defined by the user, the default value used for the ``TC_GPU`` environment variable is ``hwr-prebuilt``.
**Note:** GPU DDK source code is available only to licensee partners (please contact support@arm.com).
#### Android Verified Boot (AVB) with/without authentication
The Android images can be built with or without authentication enabled using Android Verified Boot (AVB) through the use of the ``-a`` option.
AVB build is done in userdebug mode and takes a longer time to boot as the images are verified.
This option does not influence the way the system boots, rather it adds an optional sanity check on the prerequisite images.
## Build variants configuration
----------------------------
Sergio Alves
committed
For the Buildroot build:
```bash
export PLATFORM=tc2
export FILESYSTEM=buildroot
export TC_TARGET_FLAVOR=fvp
cd build-scripts
./setup.sh
```
For the Android build with hardware rendering based on prebuilt binaries:
```bash
export PLATFORM=tc2
export FILESYSTEM=android-fvp
export TC_GPU=hwr-prebuilt
export TC_TARGET_FLAVOR=fvp
export ARMCLANG_TOOL=<PATH TO ARMCLANG TOOLCHAIN>
cd build-scripts
For the Android build with hardware rendering based on DDK source code:
Sergio Alves
committed
```bash
export FILESYSTEM=android-fvp
export TC_GPU=hwr
Sergio Alves
committed
export TC_TARGET_FLAVOR=fvp
export GPU_DDK_REPO=<PATH TO GPU DDK SOURCE CODE>
export GPU_DDK_VERSION="releases/r41p0_01eac0"
Sergio Alves
committed
export LM_LICENSE_FILE=<LICENSE FILE>
export ARM_PRODUCT_DEF=<PATH TO ELMAP FILE IN ARMCLANG>
export ARMLMD_LICENSE_FILE=<LICENSE FILE>
export ARMCLANG_TOOL=<PATH TO ARMCLANG TOOLCHAIN>
Sergio Alves
committed
For the Android build with software rendering:
```bash
export TC_GPU=swr
Sergio Alves
committed
export TC_TARGET_FLAVOR=fvp
export FILESYSTEM=android-fvp
Sergio Alves
committed
## Build the stack
Sergio Alves
committed
---------------
To build the whole TC2 software stack, simply run:
```bash
./run_docker.sh ./build-all.sh build
```
Once the previous process finishes, the current ``<TC2_WORKSPACE>`` should have the following structure:
* build files are stored in ``<TC2_WORKSPACE>/output/tmp_build/``;
* final images will be placed in ``<TC2_WORKSPACE>/output/deploy/``.
Sergio Alves
committed
The ``build-all.sh`` script will build all the components, but each component has its own script, allowing it to be built, cleaned and deployed separately.
All scripts support the ``build``, ``clean``, ``deploy``, ``patch`` commands. ``build-all.sh`` also supports ``all``, which performs a clean followed by a rebuild of all the stack.
The platform and filesystem used should be defined as described previously, but they can also be specified as the following example:
```bash
./run_docker.sh ./build-all.sh -p $PLATFORM -f $FILESYSTEM -t $TC_TARGET_FLAVOR -g $TC_GPU build
```
## Build Components and its dependencies
-------------------------------------
Sergio Alves
committed
A new dependency to a component can be added in the form of `$component=$dependency` in `dependencies.txt` file
To build a component and rebuild those components that depend on it
Sergio Alves
committed
```bash
## Running the software on FVP
Sergio Alves
committed
---------------------------
For detailed information on how to obtain FVP and run the software on FVP, please consult the user guide documentation.
## Sanity tests
Sergio Alves
committed
------------
For detailed information on which sanity tests are provided with the TC software stack, how to run them and to check examples of the expected test output, please consult the user guide documentation.