From 839dcdeb3073c094bf171d7107d81955feeb3dea Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Thu, 4 May 2023 20:56:06 +0900 Subject: Reworking config creation for lxc and container manager At "Add initial container manager config for r-car gen3" add container manager config recipes. But it is not support dynamic drm lease configuration, it require to static configuration in each guest. This patch enable dynamic drm lease configuration similar to lxc-config. Bug-AGL: SPEC-4777 Change-Id: I6161c5ff3d93ddbbde866c1c28d107d8f524d40b Signed-off-by: Naoto Yamaguchi --- meta-agl-ic-container/classes/cm-config.bbclass | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 meta-agl-ic-container/classes/cm-config.bbclass (limited to 'meta-agl-ic-container/classes/cm-config.bbclass') diff --git a/meta-agl-ic-container/classes/cm-config.bbclass b/meta-agl-ic-container/classes/cm-config.bbclass new file mode 100644 index 00000000..60dec951 --- /dev/null +++ b/meta-agl-ic-container/classes/cm-config.bbclass @@ -0,0 +1,34 @@ +# Helper class for container manager config creation. +# Assumes that: +# - Recipe name is 'cm-config-' + +# - Corresponding files {config,system.conf}..in are in +# the file search path +# - That references to the DRM lease device name are parameterized +# with @DRM_LEASE_DEVICE@ in the .in files + +python __anonymous() { + bpn = d.getVar('BPN') + if not bpn.startswith('cm-config-'): + bb.error('Recipe name does not start with \'cm-config-\'') + config = bpn[10:] + d.setVar('CM_CONFIG_NAME', config) +} + +S = "${WORKDIR}" + +inherit allarch + +DRM_LEASE_DEVICE ??= "card0-HDMI-A-1" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install:append () { + install -m 0755 -d ${D}/opt/container/guests/${CM_CONFIG_NAME} + for f in system.conf.${CM_CONFIG_NAME}.in; do + sed -e 's|@DRM_LEASE_DEVICE@|${DRM_LEASE_DEVICE}|g' \ + ${WORKDIR}/$f > ${D}/opt/container/guests/${CM_CONFIG_NAME}/${f%.${CM_CONFIG_NAME}.in} + done +} + +FILES:${PN}:append = "/opt/container/guests/${CM_CONFIG_NAME}" -- cgit 1.2.3-korg