From 621e0fd6a0ecccfa4027f6ef8c2b3bbdf688af0b Mon Sep 17 00:00:00 2001 From: Andy Doan Date: Thu, 3 Oct 2024 17:19:43 +0000 Subject: [PATCH 1/3] base: docker: Enable CDI feature The Container Device Interface(CDI) is a specification supported by tools like Docker and Podman to more easily access hardware. Given the hardware-specific nature of our platform, this feature is generically useful to our users and should be enabled. Signed-off-by: Andy Doan --- meta-lmp-base/recipes-containers/docker/files/daemon.json.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-lmp-base/recipes-containers/docker/files/daemon.json.in b/meta-lmp-base/recipes-containers/docker/files/daemon.json.in index 2fe0196653..b15c1941a8 100644 --- a/meta-lmp-base/recipes-containers/docker/files/daemon.json.in +++ b/meta-lmp-base/recipes-containers/docker/files/daemon.json.in @@ -3,6 +3,9 @@ "log-opts": { "tag": "{{.Name}}" }, + "features": { + "cdi": true + }, @@DOCKER_DAEMON_JSON_CUSTOM@@ "max-concurrent-downloads": @@MAX_CONCURRENT_DOWNLOADS@@, "max-download-attempts": @@MAX_DOWNLOAD_ATTEMPTS@@ From 83264e099a5116686072691eb0b3f2dd771f7047 Mon Sep 17 00:00:00 2001 From: Andy Doan Date: Thu, 3 Oct 2024 17:07:49 +0000 Subject: [PATCH 2/3] base: Introduce wayland-cdi service This change introduces logic to generate a CDI definition for the Weston display created at boot. With CDI enabled in a container runtime like Docker, you could run Wayland apps with a command like: running: ``` docker run --rm -it --device=org.wayland/display=wayland-1 ubuntu ``` Signed-off-by: Andy Doan --- .../wayland-cdi/files/wayland-cdi-generate | 47 +++++++++++++++++++ .../wayland-cdi/files/wayland-cdi.service | 13 +++++ .../wayland-cdi/wayland-cdi_0.1.bb | 24 ++++++++++ 3 files changed, 84 insertions(+) create mode 100755 meta-lmp-base/recipes-containers/wayland-cdi/files/wayland-cdi-generate create mode 100644 meta-lmp-base/recipes-containers/wayland-cdi/files/wayland-cdi.service create mode 100644 meta-lmp-base/recipes-containers/wayland-cdi/wayland-cdi_0.1.bb diff --git a/meta-lmp-base/recipes-containers/wayland-cdi/files/wayland-cdi-generate b/meta-lmp-base/recipes-containers/wayland-cdi/files/wayland-cdi-generate new file mode 100755 index 0000000000..830c2602c6 --- /dev/null +++ b/meta-lmp-base/recipes-containers/wayland-cdi/files/wayland-cdi-generate @@ -0,0 +1,47 @@ +#!/bin/sh + +cditmp="/run/cdi/.wayland.yaml.tmp" + +mkdir -p /run/cdi +cat >${cditmp} <>${cditmp} <>${cditmp} <>${cditmp} < Date: Thu, 3 Oct 2024 18:15:49 +0000 Subject: [PATCH 3/3] base: distro: Include wayland-cdi recipe in Wayland images Signed-off-by: Andy Doan --- meta-lmp-base/recipes-samples/images/lmp-feature-docker.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-lmp-base/recipes-samples/images/lmp-feature-docker.inc b/meta-lmp-base/recipes-samples/images/lmp-feature-docker.inc index 817c8738fc..db23bc9c95 100644 --- a/meta-lmp-base/recipes-samples/images/lmp-feature-docker.inc +++ b/meta-lmp-base/recipes-samples/images/lmp-feature-docker.inc @@ -3,6 +3,7 @@ CORE_IMAGE_BASE_INSTALL += " \ docker \ docker-credential-helper-fio \ docker-compose \ + ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "wayland-cdi", "", d)} \ " EXTRA_USERS_PARAMS += "\