From f20516d0fd0ddfb9e2f4d2bdb11ea40ccf575d49 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Mon, 12 Sep 2022 16:22:39 -0400 Subject: [PATCH] app-container: temporarily copy contens of .inc file to recipe Variable overrides have stopped working when this specific .inc file are used. To keep the demo working, we temporarily copy the exact contents of the .inc file into the recipe .. and all is well. Signed-off-by: Bruce Ashfield --- recipes-demo/images/app-container.bb | 38 +++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/recipes-demo/images/app-container.bb b/recipes-demo/images/app-container.bb index c8798cf0..22d2ab9f 100644 --- a/recipes-demo/images/app-container.bb +++ b/recipes-demo/images/app-container.bb @@ -2,9 +2,45 @@ SUMMARY = "Basic Application container image" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -include container-base.bb +#include container-base.bb OCI_IMAGE_ENTRYPOINT = "/usr/bin/flask-app" CONTAINER_SHELL = "busybox" IMAGE_INSTALL:append = "helloworld-flask" + +IMAGE_FSTYPES = "container oci" +inherit image +inherit image-oci + +IMAGE_FEATURES = "" +IMAGE_LINGUAS = "" +NO_RECOMMENDATIONS = "1" + +IMAGE_INSTALL = " \ + base-files \ + base-passwd \ + netbase \ + ${CONTAINER_SHELL} \ +" + +# If the following is configured in local.conf (or the distro): +# PACKAGE_EXTRA_ARCHS:append = " container-dummy-provides" +# +# it has been explicitly # indicated that we don't want or need a shell, so we'll +# add the dummy provides. +# +# This is required, since there are postinstall scripts in base-files and base-passwd +# that reference /bin/sh and we'll get a rootfs error if there's no shell or no dummy +# provider. +CONTAINER_SHELL ?= "${@bb.utils.contains('PACKAGE_EXTRA_ARCHS', 'container-dummy-provides', 'container-dummy-provides', 'busybox', d)}" + +# Allow build with or without a specific kernel +IMAGE_CONTAINER_NO_DUMMY = "1" + +# Workaround /var/volatile for now +ROOTFS_POSTPROCESS_COMMAND += "rootfs_fixup_var_volatile ; " +rootfs_fixup_var_volatile () { + install -m 1777 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/tmp + install -m 755 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/log +}