Note
If you cannot afford to build the image on your own, try with pre-built images.
If you cannot afford to build the image on your own, try with pre-built images.
This page describes how to build a webOS Open Source Edition (OSE) image from source code.
Here is a quick summary for users already familiar with building webOS OSE. If you are new to webOS OSE, we recommend reading the whole document thoroughly.
# Download source codes
$ git clone https://github.com/webosose/build-webos.git
$ cd build-webos
$ git checkout <branch of the latest commit>
# Install and configure the build
$ sudo scripts/prerequisites.sh
$ ./mcf -p <num of CPUs> -b <num of CPUs> <device type>
# Start to build
$ source oe-init-build-env
$ bitbake webos-image
You can start the webOS OSE build by cloning the build-webos repository.
$ git clone https://github.com/webosose/build-webos.git
$ cd build-webos
Since webOS OSE 2.19.1, we introduced a new branch policy. This new policy allows the platform to implement important changes quickly. All you need to do is to checkout to the branch of the latest commit.
For example, if the latest commit of build-webos repository is in the 2.20
branch, check out to the 2.20
branch:
$ git checkout 2.20
But if the latest commit is in the master
branch, a branch of the latest version doesn’t exist, use the master
branch.
$ git checkout master
During the building process, BitBake might fail a sanity check. Although BitBake tells you what is missing, it doesn’t install the missing tools and libraries.
You can force to install all of the missing software by entering the following:
$ sudo scripts/prerequisites.sh
Using the mcf
command, you can set up the followings:
$ ./mcf -p <num of CPUs> -b <num of CPUs> <device type>
Property | Description |
---|---|
<num of CPUs> | This number determines how CPU cores to allocate for the building process. See Appendix. How to Find the Optimum Parallelism Values. |
<device type> | A type of the webOS OSE image. Available values are as follows:
|
webOS OSE provides two types of images:
webos-image
: A standard webOS OSE imagewebos-image-devel
: A webOS OSE image with various development tools such as GDB and strace (system call tracer)To kick off a full build of webOS OSE, enter the following:
$ source oe-init-build-env
$ bitbake webos-image
Alternatively, you can enter:
$ make webos-image
$ source oe-init-build-env
$ bitbake webos-image-devel
To check if the image has been built successfully, check the following directories:
BUILD/deploy/images/raspberrypi4/webos-image-raspberrypi4.rootfs.wic.bz2
.BUILD/deploy/images/raspberrypi4-64/webos-image-raspberrypi4-64.rootfs.wic.bz2
.BUILD/deploy/images/raspberrypi3/webos-image-raspberrypi3.rootfs.rpi-sdimg
.BUILD/deploy/images/raspberrypi3-64/webos-image-raspberrypi3-64.rootfs.rpi-sdimg
.BUILD/deploy/images/qemux86/webos-image-qemux86-master-*-wic.vmdk.gz
.BUILD/deploy/images/qemux86-64/webos-image-qemux86-64-master-*-wic.vmdk.gz
.If the built image exists, move on to the Next Steps.
To blow away the build artifacts and prepare to do the clean build, you can remove the build directory and recreate it by typing:
$ rm -rf BUILD
$ ./mcf.status
This retains the caches of the downloaded source (under build-webos/downloads
) and shared state (under build-webos/sstate-cache
). These caches will save you a tremendous amount of time during development as they facilitate incremental builds, but these also can cause seemingly inexplicable behavior when corrupted.
For more details, see Yocto Project Overview and Concepts Manual.
To build an individual component, enter:
$ source oe-init-build-env
$ bitbake <component-name>
Alternatively, you can enter:
$ make <component-name>
To clean a component’s build artifacts under BUILD
, enter:
$ source oe-init-build-env
$ bitbake -c clean <component-name>
To remove the shared state for a component as well as its build artifacts to ensure it gets rebuilt afresh from its source, enter:
$ source oe-init-build-env
$ bitbake -c cleansstate <component-name>
To set the make and BitBake parallelism values, use -p
and -b
options to the mcf
script. The -p
and -b
options correspond to PARALLEL_MAKE
and BB_NUMBER_THREADS
variables described in Yocto Project Development Tasks Manual.
The recommended value for -p
and -b
options is a half of the number of physical CPU cores. To get the number of physical CPU cores on your build system, use the following commands.
Get the number of physical CPUs.
$ cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
1
Get the number of cores per physical CPU.
$ cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores : 4
Multiply the above two values.
1 * 4 = 4 (The number of physical CPU cores)
With the above example, the recommended value for -p
and -b
options becomes 4 / 2 = 2.
This section describes the actual build time of webOS OSE using our build machine.
<num of CPUs>
for mcf
: 4Device Type | Image Type | Time |
---|---|---|
raspberrypi4-64 | webos-image | 8 hours 48 minutes |
raspberrypi4-64 | webos-image-devel | 8 hours 51 minutes |
Contents