Skip to content
Snippets Groups Projects
Verified Commit e54a2cfb authored by Andrei Gherzan's avatar Andrei Gherzan :penguin:
Browse files

docs: Add structure and initial content


Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
parent 7ea08bf0
No related branches found
No related tags found
No related merge requests found
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
Build system documentation
##########################
.. toctree::
:maxdepth: 1
openharmony-quick-build
yocto-build-system/index
repo-workspace
build-flavours/index
ohos-build/index
demos/index
hardware-support/index
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
Build Configuration
###################
The build system recipes provide various functionalities that expose knobs and
primitives.
.. toctree::
:maxdepth: 1
visual-customizations
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
Build System Visual Customizations
##################################
.. contents::
:depth: 2
Weston dynamic configuration
****************************
The build exposes mechanism to tweak weston configuration through build
variables. These variables can be provided as part of any configuration (eg.
*local.conf*, *distro.conf*).
The mechanism is enabled by setting ``WESTON_DYNAMIC_INI`` to ``1``. Any of the
following variables will be ignored if this variable is not set to ``1``. The
configuration file path can also be set via a variable: ``WESTON_INI_PATH``.
The default value of ``WESTON_INI_PATH`` should be fine for most of the cases.
Additional variable to be used in conjuction with ``WESTON_DYNAMIC_INI``:
* ``WESTON_INI_NO_TOOLBAR`` - remove the shell panel when set to ``1``
* Configuration for shell background
* ``WESTON_INI_BACKGROUND_IMAGE`` - sets shell.background-image accordingly
* ``WESTON_INI_BACKGROUND_COLOR`` - sets shell.background-color accordingly
* ``WESTON_INI_BACKGROUND_TYPE`` - sets shell.background-type accordingly
Epiphany support for Application mode
*************************************
Epiphany is one of the browsers supported by the build meta-data. It provides a
webkitgtk-based browser.
The build exposes the ability to run the browser as a system service in
application mode. This can be easily configurable and extended via the build
metadata and variables.
Available variables:
* ``EPIPHANY_APP`` - the application name
* ``EPIPHANY_URL`` - the URL to be used when browser starts
* ``EPIPHANY_RDEPENDS`` - additional dependencies needed at runtime
* ``EPIPHANY_SERVICE_ENABLED`` - when set to ``1``, build system will enable
the systemd service for starting at boot
The build system provides support for using this mechanism with *HomeAssistant*. See this support as an example for how to implement a custom application mode for Epiphany.
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
OpenHarmony - Quick Build
#########################
This section will guide you to building your first OpenHarmony image targeting
a supported reference hardware. It will also provide the steps for flashing and
booting such an image.
The steps below will focus on a Qemu-based target. If you want to get a feeling
of OpenHarmony on a real hardware, checkout the :ref:`Avenger96 support page
<SupportedBoardAvenger96>`.
.. contents::
:depth: 2
Prerequisites
*************
Have a **Ubuntu 20.04 LTS** host with all the required host packages.
.. code-block:: console
$ sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
pylint3 xterm
Clone build system repositories
*******************************
Install Google git repo tool:
.. code-block:: console
$ sudo add-apt-repository ppa:openharmony/tools
$ sudo apt-get update
$ sudo apt-get install git-repo
Initialize a repo workspace and clone all required repositories:
.. code-block:: console
$ mkdir ohos; cd ohos
$ repo init -u https://git.ostc-eu.org/OSTC/OHOS/manifest.git -b develop
$ repo sync --no-clone-bundle
Build the openharmony-image-base image
**************************************
The following steps will build a ``openharmony-image-base``. The process will
build all its components, including the toolchain, from source.
First of all change directory into the one where the build repositories were
cloned using the repo tool. See above.
Initialize the build directory and run a build:
.. code-block:: console
$ TEMPLATECONF=../sources/meta-ohos/flavours/linux . ./sources/poky/oe-init-build-env build-ohos-linux
$ MACHINE=qemux86-64 bitbake openharmony-image-base
Booting a Qemu X86-64 target with a OpenHarmony image
*****************************************************
Once the build is done, you can run a Qemu X86-64 instance as it follows:
Once the image is done, you can run the Qemu usin the provided script wrapper:
.. code-block:: console
$ MACHINE=qemux86-64 runqemu
If the host has a VT-capable CPU, you can pass the ``kvm`` argument for better
performance. Check ``runqemu``'s help message for all available arguments.
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. _RepoWorkspace:
Repo Workspace
##############
OpenHarmony uses `repo <https://android.googlesource.com/tools/repo>`_ to
provide full workspace setup that includes all the repositories needed for
building OpenHarmony and developing on top.
.. contents::
:depth: 2
The Repo Tool
*************
OpenHarmony provides a patched version of the repo tool published as a
`launchpad PPA <https://launchpad.net/~openharmony/+archive/ubuntu/tools>`_.
The patches are also available in the tool's `source repository <https://git.ostc-eu.org/OSTC/packaging/git-repo>`_.
Install this tool by following the next steps:
.. code-block:: console
$ sudo add-apt-repository ppa:openharmony/tools
$ sudo apt-get update
$ sudo apt-get install git-repo
The Manifests
*************
The `manifest repository <https://git.ostc-eu.org/OSTC/OHOS/manifest>`_
provides the manifests available for configuring a workspace. The project provides two kinds of manifests:
* develop manifests (where some projects are following a branch)
* default manifests (where all projects are pinned to specific revisions)
Setting up the Workspace
************************
Once the repo tool is installed, you can initialize and populate the workspace.
This will bring in all the needed sources for building Openharmony:
.. code-block:: console
$ mkdir ohos; cd ohos
$ repo init -u https://git.ostc-eu.org/OSTC/OHOS/manifest.git -b stable
$ repo sync --no-clone-bundle
You can checkout latest development source code by using *develop* branch
instead of *stable* as part of the above repo init command.
Workspace structure
*******************
A fully set workspace, will provide a structure similar to:
.. code-block:: none
./ohos/
└── sources
├── meta-freertos
├── meta-ohos
├── meta-openembedded
├── meta-zephyr
├── <various yocto layers>
└── poky
The *sources* directory will include ``poky`` and all the build system layers
that are part of the build process. Any new layers will be included under this
directory.
It is recommended to use the root of the workspace for the build directories
using ``build`` as directory name prefix.
docs/yocto-build-system/assets/meta-ohos-arch.png

53.6 KiB

SPDX-FileCopyrightText: Huawei Inc.
SPDX-License-Identifier: CC-BY-4.0
\ No newline at end of file
' SPDX-FileCopyrightText: Huawei Inc.
'
' SPDX-License-Identifier: CC-BY-4.0
@startuml meta-ohos-arch
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
Person(dev, "Developer", "Anyone willing to build the OHOS based image")
System(meta_ohos, "meta-ohos", "OpenHarmony OS umbrella bitbake meta-layer")
Boundary(poky, "poky") {
System_Ext(bitbake, "bitbake", "build process orchestrator")
System_Ext(linux_yocto, "linux-yocto", "Yocto Project LTS linux kernel")
System_Ext(meta_external_toolchain, "meta-external-toolchain", "Yocto Project LTS GNU GCC and LLVM toolchains")
}
System_Ext(meta_zephyr, "meta-zephyr", "ZephyrOS meta-layer")
System_Ext(meta_freertos, "meta-freertos", "FreeRTOS meta-layer")
System_Ext(meta_freertos, "meta-freertos", "FreeRTOS meta-layer")
System_Ext(linux_yocto, "linux-yocto", "Yocto Project LTS linux kernel")
System_Ext(meta_external_toolchain, "meta-external-toolchain", "Yocto Project LTS GNU GCC and LLVM toolchains")
Rel(dev, bitbake, "selects configuration, initiates the build, deploys image to the target")
Rel(bitbake, meta_ohos, "incorporates meta-layers relevant for selected kernel / configuration")
Rel(bitbake, linux_yocto, "incorporates Yocto Project LTS linux kernel reference")
Rel(bitbake, meta_external_toolchain, "incorporates Yocto Project LTS toolchains")
Rel(bitbake, meta_zephyr, "incorporates for OHOS on Zephyr build")
Rel(bitbake, meta_freertos, "incorporates for OHOS on FreeRTOS build")
@enduml
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
OpenHarmony, a Yocto-based Build System
#######################################
OpenHarmony build system, the foundation of the build infrastructure, is based
on `Poky, the Yocto Project open source reference embedded distribution <https://www.yoctoproject.org/software-overview/>`_.
This section details both generic and OpenHarmony specific aspects of the build system.
.. toctree::
:maxdepth: 1
yocto-project
ohos-build-arch
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
OpenHarmony Build Architecture
##############################
``meta-ohos`` architecture is documented using `c4 model <https://c4model.com/>`_.
.. contents::
:depth: 2
Overview
********
OpenHarmony build infrastructure designed to run atop variety of OS kernels
ranging from RTOSs to Linux.
``meta-ohos`` is a *umbrella* of meta layers containing build meta-data
required for compiling OpenHarmony images. The architecture supports plugging
various kernels.
.. image:: assets/meta-ohos-arch.png
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
Poky/Yocto Project
##################
OpenHarmony aims to use standard opensource tools to create a build environment
that is both familiar to users in the domain but also flexible enough for the
requirements of the project. With this in mind, the project build
infrastructure is based on the OpenEmbedded build system, more specifically
`Poky, the Yocto Project open source reference embedded distribution <https://www.yoctoproject.org/software-overview/>`_.
.. contents::
:depth: 3
Build System Concepts
*********************
The build system uses build instruction files that in the language of the
system are called ``recipes`` and ``layers``.
Layers are one of the fundamental models of the build system. It enables both
collaboration and customization by defining scoped meta-data. These layers
become a collection of build instruction files that have a defined scope. For
example, there are BSP (board support package) layers that enable board support
in the build system.
See `terms for reference <https://www.yoctoproject.org/software-overview/>`_
for more information.
OpenHarmony Build Layers
------------------------
OpenHarmony bases its build setup on Poky, the Yocto Project open source
reference embedded distribution. The main hub of layers, is `meta-ohos <https://git.ostc-eu.org/OSTC/meta-ohos/>`_,
a collection of layers with different scopes for defining the project's
requirements and capabilities.
For example, ``meta-ohos-core`` provides build recipes for defining the core
policies of the build infrastructure (`distribution` configuration, images,
core packages customization, etc.).
Another example is ``meta-ohos-staging``, a layer that provides temporary fixes
and support for changes that are aimed upstream but have this place until
upstream catches up.
For more details of each provided layer of ``meta-ohos``, see the relevant
``README.md`` file at the root of the layer,
Besides the ``meta-ohos`` collection of layers, the project is also the home
to a set of other build system layers. Explore them all in our project `GitLab <https://git.ostc-eu.org/OSTC/OHOS>`_
instance.
Aditional Documentation
***********************
`Yocto Project <https://www.yoctoproject.org>`_ provides extensive
documentation on various aspects of the build system. For the general usage of the build system, it's components, architecture and capabilities consult the following resources:
- `Yocto Project Documentation Home <https://docs.yoctoproject.org/>`_
- `Yocto Project Quick Build <https://www.yoctoproject.org/docs/current/brief-yoctoprojectqs/brief-yoctoprojectqs.html>`_
- `Yocto Project Reference Manual <https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html>`_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment