Openembedded Core Discussions
 help / color / mirror / Atom feed
From: bruce.ashfield@gmail.com
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
	Adrian Freihofer <adrian.freihofer@siemens.com>
Cc: openembedded-core@lists.openembedded.org
Subject: [OE-core][RFC PATCH 07/08] rootfs: don't carry debug rootfs postinst registrations into the image
Date: Fri,  6 Nov 2026 12:32:34 -0500	[thread overview]
Message-ID: <20261106173235.4155305-8-bruce.ashfield@gmail.com> (raw)
In-Reply-To: <20261106173235.4155305-1-bruce.ashfield@gmail.com>

From: Bruce Ashfield <bruce.ashfield@gmail.com>

The debug rootfs is created in the image's rootfs directory, with the
same package manager, so its package installs use the image's intercept
scripts. Postinsts register their packages in those scripts, and the
intercepts are only run once, for the image, after the debug rootfs has
been moved aside.

So a package that is only installed in the debug rootfs (from
IMAGE_INSTALL_DEBUGFS) and has an on-target postinst is registered with
delay_to_first_boot, and do_rootfs then tries to save its postinst from
the image, where it isn't installed:

  ERROR: core-image-minimal-1.0-r0 do_rootfs: Could not invoke rpm. Command
  '.../rpm -q --root=.../rootfs --queryformat %{postin} <pkg>' returned 1:
  package <pkg> is not installed

Other intercepts get the debug packages added to their package lists in
the same way.

The debug rootfs is a debug sysroot, it isn't booted, so there is nothing
to defer its postinsts to. Save the image's intercept scripts before the
debug packages are installed, and put them back afterwards, so the
intercepts only see what the image installed.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/lib/oe/rootfs.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index e0365da285..aac93dc42e 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -145,6 +145,16 @@ class Rootfs(object, metaclass=ABCMeta):
                     shutil.copy(os.path.join(root, f),
                                 self.image_rootfs + relative_dir)
 
+        # The debug rootfs is installed with the image's intercept scripts, and
+        # postinsts register their packages in them (delay_to_first_boot, for
+        # example). The intercepts are only run for the image, so a package
+        # installed only in the debug rootfs would have its postinst saved
+        # against an image that doesn't contain it. Put the image's intercepts
+        # back once the debug packages are installed.
+        intercepts_dir = self.pm.intercepts_dir
+        bb.utils.remove(intercepts_dir + '-orig', True)
+        shutil.copytree(intercepts_dir, intercepts_dir + '-orig', symlinks=True)
+
         bb.note("  Install complementary '*-dbg' packages...")
         self.pm.install_complementary('*-dbg')
 
@@ -162,6 +172,9 @@ class Rootfs(object, metaclass=ABCMeta):
             bb.note("  Install extra debug packages...")
             self.pm.install(extra_debug_pkgs.split(), True)
 
+        bb.utils.remove(intercepts_dir, True)
+        bb.utils.rename(intercepts_dir + '-orig', intercepts_dir)
+
         bb.note("  Removing package database...")
         for path in package_paths:
             if os.path.isdir(self.image_rootfs + path):
-- 
2.43.0


  parent reply	other threads:[~2026-11-06 17:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 17:32 [OE-core][RFC PATCH 0/8] enhance kernel -devsrc output options bruce.ashfield
2026-11-06 17:32 ` [OE-core][RFC PATCH 01/08] kernel.bbclass: map the kernel build directory to KERNEL_SRC_PATH bruce.ashfield
2026-11-06 17:32 ` [OE-core][RFC PATCH 02/08] kernel.bbclass: stage a manifest of the source files the build read bruce.ashfield
2026-11-06 17:32 ` [OE-core][RFC PATCH 03/08] kernel-devsrc: add build and source PACKAGECONFIG levels bruce.ashfield
2026-11-06 17:32 ` [OE-core][RFC PATCH 04/08] kernel-devsrc: add full and tarball " bruce.ashfield
2026-11-06 17:32 ` [OE-core][RFC PATCH 05/08] kernel-devsrc: optionally version the package bruce.ashfield
2026-11-06 17:32 ` [OE-core][RFC PATCH 06/08] kernel-devsrc: skip the recipe if no PACKAGECONFIG level is set bruce.ashfield
2026-11-06 17:32 ` bruce.ashfield [this message]
2026-11-06 17:32 ` [OE-core][RFC PATCH 08/08] rootfs: fail if an IMAGE_INSTALL_DEBUGFS package can't be installed bruce.ashfield
2026-11-06 19:08 ` [OE-core][RFC PATCH 0/8] enhance kernel -devsrc output options Richard Purdie
2026-11-06 20:20   ` bruce.ashfield

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=20261106173235.4155305-8-bruce.ashfield@gmail.com \
    --to=bruce.ashfield@gmail.com \
    --cc=adrian.freihofer@siemens.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox