Skip to content
Snippets Groups Projects
Commit 19947469 authored by Esben Haabendal's avatar Esben Haabendal
Browse files

openharmony-tools: New recipe for SDK style tools bundle


This recipe builds a simple Yocto SDK style bundle, initially containing hdc and
xdevice tools.

As such, it can be used for running ACTS testcases.

Signed-off-by: default avatarEsben Haabendal <esben@geanix.com>
parent 1a7e53dd
No related branches found
No related tags found
1 merge request!94Add openharmony-tools image for host hdc and xdevice tools
...@@ -116,6 +116,14 @@ quickly building and running OpenHarmony code in QEMU ARM simulator. ...@@ -116,6 +116,14 @@ quickly building and running OpenHarmony code in QEMU ARM simulator.
See [recipes-openharmony/images/README.md](recipes-openharmony/images/README.md) See [recipes-openharmony/images/README.md](recipes-openharmony/images/README.md)
for more information. for more information.
## OpenHarmony host tools
To facilitate working with OpenHarmony systems, an image with various host tools
is provided.
See [recipes-openharmony/tools/README.rst](recipes-openharmony/tools/README.rst)
for more information.
## OpenHarmony prebuilts ## OpenHarmony prebuilts
The meta-openharmony layer enables building of prebuilts for use with the The meta-openharmony layer enables building of prebuilts for use with the
......
.. SPDX-FileCopyrightText: Huawei Inc.
..
.. SPDX-License-Identifier: CC-BY-4.0
.. _OpenHarmony SDK:
OpenHarmony Tools
#################
OpenHarmony provides a number of dedicated host tools for working with
OpenHarmony systems.
The `openharmony-tools` recipe bundles up these tools for easy installation of these on a Linux host OS.
Building
********
To build `openharmony-tools` for OpenHarmony 3.0.1, an initialized build
environment is required::
TEMPLATECONF=../meta-openharmony/conf source oe-core/oe-init-build-env
Once that is in place, the `bitbake` command is simply::
DISTRO=oniro-openharmony-linux MACHINE=qemuarma7 bitbake openharmony-tools
Installation
************
To install the tools on a Linux host OS, you need to use the shell script
installer. To install into /opt/openharmony-tools do something like this:
.. code-block:: console
$ ./openharmony-tools-3.0-cortexa7-neon-vfpv4-1.99.99.sh -y -d /opt/openharmony-tools
As the installation above will explain, in order to use the tools you need to do the following:
In order to use the installed tools, you need to setup your shell environment
(this needs to be done each time you create a new shell):
.. code-block:: console
$ . /opt/openharmony-tools/environment-setup-x86_64-oesdk-linux
And with that, you will have access to `hdc` and `xdevice` commands.
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
SUMMARY = "OpenHarmony development tools"
LICENSE = "Apache-2.0"
require sanity-check.inc
TOOLCHAIN_HOST_TASK = "nativesdk-hdc nativesdk-xdevice"
TOOLCHAIN_TARGET_TASK = ""
TOOLCHAIN_OUTPUTNAME = "${PN}-${OPENHARMONY_VERSION}-${TUNE_PKGARCH}-${SDK_VERSION}"
SDK_TITLE = "OpenHarmony tools"
SDK_VERSION ?= "${DISTRO_VERSION}"
RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
inherit populate_sdk
inherit toolchain-scripts-base
inherit nopackages
deltask install
deltask populate_sysroot
do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}"
create_sdk_files:append () {
rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-*
rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-*
rm -f ${SDK_OUTPUT}/${SDKPATH}/version-*
# Generate new (mini) sdk-environment-setup file
script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}}
touch $script
echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${sbindir_nativesdk}:${SDKPATHNATIVE}${base_bindir_nativesdk}:${SDKPATHNATIVE}${base_sbindir_nativesdk}:$PATH' >> $script
echo 'export PYTHONPATH=${SDKPATHNATIVE}${libdir_nativesdk}/python*/site-packages:$PYTHONPATH' >> $script
echo 'export OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
if [ -e "${SDK_OUTPUT}${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt" ]; then
echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
echo 'export SSL_CERT_FILE="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
fi
toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS}
cat >> $script <<EOF
if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
for envfile in \$OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
. \$envfile
done
fi
# We have to unset this else it can confuse oe-selftest and other tools
# which may also use the overlapping namespace.
unset OECORE_NATIVE_SYSROOT
EOF
if [ "${SDKMACHINE}" = "i686" ]; then
echo 'export NO32LIBS="0"' >>$script
echo 'echo "$BB_ENV_PASSTHROUGH_ADDITIONS" | grep -q "NO32LIBS"' >>$script
echo '[ $? != 0 ] && export BB_ENV_PASSTHROUGH_ADDITIONS="NO32LIBS $BB_ENV_PASSTHROUGH_ADDITIONS"' >>$script
fi
}
TOOLCHAIN_NEED_CONFIGSITE_CACHE = ""
INHIBIT_DEFAULT_DEPS = "1"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# Skip recipe if openharmony is not in DISTRO_FEATURES
inherit features_check
REQUIRED_DISTRO_FEATURES = "openharmony"
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