How to create an sdk including chromium

Dear all,

i’m working with the following configuration:
Apalis iMX8QM 4GB WB IT V1.1D
Ixora Carrier Board V 1.2A
DISTRO_VERSION = “7.2.0”
DISTRO_CODENAME = “scathgap”

https://developer.toradex.com/linux-bsp/application-development/gui/how-to-use-web-browser-linux

Based on the above, I tried to create an SDK environment by including chromium in the board and checking its operation, and then ran the following command.

bitbake -c populate_sdk tdx-reference-multimedia-image

After creation, I ran depoly/*.sh to install the toolchain, but it seems that the chromium-related content is missing.

I need an SDK to create a custom chromium. Can you help me?

Best regards,
sjjin

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello!

To create an SDK with Chromium support on your Toradex hardware, please follow these steps:

  1. Ensure Required Layers are Available:

    Navigate to your layer directory and clone the necessary meta-browser layer:

    cd ${LAYERDIR}
    git clone -b master https://github.com/OSSystems/meta-browser.git
    
  2. Clone the meta-imx Repository and Create a New Layer:

    Clone the meta-imx repository and set up a new layer for Toradex Chromium:

    cd ${LAYERDIR}
    git clone -b scarthgap-6.6.36-2.1.0 https://github.com/nxp-imx/meta-imx/
    cd ../build
    bitbake-layers create-layer ../layers/meta-toradex-chromium
    bitbake-layers add-layer ../layers/meta-toradex-chromium
    
  3. Add Required Layers to bblayers.conf:

    Update your bblayers.conf to include the necessary layers:

    cd ${BUILD_DIR}
    echo 'BBLAYERS += " ${TOPDIR}/../layers/meta-browser/meta-chromium"' >> conf/bblayers.conf
    echo 'BBLAYERS += " ${TOPDIR}/../layers/meta-openembedded/meta-clang"' >> conf/bblayers.conf
    
  4. Modify local.conf for Chromium and SDK Requirements:

    Add the following to your local.conf to include Chromium and handle licensing:

    CORE_IMAGE_EXTRA_INSTALL += "chromium-ozone-wayland"
    LICENSE_FLAGS_ACCEPTED += "commercial_libav commercial_x264"
    
  5. Generate the SDK:

    Use the following command to generate the SDK:

    bitbake <image_name> -c populate_sdk
    

    The generated SDK will be located at oe-core/deploy/sdk/.

Note: For GPU-accelerated Chromium, use Chromium v117, as it is the last known version compatible with GPU acceleration on i.MX modules.

If you require Qt5 tools in your SDK, add this to your image recipe:

inherit populate_sdk populate_sdk_qt5

For more detailed information, you can refer to the Toradex Developer Center.

I hope this helps you set up your SDK successfully!

Best regards,
Toradex AI Assistant.

Please, also check if these links can help you solve your problem:

How to Use Web Browser (Linux) | Toradex Developer Center.

Thanks for the reply.

So the command to generate the SDK including chromium is as follows?

bitbake <image_name> -c populate_sdk

But why isn’t chromium included in the SDK?

Best regards,
sjjin

Hi @sjjin , it depends on how you are going to custom Chromium. If you already have the Chromium source code patch customing it, you can add it to the Chromium recipe. We usually don’t build Chromium from Linux SDK.

@benjamin.tx Thanks for the reply.

First, I’m trying to use tdx-reference-multimedia-image.
I added IMAGE_INSTALL += " chromium-ozone-wayland"

bitbake -c populate_sdk tdx-reference-multimedia-image

Am I setting something wrong?

Best regards,
sjjin

@benjamin.tx I have additional question.
How can I include libcef.so in SDK too?
Can you help me with this?

Best regards,
sjjin

Hi @sjjin , yes, what you did is correct. Besides, the patches from meta-imx are also required to enable GPU acceleration.

However, chromium will not be added to the SDK automatically. A recipe has to uses nativesdk e.g. inherit nativesdk, class to add itself to the SDK. But I don’t find it from layers/meta-browser/meta-chromium/recipes-browser/chromium. Chromium packages use the Clang compiler and rely on other dependencies and patches. It won’t be easy to build Chromium with the toolchain from SDK.

If you would like to custom Chromium from the source code, patches for the Yocto Project similar to the ones from meta-imx will be feasible.

For CEF, there is no existing Yocto layer. It can be cross compiled.
https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-linux-configuration

Hi @sjjin , could you tell us what kind of customization you will do on Chromium? Maybe we can find out a better solution.

@benjamin.tx
I am trying to develop a web browser that can be used on localhost. For example, a browser related to device control and monitoring.

Best regards,
sjjin

Hi @sjjin , the default guide is possible to add Chromium into the image and launch Chromium on Apalis iMX8 as the picture shows. Do you face any specific issue when controlling the device and monitoring?

@benjamin.tx Thank you for your answer.

I have confirmed the same functionality as above through chromium.

We want to use chromium by customizing it. We do not need the full browser function.
For example, we want to make a version that removes the address bar.

So we want to make it using libcef.so, but including the SDK is not easy…

Best regards,
sjjin

Hi @sjjin , to hide address bar, you could launch Chromium in fullscreen mode and set weston in kiosk mode.

chromium --no-sandbox --in-process-gpu --start-fullscreen

--- /etc/xdg/weston/weston.ini
+++ /etc/xdg/weston/weston.ini
@@ -4,11 +4,8 @@
 idle-time=0
 xwayland=true
 #enable-overlay-view=1
-shell=kiosk-shell.so
 
 [shell]
-panel-position=none
-panel-location=""
 
 [libinput]
 enable_tap=true

If your application heavily relies on browser, Torizon OS could provide a better experience.

For Chromium Embedded Framework, currently, there is no recipe to easily integrate it into Yocto Project. Hardware acceleration may also be missed if it is successfully cross-compiled.

@benjamin.tx thank you for your answer.

Kiosk, full screen mode is confirmed.

I checked that the keyboard and mouse are connected to the target board and controlled normally.

There was a problem with the VNC connection.
Keyboard and mouse control do not work when connected with VNC.
The following error occurs in chromium.

[2599:2599:0407/061328.977735:ERROR:cursor_loader.cc(116)] Failed to load a platform cursor of type kNull

Can you help me?

Best regards,
sjjin

Hi @sjjin , do you mean the keyboard and mouse connected to the target device don’t work on the remote VNC window opened on your PC?

@benjamin.tx Hi

There is no keyboard or mouse on the target device.

After connecting to VNC from the host PC, you cannot control the target device with the keyboard or mouse connected to the host.

Best regards,
sjjin

Hi @sjjin , is it still Linux BSP 7.2.0 when this issue occurs? Or is it TorizonOS, as you post in another ticket?

hi @benjamin.tx , The issue is with Linux BSP 7.2.0.

Hi @sjjin , I tested with RDP and found the same behaviors. It seems chromium has a bug to interpret additional input when using Wayland. There was a patch from this ticket. The same issue was also discussed on Chromium Community. However, I am not sure if this is still working on BSP 7.2.0. Is remote access(VNC/RDP) mandatory in your project? Or is it a way to make development easier?

hi, @benjamin.tx ,

Our project requires remote access (VNC/RDP) :sweat:

@sjjin What is the commit hash of the meta-browser layer you are using? I will try to rebase my patch onto the latest commit and test if it works.