summaryrefslogtreecommitdiffstats
path: root/meta/lib
Commit message (Collapse)AuthorAgeFilesLines
* oeqa context.py: use TEST_SUITES if setMikko Rapeli3 days1-0/+7
| | | | | | | | | | | | | If build target has set TEST_SUITES, then that should be the default test modules to execute. Fixes testexport.bbclass to run same tests as testimage.bbclass which already uses TEST_SUITES. (From OE-Core rev: c66b1dc0a2f973a84dc38b7cc27ae823e0f0a916) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* spdx30: Allow VEX Justification to be configurableJoshua Watt8 days1-17/+16
| | | | | | | | | | | | | | | Instead of hard coding the VEX justifications for "Ignored" CVE status, add a map that configures what justification should be used for each status. This allows other justifications to be easily added, and also ensures that status fields added externally (by downstream) can set an appropriate justification if necessary. (From OE-Core rev: c0fa3d92cefa74fa57c6c48c94acc64aa454e781) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime: set self.runner and handle NoneMikko Rapeli8 days2-0/+3
| | | | | | | | | | | | Set default self.runner to None. qemu target sets the runner to qemu. Then handle self.runner None in run_network_serialdebug(). This way ssh runner and failing ping or ssh tests handle the error cases. (From OE-Core rev: 39f72147ef402bea54a66abf984315c1f93aa141) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity/utils: Directly use gcc, not BUILD_CCRichard Purdie8 days1-11/+6
| | | | | | | | | The test/helper is written assuming gcc, so just call that and stop accessing BUILD_CC which may be set to clang. (From OE-Core rev: 0a165a93693a293f08cb0d7e2dfa1016803a917a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uninative/utils: Drop workarounds for gcc 4.8/4.9Richard Purdie8 days1-26/+0
| | | | | | | | | We require at least gcc 8.0 in sanity.bbclass so drop the 4.8/4.9 special case handling in uninative. (From OE-Core rev: 552e037bf598ac523f35b69d2dafc99e5ba59c5f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/sdk: Simplify test specification and discoveryThune Tran10 days8-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify how tests are specified and discovered for different SDK configurations to allow per-layer customization. * Introduce `TESTSDK_CASE_DIRS` variable to specify test directory types, replacing the need to modify the default_cases class member * Discover tests from configured layers using a common discovery pattern (`<LAYER_DIR>/lib/oeqa/<dirname>/cases`) where `<dirname>` is specified in `TESTSDK_CASE_DIRS` * The buildtools directories were renamed to follow the common discovery pattern (`<LAYER_DIR>/lib/oeqa/<dirname>/cases`) for consistency across all SDK configurations. meta/lib/oeqa/ ├── sdk/cases/ # Standard SDK: dirname="sdk" ├── buildtools/cases/ # Buildtools: dirname="buildtools" └── buildtools-docs/cases/ # Buildtools-docs: dirname="buildtools-docs" meta-mingw/lib/oeqa/ └── sdkmingw/cases/ # MinGW: dirname="sdkmingw" meta-foo/lib/oeqa/ └── sdk/cases/ # Standard SDK: dirname="sdk" Tested by: 1. Adding new tests using the default discovery pattern `<LAYER_DIR>/lib/oeqa/sdk/cases` and verifying they are discovered and executed. 2. Verifying existing SDK configuration tests work (requires -c populate_sdk first): * Standard SDK: `bitbake core-image-minimal -c testsdk` * Buildtools tarball: `bitbake buildtools-tarball -c testsdk` * Buildtools docs tarball: `bitbake buildtools-docs-tarball -c testsdk` * Mingw SDK: (SDKMACHINE = "x86_64-mingw32") `bitbake core-image-minimal -c testsdk` (From OE-Core rev: bde94c128c0b4e7e1ebea40f582b4dd6dcc965ff) Signed-off-by: Thune Tran <thune.a.tran@boeing.com> Signed-off-by: Chuck Wolber <chuck.wolber@boeing.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/devtool: update create_go test to match the new behaviourRoss Burton10 days1-23/+10
| | | | | | | | | Update the test now that the recipe uses go-mod-update-modules. (From OE-Core rev: 1030223a43aa4500c0d4ebd9dfacf60b44239481) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/sefltest/devtool: improve assignment matching in _test_recipe_contentsRoss Burton10 days1-1/+1
| | | | | | | | | | | | | This function assumed that all assignments are done with just "=". However, being able to check += or ?= is also useful, so use a regex to split the line and be more flexible about what an assignment operator looks like. (From OE-Core rev: bee528f38d39ed1f91319201e8a99c0b65c9f975) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/licenses: move tidy_licenses from recipetoolRoss Burton10 days1-0/+15
| | | | | | | | | | This function, to tidy a license string, is useful outside of recipetool so move it to oe.license. (From OE-Core rev: 9d57b53169bc60b281510c49e54123941a17a8f5) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* spdx30_tasks: Change recipe license to declaredJoshua Watt2025-06-261-1/+1
| | | | | | | | | | | Per discussion with the SPDX licensing group, recipe LICENSE statements classify as a declared license, not a concluded license. (From OE-Core rev: 561447c7cc1485366dbf41cfbf8dcc1cbf29d043) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest: move pokybleeding selftest from meta to meta-pokyAlexander Kanavin2025-06-261-32/+0
| | | | | | | | | | meta/ is 'owned' by oe-core and meta-yocto repo should not be putting files in it. (From meta-yocto rev: 83be7b1c70a7f90f611ad33284d0b8f963552eae) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqq/runtime/ethernet_ip_connman: remove test_set_virtual_ip referenceMikko Rapeli2025-06-261-1/+0
| | | | | | | | | | | | | | It was removed. Fixes test loading after testexport.bbclass has exported the tests: oeqa.core.exception.OEQADependency: TestCase ethernet_ip_connman.Ethernet_Test.test_get_ip_from_dhcp depends on ethe rnet_ip_connman.Ethernet_Test.test_set_virtual_ip and isn't available, cases available odict_keys(['apt.AptRepoTest. test_apt_install_from_repo', 'boot.BootTest.test_reboot', 'buildcpio.BuildCpioTest.test_cpio', ... (From OE-Core rev: 6112eb97e20c1fb38acb9e78e89876c4302f65b8) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/sstatetests: Improve/fix sstate creation testsRichard Purdie2025-06-261-48/+30
| | | | | | | | | | | | | | | | | | | | | | There are multiple problems with the sstate creation tests. They currently both execute twice, once to check one set of files, then another. We can do this together in one test which makes the code easier to follow. The common test function also has parameters which were always the same value, so those can be simplified. We can use the umask context manager from bb.utils to simplfy the umask code. The badperms test was actually broken, it was detecting bad permissions, then ignoring them. This patch fixes that regression too and allows the check to operate (relying on a separate fix to sstate umask handling). The result should be an easier to understand couple of test cases which should also function correctly and be more reliable. (From OE-Core rev: 5b9263040013199c5cb480125d5ca349f5d6dc55) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/sstatetests: Fix NATIVELSBSTRING handlingRichard Purdie2025-06-261-7/+12
| | | | | | | | | | | | | | The NATIVELSBSTRING variable changes value once a BuildStarted event occurs in a build directory. This meant running some of the tests directly in a fresh build directory would fail but they'd pass when run as a group of tests. This is clearly suboptimal. Move the NATIVELSBSTRING handling to a location where the value is consistent and a comment about the interesting behaviour of the variable so it hopefully doesn't catch out others in future. (From OE-Core rev: e1c46fdb44fed18909d9ff4b43b4e445c5a22d33) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime/stap: fix script logic problemVictor Kamensky2025-06-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | Looks as a typo introduced by "6cf4d23a2d26c2767edd93f2eb317ff759b5a992 (oeqa/runtime/stap: improve systemtap test)" - when original command was split into two parts 'self.target.run' was missed for the second part. Note this and previos commit issues were masked because mentioned commit has try/except around tests, so failures that normally are reported when test assertEqual throw an exception never reached oeqa infra. Effectively, this test was broken for the last 3 years. I will leave blanket try/except around test for now, so this test will pass all the time as long as dmesg is working. But at least with the fixes one can inspect log.do_testimage output and check that all steps are successful or not. (From OE-Core rev: ec6e4fa83b8d64035b61c080402151af04b3d137) Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime/stap: fix module name: stap-hello -> stap_helloVictor Kamensky2025-06-261-2/+2
| | | | | | | | | | | | | | | Systemtap refuses modules names like stap-hello, it says: > ERROR: Safety pattern mismatch for -m parameter ('stap-hello' vs. '^[a-z0-9_]+$') rc=1 'stap-hello' was introduced by: 6cf4d23a2d26c2767edd93f2eb317ff759b5a992 (oeqa/runtime/stap: improve systemtap test) and '-m parameter' regexp check was in SystemTap from 2010, not sure how this test case ever passed after mentioned change. (From OE-Core rev: bb916c60a32be57babaf67d0bcad4724547feb31) Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic-image-minimal, oeqa/selftest/wic: run 'wic ls/cp/rm' in bitbake taskHongxu Jia2025-06-261-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to commit [2255f28b57 wic: add WIC_SECTOR_SIZE variable][1] applied, call `wic ls|cp|rm|write' in bitbake task will hung, but we have no scenario case to cover it After commit [scripts/wic: fix calling wic ls|cp|rm|write hung in bitbake task] applied, this commit run `wic cp|ls|rm' in case wic.Wic2.test_wic_image_type and wic.Wic2.test_qemu, at post function of with do_image_wic in image wic-image-minimal, and check if file is there $ echo 'SANITY_TESTED_DISTROS = ""' >> conf/local.conf $ oe-selftest -r wic.Wic2.test_wic_image_type wic.Wic2.test_qemu ... 2025-06-23 15:46:22,157 - oe-selftest - INFO - Adding: "include selftest.inc" in /buildarea5/hjia/poky/build-st/conf/local.conf 2025-06-23 15:46:22,157 - oe-selftest - INFO - Adding: "include bblayers.inc" in bblayers.conf 2025-06-23 15:46:22,157 - oe-selftest - INFO - test_qemu (wic.Wic2) The variable 'TEST_RUNQEMUPARAMS' is not defined 2025-06-23 15:56:46,319 - oe-selftest - INFO - ... ok 2025-06-23 15:56:46,324 - oe-selftest - INFO - test_wic_image_type (wic.Wic2) 2025-06-23 15:57:17,780 - oe-selftest - INFO - ... ok 2025-06-23 15:57:17,781 - oe-selftest - INFO - ---------------------------------------------------------------------- 2025-06-23 15:57:17,781 - oe-selftest - INFO - Ran 2 tests in 655.792s 2025-06-23 15:57:17,781 - oe-selftest - INFO - OK 2025-06-23 15:57:25,743 - oe-selftest - INFO - RESULTS: 2025-06-23 15:57:25,743 - oe-selftest - INFO - RESULTS - wic.Wic2.test_qemu: PASSED (624.16s) 2025-06-23 15:57:25,744 - oe-selftest - INFO - RESULTS - wic.Wic2.test_wic_image_type: PASSED (31.46s) 2025-06-23 15:57:25,746 - oe-selftest - INFO - SUMMARY: 2025-06-23 15:57:25,746 - oe-selftest - INFO - oe-selftest () - Ran 2 tests in 655.793s 2025-06-23 15:57:25,746 - oe-selftest - INFO - oe-selftest - OK - All required tests passed (successes=2, skipped=0, failures=0, errors=0) (From OE-Core rev: 18d774eafb7fba720882fcdb945d145b82fa1dd4) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* libglvnd: migrate from meta-oeDmitry Baryshkov2025-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | libglvnd is a vendor-neutral approach to handling OpenGL / OpenGL ES / EGL / GLX libraries. It has been proposed and initially implemented by NVIDIA in order to simplify coinstallation of GL drivers provided by different vendors. Major Linux distributions (Debian, Ubuntu, Fedora, etc.) have already switched to libglvnd. Having libglvnd in OE-Core simplifies integration of this ABI into distro and BSP layers (e.g. it will help meta-tegra, which currently provides its own version of the recipe). Import recipe for libglvnd from the meta-oe layer (changes: fix virtual package names, add add the SUMMARY data, drop git@ from SRC_URI, require glvnd DISTRO_FEATURE). (From OE-Core rev: 621e9be9663e448dde3f6b6a02b413fd65983e6c) Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/case: add file exists assertionRoss Burton2025-06-231-0/+8
| | | | | | | | | | Add assertFileExists() to simply tests that want to check that a file exists. (From OE-Core rev: b62e53a0cff2522fef3b89de875c9526a626d7dd) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/go: document map_arch, and raise an error on unknown architectureRoss Burton2025-06-231-1/+5
| | | | | | | | | | | | | Add a comment explaining what this function does and where the values come from. If the architecture isn't know, instead of returning an empty string which could fail mysteriously, raise a KeyError so it fails quickly. (From OE-Core rev: 025414c16319b068df1cd757ad9a3c987a6b871d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/buildhistory: Move test cases to common locationRichard Purdie2025-06-233-66/+57
| | | | | | | | | | Having the test cases split in different places makes no sense. Move them all to the place you'd expect to find them. Drop the base class as it is no longer needed. (From OE-Core rev: c5a8a1dc637206fa398c639c49531f709e5b002f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/devtool: calculate source paths relative to UNPACKDIRAlexander Kanavin2025-06-202-15/+15
| | | | | | | | | | | | | | | | | | | | Now that recipes default to S in UNPACKDIR, recipetool and devtool should do the same. There was some discussion about changing devtool to simply setting UNPACKDIR via bbappend to a workspace and running unpack task directly; currently it has a bunch of convoluted path calculations, substitutions, moving source trees around and and special casing (devtool-source.bbclass in particular is an unpleasant hack). This should definitely be done; but right now we can simply tweak existing code which at least doesn't make it worse. (From OE-Core rev: c326ca8aeb2bf0f7719e43921d10efd5dedc7b2a) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: set S from UNPACKDIR in recipes that use only local filesAlexander Kanavin2025-06-201-2/+2
| | | | | | | | | | | | | | | There is no need to have two assignments; also setting S from UNPACKDIR (and not vice versa) is more logical as unpack task comes first, and tasks that come after unpack use S to access unpack results. Also adjust reference test data in selftest/recipeutils to reflect changes in test recipes. (From OE-Core rev: f64b7e5fb3181734c8dde87b27e872a026261a74) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove S in recipes that fetch from git via setting ↵Alexander Kanavin2025-06-203-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BB_GIT_DEFAULT_DESTSUFFIX Removing all the S = ${WORKDIR}/git assignments works because BB_GIT_DEFAULT_DESTSUFFIX is set to match S from bitbake.conf (which itself is set to match typical tarball releases). A few recipes are setting S to a sub-directory of the git tree and need to be adjusted accordingly. bzip2 recipe is fetching a tarball and separately cloning tests; adjust the recipe to put the latter into 'bzip2-tests', instead of 'git'. devupstream.bbclass no longer needs to rewrite S, and is adjusted accordingly. Adjust scripts/lib/recipetool/append.py to not hardcode 'git' as unpack destination. Adjust kernel-yocto.bbclass to use the git unpack variable instead of hardcoding 'git' (there's also removal of repetition of string constants and a correction of workdir/unpackdir mismatch in one of the if-else branches). Ensure build-appliance-image recipe does not use 'git' as checkout directory for poky repo, but rather explicitly name it 'poky'. Ensure reproducible.py code that looks for git repositories does not hardcode 'git' but uses the destination set by BB_GIT_DEFAULT_DESTSUFFIX. Ensure recipetool does not write out unneeded S settings into newly created recipes that fetch from git. Adjust selftest to not hardcode 'git' as unpack directory. (From OE-Core rev: f80c07019ddadaf9c5fb890faabfda7920ecd15e) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/bbconfigbuild/configfragments: add support for listing and enabling ↵Alexander Kanavin2025-06-201-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | built-in fragments Sample output: $ bitbake-config-build enable-fragment machine/qemuarm Fragment machine/qemuarm added to /srv/storage/alex/yocto/build-64-alt/conf/auto.conf. $ bitbake-config-build list-fragments Available built-in fragments: machine/... Sets MACHINE = ... distro/... Sets DISTRO = ... Enabled built-in fragments: machine/qemuarm Sets MACHINE = "qemuarm" ... (standard on-disk fragments output follows) (From OE-Core rev: 47cb11db810bef36e791af84be1d680fd99301c7) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/command: fast-path get_bb_var()Ross Burton2025-06-201-1/+14
| | | | | | | | | | | | | | | get_bb_var() currently end up calling 'bitbake -e' and parsing the whole output. However if postconfig isn't set then we can speed this up by just calling bitbake-getvar. The complication with failing bitbake-getvar calls is because we need to be careful to return None instead of the empty string when the variable doesn't exist. (From OE-Core rev: fafe77879aa6225aa8b5187ff590bb4998cbf987) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust-target-config.bbclass: Update for new riscv TUNE_FEATURESMark Hatle2025-06-201-2/+0
| | | | | | | | | | | | | | | | Add the new TUNE_FEATURES to the 'features:' list, based on matching output with: rustc --target=riscv32i-unknown-none-elf -Ctarget-feature=help Use the TUNE_RISCV_ABI instead of guessing for the ABI. Pass the arch "as-is", since it should now be riscv32 or riscv64. (From OE-Core rev: 88b59db87d2c65e5be0f3fee1ebf4ee64ef05f18) Signed-off-by: Mark Hatle <mark.hatle@amd.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* riscv tunes: ISA Implementation of RISC-V tune featuresMark Hatle2025-06-202-1/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the following base ISAs: * rv32i, rv64i * rv32e, rv64i The following ABIs: * ilp32, ilp32e, ilp32f, ilp32d * lp64, lp64e, lp64f, lp64d The following ISA extension are also implemented: * M - Integer Multiplication and Division Extension * A - Atomic Memory Extension * F - Single-Precision Floating-Point Extension * D - Double-Precision Floating-Point Extension * C - Compressed Extension * B - Bit Manipulation Extension (implies Zba, Zbb, Zbs) * V - Vector Operations Extension * Zicsr - Control and Status Register Access Extension * Zifencei - Instruction-Fetch Fence Extension * Zba - Address bit manipulation extension * Zbb - Basic bit manipulation extension * Zbc - Carry-less multiplication extension * Zbs - Single-bit manipulation extension * Zicbom - Cache-block management extension The existing processors tunes are preserved: * riscv64 (rv64gc) * riscv32 (rv32gc) * riscv64nf (rv64imac_zicsr_zifencei) * riscv32nf (rv32imac_zicsr_zifencei) * riscv64nc (rv64imafd_zicsr_zifencei) Previously defined feature 'big-endian' has been removed as it was not used. (From OE-Core rev: bcaf298a146dfd10e4c8f44223ea083bc4baf45c) Signed-off-by: Mark Hatle <mark.hatle@amd.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: add new test for toolchain switchingRoss Burton2025-06-191-0/+71
| | | | | | | | | | | | | | Add a basic test for the toolchain switching code: set the toolchain to GCC by default but Clang for a specific recipe, and verify that two recipes are built with the expected compiler. This works because before we strip the installed binaries there is a .comment segment that contains the list of toolchains used. (From OE-Core rev: 7988c32191927f1c6db422c959eab7a03dfeda04) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/esdk: remove postconfig argumentRoss Burton2025-06-191-5/+1
| | | | | | | | | | | | | | | | Discovered when looking for users of get_bb_var()'s postconfig argument, this wrapper around runCmd() has a postconfig argument that has odd behaviour: it _appends_ the new configuration to local.conf instead of having them used for this specific run (unlike the other functions in commands.py) None of the eSDK tests use this functionality, so remove it. Future test cases that need to write further configuration should do so directly. (From OE-Core rev: 6196d096b95b36f8b72b4049d5479f8f23e7891d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: fitimage: Add test for signing U-Boot FIT image without SPLJamin Lin2025-06-191-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new selftest case `test_sign_uboot_fit_image_without_spl` to verify that the build can correctly generate and sign a U-Boot FIT image in a scenario where no SPL is used. Background: - Some boards build only the U-Boot proper FIT image and do not require an SPL. - The signing flow must handle this case gracefully: generate the ITS, sign the FIT image, and skip signing/injecting a key into the SPL DTB. What this test does: 1) Enables `UBOOT_FITIMAGE_ENABLE` and `SPL_SIGN_ENABLE` but explicitly sets `SPL_DTB_BINARY` to an empty string to indicate that no SPL is present. 2) Verifies that the U-Boot ITS and FIT image are built successfully. 3) Confirms that the generated ITS file includes signature metadata as requested. 4) Dumps the FIT image to ensure that the signature nodes exist. 5) Confirms that the log for `do_uboot_assemble_fitimage` shows the expected mkimage/mkimage_sign invocation. This ensures that signing works correctly even when only the U-Boot proper is built, which matches real-world configurations that do not require an SPL. (From OE-Core rev: cdb4f4249a386113bebc65918a1b088c64e59182) Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* spdx: add option to include only compiled sourcesDaniel Turull2025-06-172-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | When SPDX_INCLUDE_COMPILED_SOURCES is enabled, only include the source code files that are used during compilation. It uses debugsource information generated during do_package. This enables an external tool to use the SPDX information to disregard vulnerabilities that are not compiled. As example, when used with the default config with linux-yocto, the spdx size is reduced from 156MB to 61MB. Tested with bitbake world on oe-core. CC: Quentin Schulz <quentin.schulz@cherry.de> CC: Joshua Watt <JPEWhacker@gmail.com> CC: Peter Marko <peter.marko@siemens.com> (From OE-Core rev: c6a2f1fca76fae4c3ea471a0c63d0b453beea968) Signed-off-by: Daniel Turull <daniel.turull@ericsson.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Update after plugin name changesRichard Purdie2025-06-162-6/+6
| | | | | | | | Update the plugin names to account for the "-" to "_" plugin name change. (From OE-Core rev: afa1b5c9f6ed17c021e37a54d0d6abee50a60bf9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/license_finder: support extra hashes being passed to find_licensesRoss Burton2025-06-161-3/+4
| | | | | | | | | | | | | When using the license finder the caller might know some more license hashes, for example if it is updating existing metadata. Allow the caller to pass more hashes that can be used when identifying licenses. (From OE-Core rev: 9011bc307fcdccb144b75d77b36bbc5c8d4bd96d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/license_finder: rewrite license checksum loading, scan more licensesRoss Burton2025-06-161-36/+29
| | | | | | | | | | | | | Rewrite the license checksum generation and loading of CSV files to be clearer. This also expands the scan of COMMON_LICENSE_DIR to include LICENSE_PATH, which can be extended by layers to provide more license texts. (From OE-Core rev: 417240ba7a9b3985530988940a222b079b503b64) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/license_finder: don't return the "crunched" license text in crunch_licenseRoss Burton2025-06-161-7/+6
| | | | | | | | | | | | | | crunch_license() will perform some basic text manipulation to try and canonicalise the license texts. It also returns the new license text but none of the callers use this, and as a slightly mangled version of the original it has no real purpose. Remove this return value and clean up the callers. (From OE-Core rev: 34603ed3b4919dcfba19ef57db11a6d3bb2704f1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/license_finder: remove unused arguments in get_license_md5sumsRoss Burton2025-06-161-14/+9
| | | | | | | | | | | | | | | get_license_md5sums() has two optional arguments: - static_only: if set, don't checksum the licenses in COMMON_LICENSE_DIR - linenumbers: if set, the CSV file can contain begin/end/md5 values as used in LIC_FILES_CHKSUM. Neither of these are used and complicate the logic, so remove them. (From OE-Core rev: 148e501bd4fe65e7bed68d086ba98180a9b2483c) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/license_finder: consolidate hash->license mapsRoss Burton2025-06-161-59/+0
| | | | | | | | | | | | | | There are two locations where mappings of checksums to license names are: the license-hashes.csv file and a hard-coded set of assignments in the code. There's no need for two, so remove the assignments and move the hashes into the CSV file. (From OE-Core rev: a775c6cb5a2bf1f30a94ba3b88af9aa491e98b1a) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/license_finder: add first_only argument to find_licenses()Ross Burton2025-06-161-4/+12
| | | | | | | | | | | | It may be desired to find only the "top-level" license file instead of every potential candidate, so add a first_only argument (defaulting to False to preserve existing behaviour) to return just the first license found. (From OE-Core rev: 995936ffda02a1def1863490ec315783a7470c72) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/license_finder: skip .sh files when looking for licensesRoss Burton2025-06-161-1/+1
| | | | | | | | | Shell scripts are not licenses, so skip them. (From OE-Core rev: 0ce9ad80d3b90edc1d1e690763e8f3d9f0cd523d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/license_finder: extract license finding code from recipetoolRoss Burton2025-06-161-0/+242
| | | | | | | | | | | | This code is 99% identical to the original code in recipetool/create.py, but with two minor changes: - The implicit recipetool logger is changed to an explicit logger - The CSV of license hashes is moved to meta/files/ (From OE-Core rev: b132652c6e520121c6b0e7e873b0d33ede0309b5) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: fitimage: replace cleansstate with compile -fAdrian Freihofer2025-06-161-1/+1
| | | | | | | | | | | | | | | | Avoid using "cleansstate" in tests, as it can remove files from SSTATE_DIR and disrupt parallel builds on autobuilders. Use "bitbake kernel-signing-keys-native -c compile -f" to force key regeneration without affecting shared state. This issue was introduced in: oe-selftest: fitimage: cleanup FIT_GENERATE_KEYS OE-Core rev: 97e58d7c2bc1943f0696fc72984788f459f7f7c4 (From OE-Core rev: 917e2989f34fde12d3f039744fca1d5ab5b4a7a8) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: fitimage: fix new parser compatibilityAdrian Freihofer2025-06-161-3/+3
| | | | | | | | | | Recent parser changes throw a warning if there is no space around the = operator. (From OE-Core rev: 518df809354a745deebe3c85b1390557398c8893) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe: Move vardepexclude entries alongside functionsRichard Purdie2025-06-165-1/+15
| | | | | | | | | Now we have decorators that can do this, move the variable dependencies exclusions alongside the code that needs them for maintainability. (From OE-Core rev: e522169c5f95de6fc74b43672573700d8eb8e082) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust: Upgrade 1.85.1->1.86.0Yash Shinde2025-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rust stable version updated to 1.86.0. https://blog.rust-lang.org/2025/04/03/Rust-1.86.0.html * Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. As per rust document this is a required dependency. Fixes: | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated. https://github.com/rust-lang/rust/commit/f9c16997dc016a3ef1456f56df2ab564a1c48cb2 It adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * Disable building of extended Rust tools to reduce build time and filesystem usage. Update config.toml to disable building of extended Rust tools that are not required. This helps minimize unnecessary build time and filesystem usage. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: https://github.com/rust-lang/rust/pull/135001 https://github.com/rust-lang/rust/commit/8744b44e6bde053f7656a3c727c968177ee8e4b6 * Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0 https://github.com/rust-lang/rust/commit/139d6ba054a1a4cc5fe64981ad46fd5547bd4916 * LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. https://github.com/rust-lang/rust/commit/1fe351b * Restrict tests using "//@only <target_arch>" to avoid failures on riscv64, which is now part of default AB testing. Since riscv64 is Tier 2 with no automated testing, some tests may fail. This approach ensures tests continue running on supported architectures while skipping them on riscv64. https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools (From OE-Core rev: c064ef18343a956aea397d36d2e7665d6c8afd7d) Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package: export debugsources in PKGDESTWORK as jsonDaniel Turull2025-06-121-0/+46
| | | | | | | | | | | | | | | | | | | | | | | The source information used during packaging can be use from other tasks to have more detailed information on the files used during the compilation and improve SPDX accuracy. Source files used during compilation are store as compressed zstd json in pkgdata/debugsources/$PN-debugsources.json.zstd Format: { binary1: [src1, src2, ...], binary2: [src1, src2, ...] } I checked the sstate size, and it slightly increases using core-image-full-cmdline: without patch: 2456792 KB sstate-cache/ with patch: 2460028 KB sstate-cache/ (4236 KB or 0.17%) CC: Richard Purdie <richard.purdie@linuxfoundation.org> (From OE-Core rev: c507dcb8a8780a42bfe68b1ebaff0909b4236e6b) Signed-off-by: Daniel Turull <daniel.turull@ericsson.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: add test case for oeqa.utils.subprocesstweakRoss Burton2025-06-091-2/+35
| | | | | | | | | | | This class has a monkey-patched CalledProcessError instance that extends the __str__ method. Add a test case to ensure that it behaves as expected. (From OE-Core rev: 3c0e7b537eac62fced196e82ede781d88e593a69) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils/sshcontrol: correct condition for ending the select() loopAlexander Kanavin2025-06-091-1/+1
| | | | | | | | | | | | This was set backwards; per https://docs.python.org/3/library/subprocess.html#subprocess.Popen.returncode a return code of None indicates the process is still running, and so the code entered a busyloop that ended on timeout 5 minutes later, lengthening selftests significantly. (From OE-Core rev: a6690deffd7ddbce0e784701ea3fdbb84313b009) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/subprocesstweak: clean up __str__()Ross Burton2025-06-051-9/+4
| | | | | | | | | | Call super().__str__ to get the bulk of the string representation, and we don't need to guard on output/strerr existing as they always set. (From OE-Core rev: 2adcac16dd26fd054ea779cc4e7aa32282d9bdde) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa selftest uboot.py: add qemu KVM test caseMikko Rapeli2025-06-051-2/+57
| | | | | | | | | | | | | | | | | | Add a test case to boot target system via u-boot using qemu with KVM. This was broken recently and workaround proposed to u-boot. Test case works with genericarm64 and qemuarm64 target machines compiled and tested on aarch64 build host with KVM support. Test execution time with full sstate cache is around 170 seconds. qemu boot itself takes just a few seconds to full userspace. (From OE-Core rev: dce900b029607d12ad55de35741f245beb409b47) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>