* [PATCH] multilib.bbclass: Filter ROOTFS_RO_UNNEEDED to fix uninstallation
@ 2025-10-20 16:03 mac
2025-10-29 16:12 ` [OE-core] " Ross Burton
0 siblings, 1 reply; 3+ messages in thread
From: mac @ 2025-10-20 16:03 UTC (permalink / raw)
To: openembedded-core; +Cc: Mike Crowe
From: Mike Crowe <mac@mcrowe.com>
When building an entire multilib image (e.g. lib32-core-image-minimal)
we need to ensure that the unneeded packages in ROOTFS_RO_UNNEEDED get
the multilib prefix applied before they are compared against the list of
installed packages inside Rootfs._uninstall_unneeded() to decide whether
they need to be installed.
Before this change with local.conf containing:
MACHINE = qemuarm64
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE:virtclass-multilib-lib32 = "armv7at-neon"
IMAGE_FEATURES = "read-only-rootfs"
running:
bitbake lib32-core-image-minimal
tar tavf tmp/deploy/images/qemuarm64/lib32-core-image-minimal-qemuarm64.rootfs.tar.zst|grep postinst
shows three files:
-rwxr-xr-x 0/0 25 2018-03-09 12:34 ./etc/init.d/run-postinsts
lrwxrwxrwx 0/0 0 2018-03-09 12:34 ./etc/rcS.d/S99run-postinsts -> ../init.d/run-postinsts
-rwxr-xr-x 0/0 2153 2018-03-09 12:34 ./usr/sbin/run-postinsts
whereas with this change there are no matching files.
Signed-off-by: Mike Crowe <mac@mcrowe.com>
---
meta/classes/multilib.bbclass | 1 +
1 file changed, 1 insertion(+)
Rootfs._uninstall_unneeded can also try to uninstall run-postinsts
without using the multilib prefix right at the top. I could fix that
with d.expand("${MLPREFIX}run-postinsts") it feels wrong to sully the
generic code with something multilib specific. Advice welcome.
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index 677dbc854a..15056dac4d 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -116,6 +116,7 @@ python __anonymous () {
clsextend = oe.classextend.ClassExtender(variant, prefixes, d)
clsextend.set_filter("PACKAGE_INSTALL", deps=False)
clsextend.set_filter("LINGUAS_INSTALL", deps=False)
+ clsextend.set_filter("ROOTFS_RO_UNNEEDED", deps=False)
clsextend.set_filter("RDEPENDS", deps=True)
pinstall = d.getVar("LINGUAS_INSTALL") + " " + d.getVar("PACKAGE_INSTALL")
d.setVar("PACKAGE_INSTALL", pinstall)
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [OE-core] [PATCH] multilib.bbclass: Filter ROOTFS_RO_UNNEEDED to fix uninstallation
2025-10-20 16:03 [PATCH] multilib.bbclass: Filter ROOTFS_RO_UNNEEDED to fix uninstallation mac
@ 2025-10-29 16:12 ` Ross Burton
2025-10-31 13:45 ` mac
0 siblings, 1 reply; 3+ messages in thread
From: Ross Burton @ 2025-10-29 16:12 UTC (permalink / raw)
To: mac@mcrowe.com; +Cc: openembedded-core@lists.openembedded.org
Hi Mike,
> On 20 Oct 2025, at 17:03, Mike Crowe via lists.openembedded.org <mac=mcrowe.com@lists.openembedded.org> wrote:
>
> From: Mike Crowe <mac@mcrowe.com>
>
> When building an entire multilib image (e.g. lib32-core-image-minimal)
> we need to ensure that the unneeded packages in ROOTFS_RO_UNNEEDED get
> the multilib prefix applied before they are compared against the list of
> installed packages inside Rootfs._uninstall_unneeded() to decide whether
> they need to be installed.
Would you be able to make a test case in oeqa to verify that this behaviour works as expected in the future, and doesn’t regress?
Thanks,
Ross
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH] multilib.bbclass: Filter ROOTFS_RO_UNNEEDED to fix uninstallation
2025-10-29 16:12 ` [OE-core] " Ross Burton
@ 2025-10-31 13:45 ` mac
0 siblings, 0 replies; 3+ messages in thread
From: mac @ 2025-10-31 13:45 UTC (permalink / raw)
To: Ross Burton; +Cc: openembedded-core@lists.openembedded.org
Hi Ross,
On Wednesday 29 October 2025 at 16:12:06 +0000, Ross Burton wrote:
>> On 20 Oct 2025, at 17:03, Mike Crowe via lists.openembedded.org <mac=mcrowe.com@lists.openembedded.org> wrote:
>>> When building an entire multilib image (e.g. lib32-core-image-minimal)
>>> we need to ensure that the unneeded packages in ROOTFS_RO_UNNEEDED get
>>> the multilib prefix applied before they are compared against the list of
>>> installed packages inside Rootfs._uninstall_unneeded() to decide whether
>>> they need to be installed.
>
> Would you be able to make a test case in oeqa to verify that this
> behaviour works as expected in the future, and doesn’t regress?
I've never written one before and I wasn't sure whether it should fit
inside one of the existing case files, but is this the sort of thing you
mean?
Subject: [PATCH] oe-selftest: Add test of read-only multilib image
This test confirms that the fix for ROOTFS_RO_UNNEEDED with multilib
images in 77c35362fb13c75145f9f999216b3d879ab18b77 don't regress.
diff --git a/meta/lib/oeqa/selftest/cases/multilib.py b/meta/lib/oeqa/selftest/cases/multilib.py
new file mode 100644
index 0000000000..67bfb37967
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/multilib.py
@@ -0,0 +1,32 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import get_bb_var, bitbake, runCmd
+
+class MultiLib(OESelftestTestCase):
+
+ def test_read_only_multilib_image_lacks_run_postinsts(self):
+ """
+ Check that a read-only multilib image can be built and that image has had
+ ${MLPREFIX}run-postinsts correctly uninstalled.
+ """
+
+ config = """
+MACHINE = "qemuarm64"
+require conf/multilib.conf
+MULTILIBS = "multilib:lib32"
+DEFAULTTUNE:virtclass-multilib-lib32 = "armv7at-neon"
+IMAGE_FEATURES = "read-only-rootfs"
+"""
+ self.write_config(config)
+ bitbake('lib32-core-image-minimal')
+ deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+ manifest_lines = open(deploy_dir_image + "/lib32-core-image-minimal-qemuarm64.rootfs.manifest").readlines()
+
+ # lib32-run-postinsts should have been uninstalled since
+ # run-postinsts is in ROOTFS_RO_UNNEEDED.
+ self.assertEqual(list(filter(lambda l: "run-postinsts" in l, manifest_lines)), [])
--
2.39.5
Thanks.
Mike.
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-31 13:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20 16:03 [PATCH] multilib.bbclass: Filter ROOTFS_RO_UNNEEDED to fix uninstallation mac
2025-10-29 16:12 ` [OE-core] " Ross Burton
2025-10-31 13:45 ` mac
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox