|
|
# Notes about OpenHarmony and meta-openharmony
|
|
|
|
|
|
|
|
|
|
## General
|
|
## How to Install hdc tool on the host
|
|
|
|
From the ohoe environment, bitbake hdc-native. Then copy bins and
|
|
|
|
libs from `${OHOE_DIR}/build/tmp-musl/sysroots-components/x86_64/hdc-native/` to your libs
|
|
|
|
and bins directories on your host (e.g. `/usr/local/bin` and `/usr/local/lib`)
|
|
|
|
|
|
|
|
|
|
## Building ACTS
|
|
|
## ACTS
|
|
|
|
|
|
|
|
|
|
### Building ACTS
|
|
|
|
|
|
|
|
|
|
To build ACTS test suites add following to the `local.conf`:
|
|
To build ACTS test suites add following to the `local.conf`:
|
|
|
|
|
|
| ... | @@ -16,10 +15,10 @@ DISTRO_FEATURES += "acts" |
... | @@ -16,10 +15,10 @@ DISTRO_FEATURES += "acts" |
|
|
ACTS test suites can be found in output directory, eg.
|
|
ACTS test suites can be found in output directory, eg.
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
build-openharmony-components-qemuarma7/tmp-musl/work/cortexa7-neon-vfpv4-oe-linux-musleabi/openharmony-standard/3.0-r0/src/out/ohos-arm-release/suites/acts/testcases
|
|
${OHOE_DIR}/build/tmp-musl/work/cortexa7-neon-vfpv4-oe-linux-musleabi/openharmony-standard/3.0-r0/src/out/ohos-arm-release/suites/acts/testcases
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### Running ACTS
|
|
## Running ACTS
|
|
|
|
|
|
|
|
To be able to run ACTS against on the target you need to start the target:
|
|
To be able to run ACTS against on the target you need to start the target:
|
|
|
```
|
|
```
|
| ... | @@ -35,7 +34,34 @@ Connect OK |
... | @@ -35,7 +34,34 @@ Connect OK |
|
|
|
|
|
|
|
From this point on you can use `hdc` tool to execute commands on the target, install hap packages, transfer files, etc.
|
|
From this point on you can use `hdc` tool to execute commands on the target, install hap packages, transfer files, etc.
|
|
|
|
|
|
|
|
Up to now `xdevice`, tool that is provided as part of ACTS suite, used on Linux was unable to connect to the target device and therefore any testing with it was impossible. To workaround that problem set of simple [ACTS scripts](https://gitlab.eclipse.org/robertd/acts-runner) can be used in a following manner:
|
|
### Option 1: using XDevice
|
|
|
|
XDevice is a module of the OpenHarmony test framework. It provides a tool to
|
|
|
|
connect to the device target from your host, and run ACTS test suites.
|
|
|
|
|
|
|
|
XDevice can be installed on the host as follows:
|
|
|
|
```console
|
|
|
|
$ cd ${OHOE_DIR}/build/tmp-musl/work/cortexa7-neon-vfpv4-oe-linux-musleabi/openharmony-standard/3.0-r0/src/test/xdevice
|
|
|
|
$ sudo python3 setup.py install
|
|
|
|
```
|
|
|
|
|
|
|
|
XDevice requires the `hdc_std` tool on the host. If `hdc` is already available,
|
|
|
|
a symlink can be created for `hdc_std`.
|
|
|
|
```console
|
|
|
|
$ sudo ln -s /usr/local/hdc /usr/local/hdc_std
|
|
|
|
```
|
|
|
|
|
|
|
|
Now with XDevice installed you can use it to run an ACTC test suite.
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ hdc list targets # Make sure `hdc` is connected to the target.
|
|
|
|
192.168.7.2:35000
|
|
|
|
$ cd ${OHOE_DIR}/build/tmp-musl/work/cortexa7-neon-vfpv4-oe-linux-musleabi/openharmony-standard/3.0-r0/src/out/ohos-arm-release/suites/acts
|
|
|
|
$ xdevice run acts -l ActsBmsJsTest # replace `ActsBmsJsTest` with the module to test
|
|
|
|
```
|
|
|
|
|
|
|
|
### Option 2: using ACTS bash scripts
|
|
|
|
|
|
|
|
A set of simple [ACTS scripts](https://gitlab.eclipse.org/robertd/acts-runner) can be used in a following manner:
|
|
|
|
|
|
|
|
- clone `acts-runner` repository
|
|
- clone `acts-runner` repository
|
|
|
- navigate to ACTS test suite `suites/acts/testcases` directory
|
|
- navigate to ACTS test suite `suites/acts/testcases` directory
|
| ... | @@ -59,6 +85,47 @@ total cases:7;failure 0,error 0,pass 7; consuming 4.27S |
... | @@ -59,6 +85,47 @@ total cases:7;failure 0,error 0,pass 7; consuming 4.27S |
|
|
================
|
|
================
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
## Graphical demo
|
|
|
|
You can connect to the graphical output of oniro-oh using vnc. Make sure to use
|
|
|
|
the `publicvnc` flag when running the image. You will be able to connect to it
|
|
|
|
using a vnc client such as Remmina using the address `127.0.0.1:5900`.
|
|
|
|
|
|
|
|
### Running some demo HAP applications
|
|
|
|
Some demo HAP applications are generated in the same directory you can find the
|
|
|
|
Launcher and SystemUI haps: `build/tmp-musl/work/cortexa7-neon-vfpv4-oe-linux-musleabi/openharmony-standard/3.0-r0/src/applications/standard/hap`.
|
|
|
|
|
|
|
|
After installing a demo and starting the corresponding ability, you will see
|
|
|
|
the running application shown on your VNC client.
|
|
|
|
```console
|
|
|
|
$ hdc install Clock_Demo.hap
|
|
|
|
[Info]App install path:/home/francesco/ohoe/build/workspace/sources/openharmony-standard/applications/standard/hap/Clock_Demo.hap, queuesize:0, msg:install bundle successfully.
|
|
|
|
AppMod finish
|
|
|
|
$ hdc shell aa start -a ohos.samples.clock.MainAbility -b ohos.samples.clock
|
|
|
|
start ability successfully.
|
|
|
|
$ hdc shell bm uninstall -n ohos.samples.clock
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ hdc install Calc_Demo.hap
|
|
|
|
[Info]App install path:/home/francesco/ohoe/build/workspace/sources/openharmony-standard/applications/standard/hap/Calc_Demo.hap, queuesize:0, msg:install bundle successfully.
|
|
|
|
AppMod finish
|
|
|
|
$ hdc shell aa start -a com.example.distributedcalc.MainAbility -b com.example.distributedcalc
|
|
|
|
start ability successfully.
|
|
|
|
$ hdc shell bm uninstall -n com.example.distributedcalc
|
|
|
|
uninstall bundle successfully.
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ hdc install Ecg_Demo.hap
|
|
|
|
[Info]App install path:/home/francesco/ohoe/build/workspace/sources/openharmony-standard/applications/standard/hap/Ecg_Demo.hap, queuesize:0, msg:install bundle successfully.
|
|
|
|
AppMod finish
|
|
|
|
$ hdc shell aa start -a ohos.samples.ecg.MainAbility -b ohos.samples.ecg
|
|
|
|
start ability successfully.
|
|
|
|
$ hdc shell bm uninstall -n ohos.samples.ecg
|
|
|
|
```
|
|
|
|
|
|
|
## TODOs
|
|
## TODOs
|
|
|
|
|
|
|
|
### Handling of users and directories permissions/ownership
|
|
### Handling of users and directories permissions/ownership
|
| ... | @@ -72,13 +139,38 @@ Note: In meta-openharmony we don't use OpenHarmony init system. It is responsibl |
... | @@ -72,13 +139,38 @@ Note: In meta-openharmony we don't use OpenHarmony init system. It is responsibl |
|
|
|
|
|
|
|
### Handling services startup
|
|
### Handling services startup
|
|
|
|
|
|
|
|
Note: In meta-openharmony we settled for systemd units for managing the services. As it turned out the ordering of the services and even time between subsequent services is important. Currently we have a workaround for that which is services are started from a single script checking if the corresponding service systemd dummy unit is enabled.
|
|
Note: In meta-openharmony we settled for systemd units for managing the services. As it turned out the ordering of the services and even time between subsequent services is important.
|
|
|
|
|
|
|
|
Currently we have a workaround for that which is services are started from a single script
|
|
|
|
called `openharmony-preinit` checking if the corresponding service systemd dummy unit is enabled.
|
|
|
|
|
|
|
|
- Fix services startup
|
|
- Fix services startup
|
|
|
|
|
|
|
|
### Installation of the Launcher and SystemUI haps
|
|
### Installation of the Launcher and SystemUI haps
|
|
|
|
|
|
|
|
Note: As a rule, in meta-openharmony we didn't want to include any pre-built stuff. That had to be compromised on couple of occasions. For the ACTS tests to work repeatedly Launcher haps and SystemUI haps, which are not included in the openharmony-standard recipe. Those can be found either in the OpenHarmony code-v3.0.1-LTS release package or on [gitee](https://gitee.com/openharmony/applications_hap).
|
|
Note: As a rule, in meta-openharmony we didn't want to include any pre-built stuff. That had to be compromised on couple of occasions. For the ACTS tests to work repeatedly Launcher haps and SystemUI haps, which are not included in the openharmony-standard recipe. Those can be found either in the OpenHarmony code-v3.0.1-LTS release package, on [gitee](https://gitee.com/openharmony/applications_hap), and also generated after a build in the
|
|
|
|
|
directory:
|
|
|
|
```
|
|
|
|
build/tmp-musl/work/cortexa7-neon-vfpv4-oe-linux-musleabi/openharmony-standard/3.0-r0/src/applications/standard/hap
|
|
|
|
```
|
|
|
- Make the Launcher and SystemUI hap packages built in openharmony-standard from sources and included in the image
|
|
- Make the Launcher and SystemUI hap packages built in openharmony-standard from sources and included in the image
|
|
|
|
|
|
|
|
|
## Tips and tricks
|
|
|
|
|
|
|
|
### How to make devtool work
|
|
|
|
- checkout the `wip/devtool` branch
|
|
|
|
- `devtool modify openharmony-standard`
|
|
|
|
- copy `recipe-sysroot-native` directory into `build/workspace/sources`
|
|
|
|
- Add the following line to /home/francesco/ohoe/build/workspace/appends/openharmony-standard_3.0.bbappend:
|
|
|
|
```
|
|
|
|
EXTERNALSRC_BUILD:pn-openharmony-standard = "build/workspace/sources/openharmony-standard/out/ohos-arm-release"
|
|
|
|
```
|
|
|
|
- `bitbake openharmony-standard-image`
|
|
|
|
- cherry_pick_sources is resetting some patched files in ${S}/device/hihope/hardware/, discard changes from the workspace:
|
|
|
|
```
|
|
|
|
git checkout HEAD -- device/hihope/hardware/display/BUILD.gn
|
|
|
|
git checkout HEAD -- device/hihope/hardware/display/src/display_gralloc/display_gralloc_gbm.c
|
|
|
|
```
|
|
|
|
Now you can modify the sources in `build/workspace/sources/openharmony-standard`.
|
|
|
|
When you build `bitbake openharmony-standard-image` it will recompile using the
|
|
|
|
modified sources from the workspace. |