Newer
Older
**meta-ohos** is a set of bitbake layers for building OpenHarmony images
using the bitbake infrastructure.
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
[[_TOC_]]
# Getting started
## Prerequisites
To start working with **meta-ohos** first install git repo:
$ sudo add-apt-repository ppa:zyga/oh-tools
$ sudo apt-get update
$ sudo apt-get install git-repo
## Building OpenHarmony image
Once git repo has been installed we can use it to clone the necessary repositories:
$ mkdir ohos; cd ohos
$ repo init -u https://git.ostc-eu.org/incubate/meta-ohos/manifest.git
$ repo sync
$ cd poky
poky$ . oe-init-build-env
Working directory will automatically change to ./poky/build. Add layers for
other kernels. Layers for poky were added automatically by sourcing
`oe-init-build-env`.
build$ bitbake-layers add-layer ../meta-openembedded/meta-oe
build$ bitbake-layers add-layer ../meta-openembedded/meta-python
build$ bitbake-layers add-layer ../meta-zephyr
build$ bitbake-layers add-layer ../meta-freertos
Build distro of your choice:
For Poky-tiny you can choose any of the following machines:
qemux86, qemux86-64, qemuarm, qemuarmv5
build$ DISTRO=poky-tiny MACHINE=qemux86 bitbake core-image-minimal
For Zephyr you can choose any of the following machines:
acrn, arduino-101-ble, arduino-101, arduino-101-sss, qemu-cortex-m3, qemu-nios2, qemu-x86
build$ DISTRO=zephyr MACHINE=qemu-x86 bitbake zephyr-philosophers
For FreeRTOS you can choose any of the following machines: qemuarmv5.
build$ DISTRO=freertos MACHINE=qemuarmv5 bitbake freertos-demo
For Zephyr, `zephyr-philosophers` is the one of sample applications available
in meta-zephyr layer by Yocto project. It's easy to build other samples using
recipes available in `meta-zephyr/recipes-kernel/zephyr-kernel/` directory.
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
## Running OpenHarmony image
When the build is finished, you can run the image by issuing:
# For poky
build$ runqemu qemux86 ramfs qemuparams="-nographic"
# For Zephyr
build$ DEPLOY_DIR_IMAGE=tmp-newlib/deploy/images/qemu-x86 runqemu qemu-x86
# For FreeRTOS
build$ runqemu qemuarmv5
After successful bootup, you should see following:
# For Zephyr
Booting from ROM..*** Booting Zephyr OS build zephyr-v2.4.0 ***
Philosopher 0 [P: 3] THINKING [ 300 ms ]
Philosopher 1 [P: 2] EATING [ 575 ms ]
Philosopher 2 [P: 1] STARVING
Philosopher 3 [P: 0] EATING [ 525 ms ]
Philosopher 4 [C: -1] THINKING [ 475 ms ]
# For poky
qemux86 login:
# Default login is _root_ without a password.
# After login you should see prompt:
root@qemux86:~#
# For FreeRTOS
###### - FreeRTOS sample application -######
A text may be entered using a keyboard.
It will be displayed when 'Enter' is pressed.
Periodic task 10 secs
Waiting For Notification - Blocked...
Task1
Task1
You entered: "HelloFreeRTOS"
Unblocked
Notification Received
Waiting For Notification - Blocked...
To exit qemu, you can either shut down the system:
root@qemux86:~# poweroff -f
or close qemu using key combination:
Ctrl-a followed by 'x'
# meta-ohos architecture
All decisions for architecturally significant requirements are documented using
[adr-tools](https://github.com/npryce/adr-tools) and stored in [adr](./adr) subdirectory.
Decisions are discussed within MR of a given decision md file.
**meta-ohos** architecture is documented using [c4 model](https://c4model.com/).
## meta-ohos overview
**OpenHarmony** is a distributed OS that is designed to run atop variety of OS kernels
ranging from RTOSs to Linux.
**meta-ohos** is a _umbrella_ meta layer containing all layers required to build
**OpenHarmony** Image basing on existing kernel meta-layers.
```plantuml
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Context.puml
Person(dev, "Developer", "Anyone willing to build the OHOS based image")
System(meta_ohos, "meta-ohos", "Open Harmony OS umbrella bitbake meta-layer")
System_Ext(yocto, "yocto-poky", "distro scaffolding: predefined meta-data, bitbake build system")
System_Ext(meta_zephyr, "meta-zephyr", "ZephyrOS meta-layer")
System_Ext(meta_freertos, "meta-freertos", "FreeRTOS meta-layer")
Rel(dev, yocto, "selects configuration, initiates the build, deploys image to the target")
Rel(yocto, meta_ohos, "incorporates meta-layers relevant for selected kernel / configuration")
Rel(yocto, yocto, "Using meta-poky for OHOS on Poky build")
Rel(yocto, meta_zephyr, "incorporates for OHOS on Zephyr build")
Rel(yocto, meta_freertos, "incorporates for OHOS on FreeRTOS build")
```