All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Orling <ticotimo@gmail.com>
To: meta-virtualization@lists.yoctoproject.org
Cc: Tim Orling <tim.orling@konsulko.com>
Subject: [meta-virtualization][PATCH 1/3] image-oci: track multi-layer rootfs directories with pseudo
Date: Sun, 22 Nov 2026 10:29:08 -0800	[thread overview]
Message-ID: <20261122182910.35849-2-tim.orling@konsulko.com> (raw)
In-Reply-To: <20261122182910.35849-1-tim.orling@konsulko.com>

oci_multilayer_install_packages() installs each packages: layer into
${WORKDIR}/oci-layer-rootfs/layer-N-<name> from the do_image_oci
prefunc, which runs under pseudo. That directory is not in
PSEUDO_INCLUDE_PATHS, whereas ${WORKDIR}/rootfs used by do_rootfs is.

Since oe-core moved to dnf 5.4.7.0, every layer install fails:

  error: cannot open Packages database in
  Failed to load system repo from root ".../oci-layer-rootfs/layer-1-base":
  rpmtsOpenDB failed: Invalid argument

dnf creates var/lib/rpm in the layer rootfs but the rpmdb is never
created, while do_rootfs of the same recipe installs the same packages
successfully. The rpm macros (%_dbpath=/var/lib/rpm) and the
RPM_CONFIGDIR/RPM_ETCCONFIGDIR environment are identical in both tasks;
the only difference found is pseudo coverage of the install root.

Add the layer rootfs base to PSEUDO_INCLUDE_PATHS, the same way
image.bbclass does for MULTILIB_TEMP_ROOTFS.

Tested with the containers-library autobuilder target (aarch64 and
x86-64).

[YOCTO #16531]

AI-Generated: Uses Claude Code (Claude Opus 5.5)
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 classes/image-oci.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/classes/image-oci.bbclass b/classes/image-oci.bbclass
index 141cd2a8..5c9ef0e6 100644
--- a/classes/image-oci.bbclass
+++ b/classes/image-oci.bbclass
@@ -69,6 +69,14 @@ do_image_oci[depends] += "jq-native:do_populate_sysroot"
 # Package manager native tools for multi-layer mode with package installation
 OCI_PM_DEPENDS = "${@oci_get_pm_depends(d)}"
 do_image_oci[depends] += "${OCI_PM_DEPENDS}"
+# AI-generated (Claude Code, Claude Opus 5.5).
+# Multi-layer package layers are installed by RpmPM/OpkgPM into
+# ${WORKDIR}/oci-layer-rootfs/layer-N-<name> from do_image_oci, which runs
+# under pseudo. Like ${WORKDIR}/rootfs for do_rootfs, the layer rootfs must
+# be tracked by pseudo or dnf5/rpm6 cannot open the rpmdb in the installroot
+# ("rpmtsOpenDB failed: Invalid argument"). Same approach as image.bbclass
+# uses for MULTILIB_TEMP_ROOTFS.
+PSEUDO_INCLUDE_PATHS .= ",${WORKDIR}/oci-layer-rootfs"
 
 def oci_pkg_type(d):
     """Resolve IMAGE_PKGTYPE with a single, documented default.
-- 
2.56.1


  reply	other threads:[~2026-11-22 18:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 18:29 [meta-virtualization][PATCH 0/3] OCI multi-layer fixes for dnf5 and nginx Tim Orling
2026-11-22 18:29 ` Tim Orling [this message]
2026-11-22 23:29   ` [meta-virtualization][PATCH 1/3] image-oci: track multi-layer rootfs directories with pseudo Bruce Ashfield
2026-11-22 18:29 ` [meta-virtualization][PATCH 2/3] container-volatile-fixup: run after empty_var_volatile Tim Orling
2026-11-22 18:29 ` [meta-virtualization][PATCH 3/3] app-container-nginx: create /run/nginx and /var/log/nginx in rootfs Tim Orling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261122182910.35849-2-tim.orling@konsulko.com \
    --to=ticotimo@gmail.com \
    --cc=meta-virtualization@lists.yoctoproject.org \
    --cc=tim.orling@konsulko.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.