| Message ID | 20251020160353.413127-1-mac@mcrowe.com |
|---|---|
| State | Accepted, archived |
| Commit | 77c35362fb13c75145f9f999216b3d879ab18b77 |
| Headers | show |
| Series | multilib.bbclass: Filter ROOTFS_RO_UNNEEDED to fix uninstallation | expand |
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
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.
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)