A computer that build an image from webOS OSE source code. In this guide, we will use a Linux machine for the build system.
Host Machine
A computer to flash the built image. The build system can be used as a host machine.
Target Device
A device that runs webOS OSE. In this guide, the target device is NVIDIA Jetson Nano.
Updating the Firmware
Before you start to bring up a Jetson Nano board, you need to update the firmware of the board to the latest version.
Download the official Jetson Nano Developer Kit SD Card Image.
Flash the image to a MicroSD card.
Insert the MicroSD card to your Jetson Nano board and connect the power supply. Then the board powers on and the firmware is automatically updated (Internet connection required).
For more information about getting started with Jetson Nano Developer Kit, check the official guide on the NVIDIA developer website.
Building the Image
Building a webOS OSE image for Jetson Nano is done in much the same way as building an image for Raspberry Pi. By modifying few steps to the existing guide, you can build the image for the Jetson Nano board.
Note webOS OSE’s build system is based on Yocto Project. For more details on the Yocto Project, visit the official website.
Cloning the Source Code
You can clone the webOS OSE’s source code with the following command:
Before you build webOS OSE, you need to install the required tools and libraries first. If you try to build without them, BitBake will fail a sanity check and tell you what’s missing, but not really how to get the missing pieces. On Ubuntu, you can force all of the missing pieces to be installed with the following command:
$ sudo scripts/prerequisites.sh
Note For more details about BitBake, refer to the BitBake Manual.
Adding the Target Device
To build an image for Jetson Nano, add jetson-nano-devkit to build-webos/weboslayer.py. This will be used in the Configuring the Build section.
build-webos/weboslayer.py
Distribution ="webos"# Supported MACHINE-s# Add 'jetson-nano-devkit' to the listMachines = ['qemux86', 'qemux86-64', 'qemuarm', 'raspberrypi3', 'raspberrypi3-64', 'raspberrypi4', 'raspberrypi4-64', 'jetson-nano-devkit']
# github.com/openembedded repositories are read-only mirrors of the authoritative# repositories on git.openembedded.org
Note jetson-nano-devkit is one of the example target devices. For more information about supported NVIDIA boards, see Appendix.
Adding the meta-tegra Repository
meta-tegra is a BSP (Board Support Packages) layer for the NVIDIA Jetson platforms. The BSP layer provides board specific information such as machine configuration files and recipes. If you want to learn more about BSP layer and Yocto project, see the official document.
To add the repository, add the following codes to build-webos/weboslayer.py:
We highly recommend to use the value less than half of the number of physical CPU cores. If you specify a number higher than that, it might cause unexpected errors during the build. For more information about how to set the option values, see Appendix A. Setting Values for mcf.
The mcf command creates a file to initialize the build environment.
Note If you want to use another NVIDIA Jetson board, you need to replace the target device name (jetson-nano-devkit) with that of other NVIDIA machines. See Appendix for supported NVIDIA machines and their target device name.
Setting Up Configurations
Before you build the source code, you need to modify Yocto configuration files.
First initialize the build environment:
$ source oe-init-build-env
layer.conf
Copy and paste the following codes at the end of build-webos/meta-webosose/meta-webos/conf/layer.conf:
# Add meta-tegra layer information.# IMAGE_CLASSES and IMAGE_FSTYPES is used to flash the target device.IMAGE_CLASSES+="image_types_tegra"IMAGE_FSTYPES="tegraflash tar.gz.bz2"IMAGE_TYPES+="tegraflash"# The default value for IMAGE_NAME_SUFFIX occurs an error when you build webOS OSE with u-boot.# To avoid this error, set IMAGE_NAME_SUFFIX as blank.IMAGE_NAME_SUFFIX=""# Disable SOTA (Software-Over-the-Air) features.# SOTA features are not supported in NVIDIA devices.INHERIT_remove="sota"DISTRO_FEATURES_remove="sota usrmerge"DISTRO_FEATURES_NATIVE_remove="sota"# Set rootfs for Jetson Nano.# mmcblk0p1 is root in Jetson Nano development module for MicroSD card.KERNEL_ROOTSPEC="root=/dev/mmcblk0p1 rw rootwait"# Fix bash runtime dependency with respect to WEBOS_PREFERRED_PROVIDER_FOR_BASHVIRTUAL-RUNTIME_bash ?="bash"RDEPENDS_tegra-nvs-base_append_class-target =" ${VIRTUAL-RUNTIME_bash}"RDEPENDS_tegra-nvs-base_remove_class-target ="${@oe.utils.conditional('WEBOS_PREFERRED_PROVIDER_FOR_BASH', 'busybox', 'bash', '', d)}"RDEPENDS_tegra-nvphs-base_append_class-target =" ${VIRTUAL-RUNTIME_bash}"RDEPENDS_tegra-nvphs-base_remove_class-target ="${@oe.utils.conditional('WEBOS_PREFERRED_PROVIDER_FOR_BASH', 'busybox', 'bash', '', d)}"RDEPENDS_tegra-configs-nvstartup_append_class-target =" ${VIRTUAL-RUNTIME_bash}"RDEPENDS_tegra-configs-nvstartup_remove_class-target ="${@oe.utils.conditional('WEBOS_PREFERRED_PROVIDER_FOR_BASH', 'busybox', 'bash', '', d)}"# Disable com.webos.app.volume, com.webos.app.notification, and g-media-pipeline# These applications are not guaranteed to work properly on NVIDIA devices.VIRTUAL-RUNTIME_com.webos.app.notification =""VIRTUAL-RUNTIME_com.webos.app.volume =""VIRTUAL-RUNTIME_g-media-pipeline =""
meta-tegra
In build-webos/meta-tegra/recipes-bsp/u-boot/u-boot-tegra_2020.04.bb, add and remove commands as follows:
sd<xN> denotes the device name of the MicroSD card, where x is a character and N is a number suffix.
For dd command, you must pass sd<x> (x is the same as the x in the above) to the of operand. sd<X> indicates the mass storage device, not the partition.
If the flashing succeeds, remove the MicroSD card from the PC and insert the card into your target device.
Configuring Extra Setup
At this moment, if you turn on the target device, none of the peripheral devices (touch display, keyboard, and mouse) are work. To use the peripheral devices and other useful features, you need to set up extra configurations.
Once you set up a serial connection successfully, connect to the target device and modify the files specified in the subsequent sections.
Enabling Graphic Interfaces
Modify /etc/surface-manager.d/product.env as follows:
/etc/surface-manager.d/product.env
# Platform plugin to be usedexportWEBOS_COMPOSITOR_PLATFORM="eglfs_webos"- exportQT_QPA_EGLFS_INTEGRATION="eglfs_kms_webos"+ exportQT_QPA_EGLFS_INTEGRATION="eglfs_kms_egldevice"# Disable to set the WEBOS_COMPOSITOR_DISPLAY_CONFIG value. Get the value from configd. - WEBOS_COMPOSITOR_DISPLAY_CONFIG=$(luna-send -n 1 -a com.webos.surfacemanager luna://com.webos.service.config/getConfigs '{"configNames":["com.webos.surfacemanager.displayConfig"]}' | grep -oE "\[\{.*\}\]
+ #WEBOS_COMPOSITOR_DISPLAY_CONFIG=$(luna-send -n 1 -a com.webos.surfacemanager luna://com.webos.service.config/getConfigs '{"configNames":["com.webos.surfacemanager.displayConfig"]}' | grep -oE "\[\{.*\}\]
Replace the value of QT_QPA_EGLFS_INTEGRATION into eglfs_kms_egldevice.
Delete the line for WEBOS_COMPOSITOR_DISPLAY_CONFIG. This change makes WEBOS_COMPOSITOR_DISPLAY_CONFIG get its value from configd.
Note In the above code, - means deleting the line and + means adding the line.
After modifying the /etc/surface-manager.d/product.env file, you have to reboot Home Launcher and the target device.