From 405d625c86bb87500ea5cdb324dbf0fb0b425b5c Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 10 Dec 2024 03:31:59 +0000 Subject: [PATCH] container-base: fix /var/volatile The existing workaround to populate /var/volatile was broken since oe-core has a rootfs postprocess command that ensures that /var/volatile is empty .. which undoes our creation of the log and tmp directories. We :remove that routine to get our /var/volatile as we like it. Signed-off-by: Bruce Ashfield --- recipes-extended/images/container-base.bb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/recipes-extended/images/container-base.bb b/recipes-extended/images/container-base.bb index b68938b9..64655e0b 100644 --- a/recipes-extended/images/container-base.bb +++ b/recipes-extended/images/container-base.bb @@ -41,7 +41,16 @@ CONTAINER_SHELL ?= "${@bb.utils.contains('PACKAGE_EXTRA_ARCHS', 'container-dummy IMAGE_CONTAINER_NO_DUMMY = "1" # Workaround /var/volatile for now +# This is required because the lack of post-install scripts means volatile +# directories (/var/volatile/*, etc.) are not created, so we do that ourselves +# in a minimal way below. We could bootstrap and run some of the more standard +# scripts that do it at boot, but we avoid that until needed. ROOTFS_POSTPROCESS_COMMAND += "rootfs_fixup_var_volatile ; " + +# This :remove is required, because it comes along and deletes our /var/volatile/ +# fixups! +ROOTFS_POSTPROCESS_COMMAND:remove = "empty_var_volatile" + rootfs_fixup_var_volatile () { install -m 1777 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/tmp install -m 755 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/log