]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
qemu/testimage: Ensure GNU tar is in test images
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 20 Nov 2024 17:59:43 +0000 (17:59 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 21 Nov 2024 12:14:20 +0000 (12:14 +0000)
We've seen cases where a ptest (strace) has a 43GB sparse file in the test
directory. busybox tar doesn't work well with this. The resulting 1.4GB archive
takes hours to extract too.

Ensure tar is added to our full images and use the sparse option to collect
files for debugging. This stops crazy build hangs.

Since tar is GPLv3, we have to exclude it from that test code. We don't boot
any of those images so the debug collection code is safe there, at least for now.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/no-gplv3.inc
meta/conf/machine/include/qemu.inc
meta/lib/oeqa/selftest/cases/incompatible_lic.py
meta/lib/oeqa/utils/postactions.py

index b3eb936d94fca9006997f3d2777d3bbb232f63c6..705e05319af06ab1bdeafbd01c7907b77e0d567d 100644 (file)
@@ -28,3 +28,5 @@ CORE_IMAGE_BASE_INSTALL:remove:pn-core-image-weston = "matchbox-terminal"
 # Some python-tests use bash outside of ptest
 RDEPENDS:${PN}-tests:remove:class-target:pn-python3 = "${MLPREFIX}bash"
 INSANE_SKIP:${PN}-tests:pn-python3 = "file-rdeps"
+
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove = "tar"
index bb7aec76750170b152f03869507d1a309aa4ca17..d7392d47623833e64b4f8469a139db004fa57047 100644 (file)
@@ -28,3 +28,6 @@ KERNEL_FEATURES:append:pn-linux-yocto = " features/nfsd/nfsd-enable.scc"
 KERNEL_FEATURES:append:pn-linux-yocto-rt = " features/nfsd/nfsd-enable.scc"
 
 IMAGE_CLASSES += "qemuboot"
+
+# Use gnu tar so we can handle sparse files in testimage debug archives
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "tar"
index be5484bca496b285ac8b818b7ecd3dbc2c462c86..93884f573193564f61ed60e045675d886e7934df 100644 (file)
@@ -102,6 +102,7 @@ class IncompatibleLicensePerImageTests(OESelftestTestCase):
         return """
 IMAGE_INSTALL:append = " bash"
 INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0* LGPL-3.0*"
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove = "tar"
 """
 
     def test_bash_default(self):
@@ -136,6 +137,8 @@ class NoGPL3InImagesTests(OESelftestTestCase):
     def test_core_image_minimal(self):
         self.write_config("""
 INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0* LGPL-3.0*"
+
+require conf/distro/include/no-gplv3.inc
 """)
         bitbake('core-image-minimal')
 
index 8f787838b9d9e5c210a5a19748b8b99c5b6adb31..c69481db6cbf29b5e3f267170151d85e73baa0d0 100644 (file)
@@ -64,7 +64,8 @@ def list_and_fetch_failed_tests_artifacts(d, tc, artifacts_list, outputdir):
         bb.warn("Could not load artifacts list, skip artifacts retrieval")
         return
     try:
-        cmd = "tar zcf - " + " ".join(artifacts_list)
+        # We need gnu tar for sparse files, not busybox
+        cmd = "tar --sparse -zcf - " + " ".join(artifacts_list)
         (status, output) = tc.target.run(cmd, raw = True)
         if status != 0 or not output:
             raise Exception("Error while fetching compressed artifacts")