diff --git a/meta-digi-containers/containers/chromium/artifact/metadata/README.txt b/meta-digi-containers/containers/chromium/artifact/metadata/README.txt new file mode 100644 index 000000000..f1249931f --- /dev/null +++ b/meta-digi-containers/containers/chromium/artifact/metadata/README.txt @@ -0,0 +1 @@ +Placeholder metadata for chromium container artifacts. diff --git a/meta-digi-containers/containers/chromium/artifact/metadata/changelog.txt b/meta-digi-containers/containers/chromium/artifact/metadata/changelog.txt new file mode 100644 index 000000000..a8a8e9675 --- /dev/null +++ b/meta-digi-containers/containers/chromium/artifact/metadata/changelog.txt @@ -0,0 +1 @@ +Placeholder changelog for webkit container artifacts. diff --git a/meta-digi-containers/containers/chromium/configs_lxc/config_lxc_ccimx95-dvk b/meta-digi-containers/containers/chromium/configs_lxc/config_lxc_ccimx95-dvk new file mode 100644 index 000000000..314d07f95 --- /dev/null +++ b/meta-digi-containers/containers/chromium/configs_lxc/config_lxc_ccimx95-dvk @@ -0,0 +1,57 @@ +# LXC config for Chromium on CCIMX95. +# Placeholders are replaced by the image recipe. +lxc.arch = @LXC_ARCH@ +lxc.rootfs.path = dir:@LXC_FOLDER@/@CONTAINER_NAME@/rootfs +lxc.uts.name = @CONTAINER_NAME@ + +lxc.mount.auto = cgroup:mixed proc:mixed +lxc.mount.entry = /sys sys none bind,create=dir +lxc.mount.entry = tmpfs run tmpfs rw,nosuid,nodev,mode=0755,create=dir + +# use host network +lxc.net.0.type = none + +lxc.init.cmd = @CONTAINER_INIT_MANAGER@ @CONTAINER_INIT_SCRIPT@ +lxc.console.logfile = @LXC_FOLDER@/@CONTAINER_NAME@/console.log +lxc.environment = 'PS1=chromium-ccimx95:\w$ ' +lxc.mount.entry = tmpfs dev/shm tmpfs rw,nosuid,nodev,mode=1777,create=dir +lxc.mount.entry = /etc/resolv.conf etc/resolv.conf none bind,ro,create=file + +# audio +lxc.mount.entry = /dev/snd dev/snd none bind,create=dir +lxc.mount.entry = /etc/asound.conf etc/asound.conf none bind,create=file +lxc.mount.entry = /run/pulse run/pulse none bind,create=dir +lxc.environment = PULSE_SERVER=unix:/run/pulse/native + +# bluetooth +lxc.mount.entry = /run/dbus/system_bus_socket run/dbus/system_bus_socket none bind,create=file + +# python logging +lxc.mount.entry = /dev/log dev/log none bind,create=file +lxc.mount.entry = /run/systemd/journal run/systemd/journal none bind,create=dir + +# fw_printenv +lxc.mount.entry = /etc/fw_env.config etc/fw_env.config none bind,create=file +lxc.mount.entry = /dev/mmcblk0boot0 dev/mmcblk0boot0 none bind,optional,create=file +lxc.mount.entry = /dev/mmcblk0boot1 dev/mmcblk0boot1 none bind,optional,create=file + +# gpu for ccimx95 +lxc.mount.entry = /dev/dri dev/dri none bind,create=dir +lxc.mount.entry = /dev/mali0 dev/mali0 none bind,create=file +lxc.mount.entry = /dev/dma_heap dev/dma_heap none bind,create=dir +lxc.mount.entry = /dev/fb0 dev/fb0 none bind,create=file +lxc.mount.entry = /dev/input dev/input none bind,create=dir + +# tty +lxc.mount.entry = /dev/tty dev/tty none bind,create=file +lxc.mount.entry = /dev/tty0 dev/tty0 none bind,create=file +lxc.mount.entry = /dev/tty1 dev/tty1 none bind,create=file +lxc.mount.entry = /dev/tty7 dev/tty7 none bind,create=file + +# udev + pty +lxc.mount.entry = /run/udev run/udev none bind,ro,create=dir +lxc.pty.max = 1024 +lxc.mount.entry = devpts dev/pts devpts rw,nosuid,noexec,relatime,mode=0620,ptmxmode=0666,newinstance 0 0 + +# gpiochip access for chromium demo +lxc.mount.entry = /dev/gpiochip5 dev/gpiochip5 none bind,create=file diff --git a/meta-digi-containers/containers/chromium/rootfs_files/start-chromium-demo.sh b/meta-digi-containers/containers/chromium/rootfs_files/start-chromium-demo.sh new file mode 100644 index 000000000..193a99597 --- /dev/null +++ b/meta-digi-containers/containers/chromium/rootfs_files/start-chromium-demo.sh @@ -0,0 +1,62 @@ +#!/bin/sh +export XDG_RUNTIME_DIR="/run/user/0" +export WAYLAND_DISPLAY="wayland-0" +export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/dbus/system_bus_socket" + +COMPATIBLE="$(tr '\0' ' ' /dev/null || true)" + +case "${COMPATIBLE}" in + *digi,ccmp15*|*digi,ccmp25*) + export WL_EGL_GBM_FENCE=0 + ;; +esac + +[ -f /etc/default/weston ] && . /etc/default/weston + +rm -rf "$XDG_RUNTIME_DIR" +mkdir -p "$XDG_RUNTIME_DIR" +chmod 0700 "$XDG_RUNTIME_DIR" +chown root:root "$XDG_RUNTIME_DIR" + +rm -rf /tmp/.X11-unix +mkdir -p /tmp/.X11-unix +chmod 1777 /tmp/.X11-unix + +mkdir -p /dev/shm +chmod 1777 /dev/shm + +rm -f /tmp/weston.log + +weston \ + --backend=drm-backend.so \ + --modules=systemd-notify.so \ + --socket="${WAYLAND_DISPLAY}" \ + --idle-time=0 \ + --log=/tmp/weston.log \ + ${OPTARGS} & + +while :; do + if [ -S "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}" ]; then + break + fi + sleep 0.1 +done +sleep 0.1 + +/etc/connectcore-demo-server start + +# wait for server to be ready +until nc -w 1 localhost 9090 /dev/null 2>&1; do + sleep 0.1 +done + +exec /usr/bin/chromium \ + --allow-file-access-from-files \ + --enable-features=UseOzonePlatform \ + --enable-wayland-ime \ + --in-process-gpu \ + --incognito \ + --kiosk \ + --no-sandbox \ + --ozone-platform=wayland \ + file:///srv/www/index.html diff --git a/meta-digi-containers/recipes-core/images/dey-image-container.bb b/meta-digi-containers/recipes-core/images/dey-image-container.bb index f46dae28d..1b83e59cd 100644 --- a/meta-digi-containers/recipes-core/images/dey-image-container.bb +++ b/meta-digi-containers/recipes-core/images/dey-image-container.bb @@ -142,6 +142,7 @@ IMAGE_INSTALL:append:container-lvgl = " \ weston \ weston-init \ " + DISTRO_FEATURES:remove:container-lvgl = " wayland" ######################## @@ -230,6 +231,74 @@ IMAGE_INSTALL:append:container-webkit:ccmp25 = " \ packagegroup-dey-x-linux-ai \ " +######################## +# Container type customizations chromium +######################## +CONTAINER_INIT_SCRIPT:container-chromium = "/start-chromium-demo.sh" +CONTAINER_CREATE_ARGS_PODMAN:container-chromium = " \ + --privileged \ + --network host \ + --tmpfs /dev/shm:rw,nosuid,nodev,mode=1777 \ + --volume /etc/resolv.conf:/etc/resolv.conf:ro \ + --device /dev/dri \ + --device /dev/input \ + --device /dev/mali0 \ + --device /dev/dma_heap \ + --device /dev/fb0 \ + --device /dev/snd \ + --device /dev/tty \ + --device /dev/tty0 \ + --device /dev/tty1 \ + --device /dev/tty7 \ + --device /dev/gpiochip5 \ + --device /dev/mmcblk0boot0 \ + --device /dev/mmcblk0boot1 \ + --device /dev/mailbox0 \ + --device /dev/video0 \ + --device /dev/video1 \ + --device /dev/video2 \ + --device /dev/video3 \ + --device /dev/video4 \ + --device /dev/media0 \ + --volume /run/udev:/run/udev:ro \ + --volume /etc/asound.conf:/etc/asound.conf:ro \ + --volume /run/pulse:/run/pulse \ + --volume /run/dbus/system_bus_socket:/run/dbus/system_bus_socket \ + --volume /dev/log:/dev/log \ + --volume /run/systemd/journal:/run/systemd/journal \ + --volume /etc/fw_env.config:/etc/fw_env.config:ro \ + --env PULSE_SERVER=unix:/run/pulse/native \ + --tty \ +" +IMAGE_INSTALL:append:container-chromium = " \ + adwaita-icon-theme-symbolic \ + alsa-utils \ + bluez5 \ + connectcore-demo-example \ + dbus \ + fontconfig-utils \ + hicolor-icon-theme \ + libdrm \ + liberation-fonts \ + libgpiod-tools \ + libinput \ + libubootenv-bin \ + networkmanager-nmcli \ + packagegroup-dey-gstreamer \ + packagegroup-core-weston \ + packagegroup-dey-chromium \ + pulseaudio-server \ + python3-dbus \ + qtvirtualkeyboard \ + ttf-dejavu-sans \ + ttf-dejavu-sans-mono \ + ttf-dejavu-serif \ + wayland \ + wayland-protocols \ + weston \ + weston-init \ +" + ######################## # Container type customizations flutter ########################