Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eclipse/oniro4openharmony/meta-openharmony
  • esben/meta-openharmony
  • thierrye/meta-openharmony
  • robertd/meta-openharmony
  • kristis/meta-openharmony
  • gwozdzcfs/meta-openharmony
  • agherzan/meta-openharmony
  • landgraf/meta-openharmony
  • pastanki/meta-openharmony
  • bero/meta-openharmony
  • stefanschmidt/meta-openharmony
  • mrfrank/meta-openharmony
  • kzarka/meta-openharmony
  • lucafavaretto/meta-openharmony
14 results
Show changes
Commits on Source (221)
Showing
with 336 additions and 41 deletions
...@@ -27,6 +27,18 @@ ...@@ -27,6 +27,18 @@
# it? Can it be supported by Eclipse Foundation infrastructure? # it? Can it be supported by Eclipse Foundation infrastructure?
# #
#
# Runner tags
#
# The meta-openharmony pipeline uses runner tags to control selection of the
# GitLab CI runners to use for each job
#
# cpu.heavy - Can cause massive CPU load on multi-core systems
# cpu.light - Does not cause much CPU load (single-threaded or I/O bound)
# region.europe - Run in Europe
# region.china - Run in China
# mirror - Deploy mirror files (combine with region.* tag)
# switch between branch pipelines and merge request pipelines # switch between branch pipelines and merge request pipelines
workflow: workflow:
rules: rules:
...@@ -41,7 +53,9 @@ workflow: ...@@ -41,7 +53,9 @@ workflow:
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
include: include:
- local: '.gitlab-ci/container.yml' - local: '.gitlab-ci/container.yml'
- project: 'eclipsefdn/it/releng/gitlab-runner-service/gitlab-ci-templates'
file: '/jobs/eca.gitlab-ci.yml'
variables: variables:
# Force the use of git clone to avoid odd git and repo problems # Force the use of git clone to avoid odd git and repo problems
...@@ -70,12 +84,16 @@ variables: ...@@ -70,12 +84,16 @@ variables:
OPENHARMONY_BUILDER: "$CI_REGISTRY_IMAGE/openharmony-builder" OPENHARMONY_BUILDER: "$CI_REGISTRY_IMAGE/openharmony-builder"
stages: stages:
- compliance
- container - container
- maintenance - maintenance
- fetch - fetch
- build - build
- test - test
eca:
extends: .eca
# Common job definition for bitbake driven jobs, such as fetch and build # Common job definition for bitbake driven jobs, such as fetch and build
.bitbake: .bitbake:
image: image:
...@@ -176,8 +194,13 @@ stages: ...@@ -176,8 +194,13 @@ stages:
fi >> conf/auto.conf fi >> conf/auto.conf
- echo "RM_WORK_EXCLUDE += \"${RECIPE}\"" >> conf/auto.conf - echo "RM_WORK_EXCLUDE += \"${RECIPE}\"" >> conf/auto.conf
- echo "OPENHARMONY_VERSION = \"${OPENHARMONY_VERSION}\"" >> conf/auto.conf - echo "OPENHARMONY_VERSION = \"${OPENHARMONY_VERSION}\"" >> conf/auto.conf
- if [ -n "$TAP_ADDR" ] ; then
sudo ip tuntap add tap0 mode tap ;
sudo ip addr add dev tap0 "$TAP_ADDR" ;
sudo ip link set tap0 up ;
fi
script: script:
- time bitbake "${RECIPE}" - time bitbake ${RECIPE}
after_script: after_script:
# Update sstate-cache mirror # Update sstate-cache mirror
- if [ -n "$CI_ONIRO_RUNNER_PERSISTENT_STORAGE" -a -d build/sstate-cache ] ; then - if [ -n "$CI_ONIRO_RUNNER_PERSISTENT_STORAGE" -a -d build/sstate-cache ] ; then
...@@ -206,7 +229,12 @@ fetch: ...@@ -206,7 +229,12 @@ fetch:
- job: bitbake-builder - job: bitbake-builder
artifacts: false artifacts: false
optional: true optional: true
tags:
- cpu.light
script: script:
# Fetching is io-bound, not cpu-bound, so we should be able to ignore the
# runner configured max on build jobs without eating up too much cpu time.
- echo "PARALLEL_MAKE = \"-j$(nproc)\"" >> conf/auto.conf
# Configure build to create mirror tarballs of VCS repositories # Configure build to create mirror tarballs of VCS repositories
- echo 'BB_GENERATE_MIRROR_TARBALLS = "1"' >> conf/auto.conf - echo 'BB_GENERATE_MIRROR_TARBALLS = "1"' >> conf/auto.conf
# Run fetch tasks for all builds # Run fetch tasks for all builds
...@@ -217,7 +245,7 @@ fetch: ...@@ -217,7 +245,7 @@ fetch:
- export DISTRO MACHINE - export DISTRO MACHINE
- for DISTRO in oniro-openharmony-linux ; do - for DISTRO in oniro-openharmony-linux ; do
for OPENHARMONY_VERSION in 3.0 ; do for OPENHARMONY_VERSION in 3.0 ; do
for MACHINE in qemuarma7 ; do for MACHINE in qemuarma7 raspberrypi4-64 ; do
RECIPES="oniro-openharmony-bundle openharmony-standard-image openharmony-standard-image-tests" ; RECIPES="oniro-openharmony-bundle openharmony-standard-image openharmony-standard-image-tests" ;
echo Fetching DISTRO=$DISTRO OPENHARMONY_VERSION=$OPENHARMONY_VERSION MACHINE=$MACHINE ; echo Fetching DISTRO=$DISTRO OPENHARMONY_VERSION=$OPENHARMONY_VERSION MACHINE=$MACHINE ;
sed -r "s/^OPENHARMONY_VERSION.*/OPENHARMONY_VERSION = \"${OPENHARMONY_VERSION}\"/" -i conf/auto.conf ; sed -r "s/^OPENHARMONY_VERSION.*/OPENHARMONY_VERSION = \"${OPENHARMONY_VERSION}\"/" -i conf/auto.conf ;
...@@ -234,9 +262,9 @@ fetch: ...@@ -234,9 +262,9 @@ fetch:
SOURCE_MIRROR_PATH="$CI_PROJECT_DIR/build/mirror" ; SOURCE_MIRROR_PATH="$CI_PROJECT_DIR/build/mirror" ;
fi fi
- echo "Syncing mirror files to $SOURCE_MIRROR_PATH" - echo "Syncing mirror files to $SOURCE_MIRROR_PATH"
- if [ $CI_SERVER_HOST = "gitlab.eclipse.org" -a - if [ "$CI_SERVER_HOST" = "gitlab.eclipse.org" -a
$CI_PROJECT_PATH = "eclipse/oniro-core/meta-openharmony" -a "$CI_PROJECT_PATH" = "eclipse/oniro-oh/meta-openharmony" -a
$CI_COMMIT_BRANCH == "kirkstone" ] ; then "$CI_COMMIT_BRANCH" = "kirkstone" ] ; then
DO_MIRROR_UPDATES_CH=1 ; DO_MIRROR_UPDATES_CH=1 ;
fi fi
- mkdir -pv build/mirror-updates-ch - mkdir -pv build/mirror-updates-ch
...@@ -271,7 +299,7 @@ mirror_ch: ...@@ -271,7 +299,7 @@ mirror_ch:
- job: fetch - job: fetch
artifacts: true artifacts: true
rules: rules:
- if: $CI_SERVER_HOST == "gitlab.eclipse.org" && $CI_PROJECT_PATH == "eclipse/oniro-core/meta-openharmony" && $CI_COMMIT_BRANCH == "kirkstone" - if: $CI_SERVER_HOST == "gitlab.eclipse.org" && $CI_PROJECT_PATH == "eclipse/oniro-oh/meta-openharmony" && $CI_COMMIT_BRANCH == "kirkstone"
# No need to mark builds broken due to infrastructure problems # No need to mark builds broken due to infrastructure problems
allow_failure: true allow_failure: true
tags: tags:
...@@ -286,12 +314,9 @@ mirror_ch: ...@@ -286,12 +314,9 @@ mirror_ch:
fi ; fi ;
done done
# Build OpenHarmony images using normal CI runners # Build using normal CI runners
build: .build:
stage: build stage: build
needs:
- job: fetch
artifacts: false
rules: rules:
- if: $CHINA_CI != null - if: $CHINA_CI != null
# Don't use CI resources on normal builds when doing China builds # Don't use CI resources on normal builds when doing China builds
...@@ -300,13 +325,42 @@ build: ...@@ -300,13 +325,42 @@ build:
extends: .bitbake extends: .bitbake
after_script: after_script:
- !reference [.bitbake, after_script] - !reference [.bitbake, after_script]
- time repo/oe-core/scripts/pybootchartgui/pybootchartgui.py build/tmp-*/buildstats/* -o build/tmp-*/buildstats - repo/oe-core/scripts/pybootchartgui/pybootchartgui.py build/tmp-*/buildstats/* -o build/tmp-*/buildstats
tags:
- cpu.heavy
# Build OpenHarmony toolchain recipes
toolchain:
extends: .build
needs:
- job: fetch
artifacts: false
variables:
DISTRO: oniro-openharmony-linux
OPENHARMONY_VERSION: "3.0"
RECIPE: oniro-openharmony-toolchain oniro-openharmony-bundle
parallel:
matrix:
- MACHINE: [qemuarma7, raspberrypi4-64]
artifacts:
paths:
- build/tmp-*/deploy/sdk
- build/tmp-*/buildstats*
expire_in: 1 month
# Build OpenHarmony images
build:
extends: .build
needs:
- job: toolchain
artifacts: false
variables:
DISTRO: oniro-openharmony-linux
OPENHARMONY_VERSION: "3.0"
RECIPE: openharmony-standard-image openharmony-tools
parallel: parallel:
matrix: matrix:
- DISTRO: [oniro-openharmony-linux] - MACHINE: [qemuarma7, raspberrypi4-64]
OPENHARMONY_VERSION: ["3.0"]
MACHINE: [qemuarma7]
RECIPE: [oniro-openharmony-toolchain, oniro-openharmony-bundle, openharmony-standard-image]
artifacts: artifacts:
paths: paths:
- build/tmp-*/deploy/images/${MACHINE} - build/tmp-*/deploy/images/${MACHINE}
...@@ -328,18 +382,59 @@ ptest: ...@@ -328,18 +382,59 @@ ptest:
when: never when: never
- when: on_success - when: on_success
extends: .bitbake extends: .bitbake
tags:
- cpu.heavy
variables:
DISTRO: oniro-openharmony-linux
OPENHARMONY_VERSION: "3.0"
RECIPE: openharmony-standard-image-tests
TAP_ADDR: 192.168.7.1/30
parallel: parallel:
matrix: matrix:
- DISTRO: [oniro-openharmony-linux] - MACHINE: [qemuarma7]
OPENHARMONY_VERSION: ["3.0"]
MACHINE: [qemuarma7]
RECIPE: [openharmony-standard-image-tests]
artifacts: artifacts:
paths: paths:
- build/tmp-*/work/*/*/*/testimage - build/tmp-*/work/*/*/*/testimage
expire_in: 1 month expire_in: 1 month
when: always when: always
acts:
stage: test
needs:
- job: bitbake-builder
artifacts: false
optional: true
- job: build
artifacts: true
image:
name: $BITBAKE_BUILDER:$BITBAKE_CONTAINER_VERSION
extends: .bitbake
variables:
DISTRO: oniro-openharmony-linux
OPENHARMONY_VERSION: "3.0"
MACHINE: qemuarma7
TAP_ADDR: 192.168.7.1/30
HDC_CONNECT_ATTEMPTS: 6
HDC_CONNECT_DELAY: 10
ACTS_TESTS: "ActsFaultLoggerTest ActsHiAppEventJsTest ActsHiCollieCppTest ActsHilogTest ActsLibhilogCPPTest ActsLibhilogCTest ActsHiSysEventCPPTest ActsHitraceCPPTest ActsHitraceCTest ActsStartupJSApiTest ActsPowerMgrBatteryTest ActsOsAccountJSApiTest ActsAppdatamagrJsTest ActsDistributedDatamgrJsTest ActsContextTest ActsAmsDataUriUtilsTest ActsAmsZipfileUnzipfileSTest ActsGetWantAllTest ActsFeatureAbilityTest ActsBmsCheckPermissionTest ActsBmsJsTest ActsBmsKitTest ActsBmsModuleUsageRecordTest ActsBundleManagerTest ActsBundleManagerUninstallTest"
script:
- bitbake qemu-helper-native
- runqemu publicvnc serialstdio & sleep 130
- ./tmp-*/deploy/sdk/openharmony-tools-${OPENHARMONY_VERSION}-cortexa7-neon-vfpv4-*.sh -y -d openharmony-tools
- source ./openharmony-tools/environment-setup-$(uname -m)*
- i=0 ; while [ "$i" -lt $HDC_CONNECT_ATTEMPTS ] ; do
hdc_result="$(hdc tconn 192.168.7.2:35000)" ; echo "hdc:" "$hdc_result" ;
if [[ "$hdc_result" == "Connect OK"* ]] ; then break ; fi ;
sleep $HDC_CONNECT_DELAY ; let i=i+1 ; done ;
if [ "$i" -eq $HDC_CONNECT_ATTEMPTS ] ; then exit 1 ; fi
- xdevice run acts -l $(echo "$ACTS_TESTS"|tr ' ' ';')
artifacts:
when: always
paths:
- build/reports
reports:
junit: build/reports/latest/summary_report.xml
# Build OpenHarmony images using CI runner in China. # Build OpenHarmony images using CI runner in China.
# #
# Note, you might want to allow the mirror_ch job to complete before running # Note, you might want to allow the mirror_ch job to complete before running
...@@ -361,8 +456,9 @@ build_ch: ...@@ -361,8 +456,9 @@ build_ch:
# URL and filename for tarball containing entire OpenHarmony OS codebase # URL and filename for tarball containing entire OpenHarmony OS codebase
.openharmony_tarball: .openharmony_tarball:
rules: rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_MERGE_REQUEST_EVENT_TYPE == "merge_train"
- if: $CI_COMMIT_BRANCH # Only run these rather expensive jobs in the merge train pipelines
- if: $CI_COMMIT_BRANCH || $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual when: manual
# We don't really want these jobs to fail, but we don't want to block # We don't really want these jobs to fail, but we don't want to block
# pipeline and dependent jobs either # pipeline and dependent jobs either
...@@ -395,6 +491,8 @@ ohos_fetch: ...@@ -395,6 +491,8 @@ ohos_fetch:
image: image:
name: $OPENHARMONY_BUILDER:$OPENHARMONY_CONTAINER_VERSION name: $OPENHARMONY_BUILDER:$OPENHARMONY_CONTAINER_VERSION
extends: .openharmony_tarball extends: .openharmony_tarball
tags:
- cpu.light
parallel: parallel:
matrix: matrix:
- OPENHARMONY_VERSION: ["3.0"] - OPENHARMONY_VERSION: ["3.0"]
...@@ -441,7 +539,7 @@ ohos: ...@@ -441,7 +539,7 @@ ohos:
optional: true optional: true
- job: ohos_fetch - job: ohos_fetch
artifacts: true artifacts: true
- job: build - job: toolchain
artifacts: true artifacts: true
parallel: parallel:
matrix: matrix:
...@@ -450,10 +548,12 @@ ohos: ...@@ -450,10 +548,12 @@ ohos:
image: image:
name: $OPENHARMONY_BUILDER:$OPENHARMONY_CONTAINER_VERSION name: $OPENHARMONY_BUILDER:$OPENHARMONY_CONTAINER_VERSION
extends: .openharmony_tarball extends: .openharmony_tarball
tags:
- cpu.heavy
script: script:
- tar xfz $TARBALL_FILE - tar xfz $TARBALL_FILE
- cd $(basename $TARBALL_FILE .tar.gz)/OpenHarmony - cd $(basename $TARBALL_FILE .tar.gz)/OpenHarmony
- ../../build/tmp-*/deploy/sdk/${PREBUILT_IMAGE}-${OPENHARMONY_VERSION}-*.sh -y -d oniro - ../../build/tmp-*/deploy/sdk/${PREBUILT_IMAGE}-${OPENHARMONY_VERSION}-cortexa7-neon-vfpv4-*.sh -y -d oniro
- ./oniro/setup.sh - ./oniro/setup.sh
- MAX_JOBS="${CI_ONIRO_PARALLEL_BUILD_MAX_JOBS:-$(nproc)}" - MAX_JOBS="${CI_ONIRO_PARALLEL_BUILD_MAX_JOBS:-$(nproc)}"
- NINJA_ARGS="--ninja-args -j$MAX_JOBS" - NINJA_ARGS="--ninja-args -j$MAX_JOBS"
......
...@@ -14,22 +14,24 @@ ...@@ -14,22 +14,24 @@
# limitations under the License. # limitations under the License.
variables: variables:
BITBAKE_CONTAINER_VERSION: "0.8" BITBAKE_CONTAINER_VERSION: "0.9"
OPENHARMONY_CONTAINER_VERSION: "0.1" OPENHARMONY_CONTAINER_VERSION: "0.1"
.kaniko: .kaniko:
stage: container stage: container
rules: rules:
- if: $CI_REGISTRY && $CI_REGISTRY_USER && $CI_REGISTRY_PASSWORD && $CI_REGISTRY_IMAGE - if: $CI_REGISTRY && $CI_REGISTRY_USER && $CI_REGISTRY_PASSWORD && $CI_REGISTRY_IMAGE
changes:
- .gitlab-ci/container.yml
- .gitlab-ci/container/$CONTAINER_PATH/**
image: image:
name: gcr.io/kaniko-project/executor:debug name: gcr.io/kaniko-project/executor:debug
entrypoint: [""] entrypoint: [""]
variables: variables:
CONTAINER_DOCKERFILE: Dockerfile CONTAINER_DOCKERFILE: Dockerfile
tags:
- cpu.light
script: script:
- if [ -z "$CONTAINER_PATH" ] ; then
CONTAINER_PATH="$CONTAINER_NAME" ;
fi
- CONTEXT="$CI_PROJECT_DIR/.gitlab-ci/container/$CONTAINER_PATH" - CONTEXT="$CI_PROJECT_DIR/.gitlab-ci/container/$CONTAINER_PATH"
- DOCKERFILE="$CONTEXT/$CONTAINER_DOCKERFILE" - DOCKERFILE="$CONTEXT/$CONTAINER_DOCKERFILE"
- if [ -n "$CONTAINER_FROM" ] ; then - if [ -n "$CONTAINER_FROM" ] ; then
...@@ -71,13 +73,12 @@ bitbake-builder: ...@@ -71,13 +73,12 @@ bitbake-builder:
variables: variables:
CONTAINER_NAME: bitbake-builder CONTAINER_NAME: bitbake-builder
CONTAINER_VERSION: $BITBAKE_CONTAINER_VERSION CONTAINER_VERSION: $BITBAKE_CONTAINER_VERSION
CONTAINER_PATH: bitbake-builder
bitbake-toolbox: bitbake-toolbox:
extends: .kaniko extends: bitbake-builder
variables: variables:
CONTAINER_NAME: bitbake-toolbox CONTAINER_NAME: bitbake-toolbox
CONTAINER_VERSION: $BITBAKE_CONTAINER_VERSION
CONTAINER_PATH: bitbake-builder
CONTAINER_DOCKERFILE: Dockerfile.toolbox CONTAINER_DOCKERFILE: Dockerfile.toolbox
CONTAINER_FROM: bitbake-builder CONTAINER_FROM: bitbake-builder
needs: needs:
...@@ -89,13 +90,12 @@ openharmony-builder: ...@@ -89,13 +90,12 @@ openharmony-builder:
variables: variables:
CONTAINER_NAME: openharmony-builder CONTAINER_NAME: openharmony-builder
CONTAINER_VERSION: $OPENHARMONY_CONTAINER_VERSION CONTAINER_VERSION: $OPENHARMONY_CONTAINER_VERSION
CONTAINER_PATH: openharmony-builder
openharmony-toolbox: openharmony-toolbox:
extends: .kaniko extends: openharmony-builder
variables: variables:
CONTAINER_NAME: openharmony-toolbox CONTAINER_NAME: openharmony-toolbox
CONTAINER_VERSION: $OPENHARMONY_CONTAINER_VERSION
CONTAINER_PATH: openharmony-builder
CONTAINER_DOCKERFILE: Dockerfile.toolbox CONTAINER_DOCKERFILE: Dockerfile.toolbox
CONTAINER_FROM: openharmony-builder CONTAINER_FROM: openharmony-builder
needs: needs:
......
...@@ -47,6 +47,9 @@ RUN echo "dash dash/sh boolean false" | debconf-set-selections \ ...@@ -47,6 +47,9 @@ RUN echo "dash dash/sh boolean false" | debconf-set-selections \
# suid to get it working # suid to get it working
RUN chmod u+s $(command -v ping) RUN chmod u+s $(command -v ping)
# Allow password-less sudo
RUN echo 'builder ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/toolbox
RUN useradd --create-home --uid 1000 --shell /usr/bin/bash builder RUN useradd --create-home --uid 1000 --shell /usr/bin/bash builder
COPY --chown=builder:builder .gitconfig /home/builder/.gitconfig COPY --chown=builder:builder .gitconfig /home/builder/.gitconfig
USER builder USER builder
......
...@@ -7,6 +7,6 @@ SPDX-License-Identifier: Apache-2.0 ...@@ -7,6 +7,6 @@ SPDX-License-Identifier: Apache-2.0
This container encapsulates build dependencies necessary to use repo and bitbake This container encapsulates build dependencies necessary to use repo and bitbake
for Open Harmony from for Open Harmony from
https://gitlab.eclipse.org/eclipse/oniro-core/meta-openharmony/ https://gitlab.eclipse.org/eclipse/oniro-oh/meta-openharmony/
The default user is called builder, making usage of bitbake easier. The default user is called builder, making usage of bitbake easier.
...@@ -100,7 +100,7 @@ RUN sed -i '$aexport PATH=/opt/harmonyos/llvm/bin:$PATH' /root/.bashrc \ ...@@ -100,7 +100,7 @@ RUN sed -i '$aexport PATH=/opt/harmonyos/llvm/bin:$PATH' /root/.bashrc \
&& export PATH=/opt/harmonyos/node-v12.20.0-linux-x64/bin:$PATH \ && export PATH=/opt/harmonyos/node-v12.20.0-linux-x64/bin:$PATH \
&& export PATH=/opt/harmonyos:$PATH \ && export PATH=/opt/harmonyos:$PATH \
&& export PATH=/root/.local/bin:$PATH \ && export PATH=/root/.local/bin:$PATH \
&& npm install -g @ohos/hpm-cli --registry https://mirrors.huaweicloud.com/repository/npm/ && npm install -g @ohos/hpm-cli
RUN useradd --create-home --uid 1000 --shell /usr/bin/bash builder RUN useradd --create-home --uid 1000 --shell /usr/bin/bash builder
COPY --chown=builder:builder .gitconfig /home/builder/.gitconfig COPY --chown=builder:builder .gitconfig /home/builder/.gitconfig
......
...@@ -120,7 +120,7 @@ By making a contribution to this project, I certify that: ...@@ -120,7 +120,7 @@ By making a contribution to this project, I certify that:
# `meta-openharmony`-specific contributions process and guidelines # `meta-openharmony`-specific contributions process and guidelines
The project handles contributions as merge request in the project's The project handles contributions as merge request in the project's
[GitLab instance](https://gitlab.eclipse.org/eclipse/oniro-core/meta-openharmony). [GitLab instance](https://gitlab.eclipse.org/eclipse/oniro-oh/meta-openharmony).
See above for more details. See above for more details.
Each contributions must adhere to the [OpenEmbedded Commit Patch Message Guidelines](http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines). Each contributions must adhere to the [OpenEmbedded Commit Patch Message Guidelines](http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines).
......
...@@ -88,7 +88,7 @@ meta-openharmony layer. ...@@ -88,7 +88,7 @@ meta-openharmony layer.
You can run these commands to do this: You can run these commands to do this:
mkdir ohoe && cd ohoe mkdir ohoe && cd ohoe
repo init -u https://gitlab.eclipse.org/eclipse/oniro-core/meta-openharmony.git -b kirkstone repo init -u https://gitlab.eclipse.org/eclipse/oniro-oh/meta-openharmony.git -b kirkstone
repo sync --no-clone-bundle repo sync --no-clone-bundle
After this is done, you need to initialize the build environment. This modifies After this is done, you need to initialize the build environment. This modifies
...@@ -116,6 +116,15 @@ quickly building and running OpenHarmony code in QEMU ARM simulator. ...@@ -116,6 +116,15 @@ 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. The ACTS test suite for testing for OpenHarmony compatibility can
be included in this image.
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
......
...@@ -15,6 +15,8 @@ BBLAYERS ?= " \ ...@@ -15,6 +15,8 @@ BBLAYERS ?= " \
##OEROOT##/../meta-clang \ ##OEROOT##/../meta-clang \
##OEROOT##/../meta-openembedded/meta-oe \ ##OEROOT##/../meta-openembedded/meta-oe \
##OEROOT##/../meta-openembedded/meta-python \ ##OEROOT##/../meta-openembedded/meta-python \
##OEROOT##/../meta-openembedded/meta-networking \
##OEROOT##/../meta-openharmony \ ##OEROOT##/../meta-openharmony \
##OEROOT##/../meta-java \ ##OEROOT##/../meta-java \
##OEROOT##/../meta-raspberrypi \
" "
...@@ -22,6 +22,9 @@ DISTROOVERRIDES:append = "${OPENHARMONY_OVERRIDES}" ...@@ -22,6 +22,9 @@ DISTROOVERRIDES:append = "${OPENHARMONY_OVERRIDES}"
PREFERRED_VERSION_openharmony-standard = "${OPENHARMONY_VERSION}" PREFERRED_VERSION_openharmony-standard = "${OPENHARMONY_VERSION}"
# Enable "df-acts" override
DISTRO_FEATURES_OVERRIDES += "acts"
# clang_rt.profile library is used in openharmony-standard build # clang_rt.profile library is used in openharmony-standard build
PACKAGECONFIG:pn-compiler-rt:append:df-openharmony = " profile" PACKAGECONFIG:pn-compiler-rt:append:df-openharmony = " profile"
......
...@@ -29,6 +29,7 @@ INIT_MANAGER = "systemd" ...@@ -29,6 +29,7 @@ INIT_MANAGER = "systemd"
# Linux kernel version # Linux kernel version
PREFERRED_VERSION_linux-yocto = "5.10.%" PREFERRED_VERSION_linux-yocto = "5.10.%"
PREFERRED_VERSION_linux-raspberrypi = "5.10.%"
# Attempt to isolate the buidl system from the host distribution's C library # Attempt to isolate the buidl system from the host distribution's C library
require conf/distro/include/yocto-uninative.inc require conf/distro/include/yocto-uninative.inc
...@@ -38,3 +39,19 @@ INHERIT += "uninative" ...@@ -38,3 +39,19 @@ INHERIT += "uninative"
# IMAGE_CLASSES, but doing a direct `inherit testimage` in image recipes # IMAGE_CLASSES, but doing a direct `inherit testimage` in image recipes
# instead. # instead.
HOSTTOOLS += "ip ping ps scp ssh stty" HOSTTOOLS += "ip ping ps scp ssh stty"
# Yocto does not have ssh-keygen-native, so we need to use ssh-keygen from host
HOSTTOOLS += "ssh-keygen"
# Default to enabling serial debug console on RaspberryPi
# Placed here to amend the machine config living in meta-raspberrypi
ENABLE_UART:raspberrypi4-64 ?= "1"
DISTRO_FEATURES += "wifi"
# Allow running the system without hdmi display connected
DISABLE_VC4GRAPHICS:raspberrypi4-64 = "1"
RPI_EXTRA_CONFIG:raspberrypi4-64 = ' \n \
dtoverlay=vc4-fkms-v3d \n \
'
HDMI_FORCE_HOTPLUG:raspberrypi4-64 = "1"
...@@ -39,6 +39,8 @@ MACHINE ??= "qemuarma7" ...@@ -39,6 +39,8 @@ MACHINE ??= "qemuarma7"
# Default policy config # Default policy config
# #
DISTRO ?= "oniro-openharmony-linux" DISTRO ?= "oniro-openharmony-linux"
# Comment this out if you don't want to build ACTS test suite
DISTRO_FEATURES:append = " acts"
# #
# Extra image configuration defaults # Extra image configuration defaults
...@@ -116,3 +118,7 @@ MIRRORS:prepend = "git://gitee.com/openharmony/ git://github.com/openharmony/ \n ...@@ -116,3 +118,7 @@ MIRRORS:prepend = "git://gitee.com/openharmony/ git://github.com/openharmony/ \n
#OPENHARMONY_VERSION = "3.1" #OPENHARMONY_VERSION = "3.1"
USER_CLASSES += "buildstats buildstats-summary" USER_CLASSES += "buildstats buildstats-summary"
# Uncomment if would like to use the Waveshare "C" 1024×600, 7 inch Capacitive
# Touch Screen LCD
# WAVESHARE_1024X600_C_2_1 = "1"
...@@ -4,13 +4,14 @@ SPDX-License-Identifier: Apache-2.0 ...@@ -4,13 +4,14 @@ SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: Huawei Inc. SPDX-FileCopyrightText: Huawei Inc.
--> -->
<manifest> <manifest>
<remote name="oniro-oh" fetch="https://gitlab.eclipse.org/eclipse/oniro-oh" />
<remote name="oniro-core" fetch="https://gitlab.eclipse.org/eclipse/oniro-core" /> <remote name="oniro-core" fetch="https://gitlab.eclipse.org/eclipse/oniro-core" />
<remote name="openembedded" fetch="https://git.openembedded.org" /> <remote name="openembedded" fetch="https://git.openembedded.org" />
<remote name="yocto" fetch="https://git.yoctoproject.org/git" /> <remote name="yocto" fetch="https://git.yoctoproject.org/git" />
<remote name="kraj" fetch="https://github.com/kraj" /> <remote name="kraj" fetch="https://github.com/kraj" />
<default revision="kirkstone" sync-j="4" /> <default revision="kirkstone" sync-j="4" />
<project name="meta-openharmony" remote="oniro-core" /> <project name="meta-openharmony" remote="oniro-oh" />
<project name="oniro" remote="oniro-core" /> <project name="oniro" remote="oniro-core" />
<project name="bitbake" remote="openembedded" revision="2.0" /> <project name="bitbake" remote="openembedded" revision="2.0" />
...@@ -18,5 +19,6 @@ SPDX-FileCopyrightText: Huawei Inc. ...@@ -18,5 +19,6 @@ SPDX-FileCopyrightText: Huawei Inc.
<project name="meta-openembedded" remote="openembedded" revision="master" /> <project name="meta-openembedded" remote="openembedded" revision="master" />
<project name="meta-clang" remote="kraj" /> <project name="meta-clang" remote="kraj" />
<project name="meta-java" remote="yocto" /> <project name="meta-java" remote="yocto" />
<project name="meta-raspberrypi" remote="yocto" />
</manifest> </manifest>
...@@ -13,5 +13,6 @@ SPDX-FileCopyrightText: Huawei Inc. ...@@ -13,5 +13,6 @@ SPDX-FileCopyrightText: Huawei Inc.
<extend-project name="meta-openembedded" revision="8f2dc1023482863e2630d1b94052c41ce748b38f" /> <extend-project name="meta-openembedded" revision="8f2dc1023482863e2630d1b94052c41ce748b38f" />
<extend-project name="meta-clang" revision="d669d873edf68dc7440bb07096737203bb7ec505" /> <extend-project name="meta-clang" revision="d669d873edf68dc7440bb07096737203bb7ec505" />
<extend-project name="meta-java" revision="1a8059f6b257ebe6fcae6416e499784d976afd24" /> <extend-project name="meta-java" revision="1a8059f6b257ebe6fcae6416e499784d976afd24" />
<extend-project name="meta-raspberrypi" revision="dacad9302a92b0b7edf8546cdcad1f8ef753e462" />
</manifest> </manifest>
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">OpenHarmony Device Connector on %h</name>
<service>
<type>_workstation._tcp</type>
<port>35000</port>
</service>
</service-group>
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: MIT
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = "file://hdc.service"
do_install:append () {
install -d ${D}${sysconfdir}/avahi/services/
install -m 0644 -g avahi ${WORKDIR}/hdc.service ${D}${sysconfdir}/avahi/services/hdc.service
}
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
BBCLASSEXTEND += "nativesdk"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Allow usb initialization to fail. This allows using hdc compiled with USB
support to work in environments without usbfs (e.g. in a non-privileged
container). It will of-course not allow access to USB devices, but no reason to
not allow connecting over network because of USB not being available.
Signed-off-by: Esben Haabendal <esben@geanix.com>
Upstream-Status: Pending
diff --git a/src/host/server.cpp b/src/host/server.cpp
index 26d51d0d1404..75f13c76b40c 100644
--- a/src/host/server.cpp
+++ b/src/host/server.cpp
@@ -86,15 +86,18 @@ bool HdcServer::Initial(const char *listenString)
clsServerForClient = new HdcServerForClient(true, listenString, this, &loopMain);
clsTCPClt = new HdcHostTCP(true, this);
clsUSBClt = new HdcHostUSB(true, this, ctxUSB);
- if (!clsServerForClient || !clsTCPClt || !clsUSBClt) {
- WRITE_LOG(LOG_FATAL, "Class init failed");
- return false;
+ if (!clsServerForClient || !clsTCPClt) {
+ WRITE_LOG(LOG_FATAL, "Class init failed");
+ return false;
}
(static_cast<HdcServerForClient *>(clsServerForClient))->Initial();
- if (clsUSBClt->Initial() != RET_SUCCESS) {
- return false;
+ if (clsUSBClt && clsUSBClt->Initial() != RET_SUCCESS) {
+ delete clsUSBClt;
+ clsUSBClt = nullptr;
+ }
+ if (!clsUSBClt) {
+ WRITE_LOG(LOG_WARN, "USB init failed");
}
-
#ifdef HDC_SUPPORT_UART
clsUARTClt = new HdcHostUART(*this);
if (!clsUARTClt) {
@@ -748,6 +751,10 @@ int HdcServer::CreateConnect(const string &connectKey)
#endif
else { // USB
connType = CONN_USB;
+ if (!clsUSBClt) {
+ WRITE_LOG(LOG_WARN, "USB not initialized");
+ return ERR_NO_SUPPORT;
+ }
}
HDaemonInfo hdi = nullptr;
if (connectKey == "any") {
...@@ -13,7 +13,12 @@ S = "${WORKDIR}/git" ...@@ -13,7 +13,12 @@ S = "${WORKDIR}/git"
SRC_URI += "git://gitee.com/openharmony/developtools_hdc_standard.git;protocol=https;branch=OpenHarmony-3.1-Release;rev=5304e6ff48d783362d577b8cf1fb1b34e3e451d4;lfs=0" SRC_URI += "git://gitee.com/openharmony/developtools_hdc_standard.git;protocol=https;branch=OpenHarmony-3.1-Release;rev=5304e6ff48d783362d577b8cf1fb1b34e3e451d4;lfs=0"
SRC_URI += "file://CMakeLists.txt;subdir=${S}" SRC_URI += "file://CMakeLists.txt;subdir=${S}"
SRC_URI += "file://libusb-include-path.patch" SRC_URI += "file://libusb-include-path.patch"
SRC_URI += "file://usb-init-soft-fail.patch"
DEPENDS += "libusb1 libuv openssl lz4 libboundscheck" DEPENDS += "libusb1 libuv openssl lz4 libboundscheck"
BBCLASSEXTEND = "native" do_install:append() {
ln -sfT hdc ${D}${bindir}/hdc_std
}
BBCLASSEXTEND = "native nativesdk"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Handle compare with Python 3.10 and newer.
Signed-off-by: Esben Haabendal <esben@geanix.com>
Upstream-Status: Pending
diff --git a/src/xdevice/_core/command/console.py b/src/xdevice/_core/command/console.py
index 9e448ba8d7e3..122da3c974fb 100644
--- a/src/xdevice/_core/command/console.py
+++ b/src/xdevice/_core/command/console.py
@@ -22,6 +22,7 @@ import platform
import signal
import sys
import threading
+from packaging import version
from _core.config.config_manager import UserConfigManager
from _core.constants import SchedulerType
@@ -84,7 +85,7 @@ class Console(object):
"""
Main xDevice console providing user with the interface to interact
"""
- if sys.version < '3.7':
+ if version.parse(sys.version.split(' ')[0]) < version.parse('3.7'):
LOG.error("Please use python 3.7 or higher version to "
"start project")
sys.exit(0)
diff --git a/src/xdevice/_core/report/__main__.py b/src/xdevice/_core/report/__main__.py
index 33d3a492029c..0a9124f8c2e1 100644
--- a/src/xdevice/_core/report/__main__.py
+++ b/src/xdevice/_core/report/__main__.py
@@ -19,6 +19,7 @@
import os
import sys
import time
+from packaging import version
from _core.logger import platform_logger
from _core.report.reporter_helper import ExecInfo
@@ -29,7 +30,7 @@ LOG = platform_logger("ReportMain")
def main_report():
- if sys.version < '3.7':
+ if version.parse(sys.version.split(' ')[0]) < version.parse('3.7'):
LOG.error("Please use python 3.7 or higher version to start "
"project")
return
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
DESCRIPTION = "XDevice, a core module of the OpenHarmony test framework, provides services on which test case execution depends."
SUMMARY = "Tool for remote test execution in OpenHarmony test framework"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://../LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
SRC_URI += "git://gitee.com/openharmony/test_xdevice.git;protocol=https;branch=OpenHarmony-3.0-LTS;rev=b0845abc4da7c5deef3335f7052ec9fa29ef4c34;lfs=0"
S = "${WORKDIR}/git/extension"
inherit setuptools3
RDEPENDS:${PN} += "python3-setuptools"
BBCLASSEXTEND = "native nativesdk"