Chromium on TX8M

You are able to integrate Chromium into your image to get a graphics-accelerated browser on your StarterKit.

Set up your build-directory with these settings:

DISTRO=fsl-imx-xwayland MACHINE=tx8m-xxxx source karo-nxp-release.sh -b <build-dir>

Inside your build directory add this to conf/local.conf:

CORE_IMAGE_EXTRA_INSTALL += "chromium-ozone-wayland"

Build the QT image:

bitbake fsl-image-qt5

Note

Before starting a build, you should consider enabling the SSTATE CACHE to speedup the build process.

See Enable sstate cache 1.

When your build has finished, flash your module with the image. See UUU - Universal Update Utility.

Running Chromium

When booting your previously flashed module, the Weston desktop should come up.

Plug a USB-hub into your StarterKit’s USB host port and insert keyboard, mouse and/or touchscreen. Open the terminal (icon in top-left corner), or connect via the Terminal from your host computer. The desktop comes up as user root, so you have to start Chromium with an extra argument.

Run:

chromium --no-sandbox

Hint

On every first start of Chromium it will tell you, that there’s not enough entropy initialized to start Chromium. Move your mouse or hit some keys on your keyboard until the browser comes up. See the sections below how to prevent this.

Autostarting Chromium

Entropy problem

As mentioned above, it takes some time til your board has enough entropy collected from user-input or other actions that generate randomness. To tell your system, that there is enough entropy, add the following to your Kernel-Commandline in U-Boot:

rng_core.default_quality=1000

Creating Service

Create a start script for Chromium and modify the Weston service. Modify/create the three files below:

  1. Create /etc/default/weston:

#!/bin/sh
OPTARGS="--xwayland --use-g2d=1"
XDG_RUNTIME_DIR="/run/user/0"
  1. Create /home/root/startchromium.sh

#!/bin/sh
/usr/bin/chromium --incognito --app --disable-infobar --disable-session-crashed-bubble --no-sandbox --noerrdialogs --kiosk --no-errors https://www.karo-electronics.com &
  1. Modify /lib/systemd/system/weston.service:

[Unit]
Description=Weston Wayland Compositor (on tty7)
RequiresMountsFor=/run
Conflicts=getty@tty7.service plymouth-quit.service
After=systemd-user-sessions.service getty@tty7.service plymouth-quit-wait.service

[Service]
User=root
PermissionsStartOnly=true

# Log us in via PAM so we get our XDG & co. environment and
# are treated as logged in so we can use the tty:
PAMName=login

# Grab tty7
UtmpIdentifier=tty7
TTYPath=/dev/tty7
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no

# stderr to journal so our logging doesn't get thrown into /dev/null
StandardOutput=tty
StandardInput=tty
StandardError=journal

EnvironmentFile=-/etc/default/weston

# Weston does not successfully change VT, nor does systemd place us on
# the VT it just activated for us. Switch manually:
ExecStartPre=/usr/bin/chvt 7
ExecStart=/usr/bin/weston-launch -- --log=/var/log/weston.log $OPTARGS
ExecStartPost=-/home/root/startchromium.sh

IgnoreSIGPIPE=no

[Install]
WantedBy=multi-user.target

Tip

Reboot your system and see Chromium coming up.