summaryrefslogtreecommitdiffstats
path: root/meta/classes
AgeCommit message (Collapse)Author
2022-10-27classes/kernel-fitimage: add ability to add additional signing optionsPaul Eggleton
Add a UBOOT_MKIMAGE_SIGN_ARGS variable to enable passing additional options to uboot-mkimage when it is run the second time to perform signing. (From OE-Core rev: fd39b936b03a6416e7a66408c47578daa2a08cf1) Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 8fd7ee7414b45a1feeef7982af3583475902a677) Signed-off-by: Massimiliano Minella <massimiliano.minella@se.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-27externalsrc: git submodule--helper list unsupportedJohn Edward Broadbent
Git has removed support for "git submodule--helper list". https://github.com/git/git/commit/31955475d1c283120d5d84247eb3fd55d9f5fdd9 This change provides an alternate method for gathering the submodules information. Tested: Build recipes with and without submodules (From OE-Core rev: 6c50d83af0af677c2dff864ac40c580ae446372b) Signed-off-by: Carson Labrado <clabrado@google.com> Signed-off-by: John Edward Broadbent <jebr@google.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6d9364e5f3535954f65cbbc694ee7933ac1d664f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-12cve-check: close cursors as soon as possibleRoss Burton
We can have multiple processes reading the database at the same time, and cursors only release their locks when they're garbage collected. This might be the cause of random sqlite errors on the autobuilder, so explicitly close the cursors when we're done with them. (From OE-Core rev: 48742ddf4d0acd419c8ffb8f22124ed525efc2d9) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit 5d2e90e4a58217a943ec21140bc2ecdd4357a98a) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-12classes: cve-check: Get shared database lockJoshua Watt
The CVE check database needs to have a shared lock acquired on it before it is accessed. This to prevent cve-update-db-native from deleting the database file out from underneath it. [YOCTO #14899] (From OE-Core rev: 374dd13db2c4fa92793f12c93d68d09304f77c17) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 20a9911b73df62a0d0d1884e57085f13ac5016dd) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-22rootfs-postcommands.bbclass: move host-user-contaminated.txt to ${S}Ming Liu
This is to ensure host-user-contaminated.txt would be removed before do_rootfs runs, since ${S} is in cleandirs of do_rootfs, otherwise, a host-user-contaminated.txt file that generated from previous builds could be used which is wrong. (From OE-Core rev: 06cfa8be54c9aee23bd8570a370a974b463a0a1a) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 54a3fd63e684d070fad962be97e549f3af7ac111) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-22bin_package: install into base_prefixPascal Bach
This makes the bin_package.bbclass work properly with the native class. (From OE-Core rev: 0bf78a8e0e1cf7e74b55aca4db0e62dd9dfa55ce) Signed-off-by: Pascal Bach <pascal.bach@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ad330b6d4b6e2ba051b5c6c437e07a183831f757) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-22kernel-arch: Fix buildpaths leaking into external module compilesRichard Purdie
Building external kernel modules like lttng-modules was showing build paths inside the debug symbols for the modules and breaking build reproducibility. Fix this by adding in the mapping needed to map the kernel build directory to something more approriate on target. (From OE-Core rev: c4d8834ed3d200f25f12fec8acfa2b954f3240e0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b56dc9009ba93174de6bf4c01e17808ef249dc5c) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-18insane: Fix buildpaths test to work with special devicesRichard Purdie
If enabled, the buildpaths test hangs in psplash as it tries to open a fifo and read from it, hanging indefinitely. Tweak the test to ignore fifo/socket/device files. (From OE-Core rev: 0106c6a629d0a9f07d76ffaad2dc92e48021e1b0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2567edb7e0a8c5ca9a88d6940491bf33bfe0eff9) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08kernel-fitimage.bbclass: add padding algorithm property in config nodesLUIS ENRIQUEZ
This allows choosing padding algorithm when building fitImage. It may be pkcs-1.5 or pss. (From OE-Core rev: 152765b74c77b4da102fce9c4c61a667e71f26a1) Signed-off-by: LUIS ENRIQUEZ <luis.enriquez@se.com> From: LUIS ENRIQUEZ <luis.enriquez@se.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-16classes/cve-check: Move get_patches_cves to libraryJoshua Watt
Moving the function will allow other classes to capture which CVEs have been patched, in particular SBoM generation. Also add a function to capture the CPE ID from the CVE Product and Version (From OE-Core rev: 75d34259a715120be1d023e4fd7b6b4b125f2443) (From OE-Core rev: bba069463ca3813666d084643b0239b9af0199e1) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fa6c07bc1a585f204dbdc28704f61448edb8fdc8) Signed-off-by: Akash Hadke <akash.hadke@kpit.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-15IMAGE_LOCALES_ARCHIVE: add option to prevent locale archive creationJate Sujjavanich
[YOCTO #14851] Under some circumstances it is not desirable to create a combined locale archive (/usr/lib/locale/locale-archive). The new variable IMAGE_LOCALES_ARCHIVE defaults to '1', so the default behaviour is not changed. Modified to work with code before move to lib/oe/package_manager (From OE-Core rev: af32908dfcebbc0f617ad828d895f504c37ee2d1) Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 8d78b819c2ec33fce3a34254fa90864ee5fa7617) Signed-off-by: Jate Sujjavanich <jatedev@gmail.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-15cve-check: hook cleanup to the BuildCompleted event, not CookerExitRoss Burton
The cve-check class writes temporary files to preserve state across the build, and cleans them up in a CookerExit handler. However, in memory-resident builds the cooker won't exit in between builds, so the state isn't cleared and the CVE report generation fails: NOTE: Generating JSON CVE summary ERROR: Error adding the same package twice Easily solved by hooking to BuildCompleted, instead of CookerExit. (From OE-Core rev: ee3270709158aff463fec6798f3b8968268b4d4b) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fccdcfd301de281a427bfee48d8ff47fa07b7259) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-08insane.bbclass: host-user-contaminated: Correct per package home pathAhmed Hossam
The current home path that is compared against is incorrect as it is missing the package name, this patch adds it. [YOCTO #14553] (From OE-Core rev: b75caf4a985e3c20996531785125eaffdc832104) Signed-off-by: Ahmed Hossam <Ahmed.Hossam@opensynergy.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit ae8f22d9e2694eea5ede3b31c6f3bca404ea4a5a) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-08cve-check: add support for Ignored CVEsMarta Rybczynska
Ignored CVEs aren't patched, but do not apply in our configuration for some reason. Up till now they were only partially supported and reported as "Patched". This patch adds separate reporting of Ignored CVEs. The variable CVE_CHECK_REPORT_PATCHED now manages reporting of both patched and ignored CVEs. (From OE-Core rev: 14b3c0ca46a0aa97565a24b7a5116306237d7cfe) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry-picked from c773102d4828fc4ddd1024f6115d577e23f1afe4) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-22archiver: don't use machine variables in shared recipesJose Quaresma
When using multiconfig with the same TMP folder we can have races because the shared recipes like gcc-source run twice. ARCHIVER_OUTDIR = ${ARCHIVER_TOPDIR}/${TARGET_SYS}/${PF}/ which includes TARGET_SYS and between the two different MACHINE values, this changes from 'arm-poky-linux-gnueabi' to 'aarch64-poky-linux'. This leads to the task running twice, once for each multiconfig. To solve this we need to store the shared output in a common place for all machines and in this way the stamps will be the same for each machine so the gcc-source will on run once regardless of the machine used. (From OE-Core rev: 135adeb82c9303c26193bb6f6bd3bc696793aa62) Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5abe497aad39a6ce8d72556fcdda1938a0f8c1bc) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-22archiver: use bb.note instead of echoJose Quaresma
(From OE-Core rev: fd1ed873ec00fda2f58370770ad7aed039bdc470) Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6420c8a6a8143f53ccad7ab2d56b2ba06db83099) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-22license.bbclass: Bound beginline and endline in copy_license_files()Peter Kjellerstedt
Ensure that begin_idx (i.e., beginline - 1) and end_idx (i.e., endline) are positive numbers in copy_license_files(). This makes sure the same lines are copied as populate_lic_qa_checksum() uses when it calculates the checksum. Before, beginline=0 would typically lead to that no lines were copied at all. (From OE-Core rev: 27cd074d747c5ef4b475c8a62a8ede2bbe58f996) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ab3cc3651d08d226675c461da760cda0bb6c0ce0) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-22kernel-yocto.bbclass: Reset to exiting on non-zero return code at end of taskStefan Wiehler
Several tasks deactivate exiting on non-zero return codes via set +e because they run subcommands that have legitimate non-zero return codes. However when appending to those tasks, this behavior is not expected and can lead to builds silently proceeding in case of an error. Therefore reset the default behavior at the end of the respective tasks via set -e. (From OE-Core rev: 7777cc853db7200b819095be6f6a3561738ac94d) Signed-off-by: Stefan Wiehler <stefan.wiehler@nokia.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 83a6f28d2e464f00202090e998a63045adba9e4e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11cve-check: add coverage statistics on recipes with/without CVEsMarta Rybczynska
Until now the CVE checker was giving information about CVEs found for a product (or more products) contained in a recipe. However, there was no easy way to find out which products or recipes have no CVEs. Having no reported CVEs might mean there are simply none, but can also mean a product name (CPE) mismatch. This patch adds CVE_CHECK_COVERAGE option enabling a new type of statistics. Then we use the new JSON format to report the information. The legacy text mode report does not contain it. This option is expected to help with an identification of recipes with mismatched CPEs, issues in the database and more. This work is based on [1], but adding the JSON format makes it easier to implement, without additional result files. [1] https://lists.openembedded.org/g/openembedded-core/message/159873 (From OE-Core rev: c63d06becc340270573bdef2630749db1f5230d4) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit d1849a1facd64fa0bcf8336a0ed5fbf71b2e3cb5) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11cve-check: write empty fragment files in the text modeMarta Rybczynska
In the cve-check text mode output, we didn't write fragment files if there are no CVEs (if CVE_CHECK_REPORT_PATCHED is 1), or no unpached CVEs otherwise. However, in a system after multiple builds, cve_check_write_rootfs_manifest might find older files and use them as current, what leads to incorrect reporting. Fix it by always writing a fragment file, even if empty. (From OE-Core rev: 4c10ee956f21ea2f805403704ac3c54b7f1be78c) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f1b7877acd0f6e3626faa57d9f89809cfcdfd0f1) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11cve-check: move update_symlinks to a libraryMarta Rybczynska
Move the function to a library, it could be useful in other places. (From OE-Core rev: c8a0e7ecee15985f7eed10ce9c86c48a77c5b7c5) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit debd37abcdde8788761ebdb4a05bc61f7394cbb8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-04cve-check: Allow warnings to be disabledRichard Purdie
When running CVE checks in CI we're usually not interested in warnings on the console for any CVEs present. Add a configuration option CVE_CHECK_SHOW_WARNINGS to allow this to be disabled (it is left enabled by default). (From OE-Core rev: d009233f36fb866f6bdaa12fb6deedf5e253e9c9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1054d3366ba528f2ad52585cf951e508958c5c68) Signed-off-by: Steve Sakoman <steve@sakoman.com> (cherry picked from commit 8fd6a9f521ea6b1e10c80fe33968943db30991ba) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-04cve-check: Only include installed packages for rootfs manifestErnst Sjöstrand
Before this the rootfs manifest and the summary were identical. We should separate the summary and rootfs manifest more clearly, now the summary is for all CVEs and the rootfs manifest is only for things in that image. This is even more useful if you build multiple images. (From OE-Core rev: 2bacd7cc67b2f624885ce9c9c9e48950b359387d) Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3b8cc6fc45f0ea5677729ee2b1819bdc7a441ab1) Signed-off-by: Steve Sakoman <steve@sakoman.com> (cherry picked from commit 65498411d73e8008d5550c2d0a1148f990717587) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-04cve-check: Add helper for symlink handlingErnst Sjöstrand
(From OE-Core rev: 8a178a728f2318c55d5ecaef0ef9e0fd8ebc333b) Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5046d54df2c3057be2afa4143a2833183fca0d67) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-04cve-check.bbclass: Added do_populate_sdk[recrdeptask].leimaohui
As product, sdk should do cve check as well as rootfs. (From OE-Core rev: df09cd71b4cd3f830fced9ce91aa202c1609bfc5) Signed-off-by: Lei Maohui <leimaohui@fujitsu.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit cc17753935c5f9e08aaa6c5886f059303147c07b) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-24cve-check: Fix report generationMarta Rybczynska
The addition of summary output caused two issues: error when building an image and the fact that JSON output was generated even when CVE_CHECK_FORMAT_JSON. When generating an image it caused an error like: ERROR: core-image-minimal-1.0-r0 do_rootfs: Error executing a python function in exec_func_python() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_func_python() autogenerated', lineno: 2, function: <module> 0001: *** 0002:cve_check_write_rootfs_manifest(d) 0003: File: '/home/alexk/poky/meta/classes/cve-check.bbclass', lineno: 213, function: cve_check_write_rootfs_manifest 0209: 0210: link_path = os.path.join(deploy_dir, "%s.json" % link_name) 0211: manifest_path = d.getVar("CVE_CHECK_MANIFEST_JSON") 0212: bb.note("Generating JSON CVE manifest") *** 0213: generate_json_report(json_summary_name, json_summary_link_name) 0214: bb.plain("Image CVE JSON report stored in: %s" % link_path) 0215:} 0216: 0217:ROOTFS_POSTPROCESS_COMMAND:prepend = "${@'cve_check_write_rootfs_manifest; ' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}" Exception: NameError: name 'json_summary_name' is not defined The fix is to pass the d variable to the pure python function generate_json_report to get correct values of variables and add conditions for the JSON output where needed. In addition clarify the message presenting the summary JSON file, which isn't related to an image. Uses partial fixes from Alex Kiernan, Ernst Sjöstrand (ernstp), and Davide Gardenal. Fixes: f2987891d315 ("cve-check: add JSON format to summary output") (From OE-Core rev: 665f981fccbb09d51349c4bd4cfe4ca91001e3bd) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9015dec93233c7d45fd0c9885ff5d4ec23ad377d) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-14base: Avoid circular references to our own scriptsRichard Purdie
We'd like to intercept git calls but we don't want circular references and HOSTTOOLS currently sets them up. Tweak to avoid them. (From OE-Core rev: 1567b7cec5ccbe198bfd0cca9ee8a2b1cf6dbf42) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 52c37e133fa55846aca2248ffcf3a10648dbb8d7) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-14rootfs-postcommands: fix symlinks where link and output path are equalDavide Gardenal
When creating the manifest and the testdata.json links, if the link name is equal to the output name the link is not created, otherwise it is. This prevents a link-to-self in the first case. (From OE-Core rev: e3672b5ccd6e0f130b1657017802db130a859d20) Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit bed63756c56f296ff3d5a7eef66e978bd19f1008) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-14cve-check: fix symlinks where link and output path are equalDavide Gardenal
An if statement now checks if the link and output path are the same, if they are then the link is not created, otherwise it is. (From OE-Core rev: 62965ca8ca7077c12d75dac37efe204d7159cddd) Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit 2f024c0236c4806f0e59e4ce51a42f6b80fdf1b3) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-14cve-check: add JSON format to summary outputDavide Gardenal
Create generate_json_report including all the code used to generate the JSON manifest file. Add to cve_save_summary_handler the ability to create the summary in JSON format. (From OE-Core rev: d8ef964ffeb92684d01d71c983af9dbb1e1b0c4f) Signed-off-by: Davide Gardenal <davide.gardenal@huawei.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit f2987891d315466b7ef180ecce81d15320ce8487) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-14cve-check: no need to depend on the fetch taskRoss Burton
The only part of the cve-check task which needs files is the patch examination, and typically these patches are local so fetch isn't needed. (From OE-Core rev: 72e5204bc7272414cc7bcfba18f52a177242ed79) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2c9b3186d3b7c18cbea239ab9b06e85b7c243b54) Signed-off-by: Steve Sakoman <steve@sakoman.com> (cherry picked from commit 3dc8edd6611e7ad4abcece44ca4701eda7aeff94) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-09base: Drop git interceptRichard Purdie
We're going to use the environment approach for solving this issue. (From OE-Core rev: a58a94e451bb62df70c60b5d7d27c0074b849e0e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0982977dc052ad4e65608f6853f930121d08837a) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-09install/devshell: Introduce git intercept script due to fakeroot issuesPaul Gortmaker
In a devshell, recent versions of git will complain if the repo is owned by someone other than the current UID - consider this example: ------ bitbake -c devshell linux-yocto [...] kernel-source#git branch fatal: unsafe repository ('/home/paul/poky/build-qemuarm64/tmp/work-shared/qemuarm64/kernel-source' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /home/paul/poky/build-qemuarm64/tmp/work-shared/qemuarm64/kernel-source kernel-source# ------ Of course the devshell has UID zero and the "real" UID is for "paul" in this case. And so recent git versions complain. As the whole purpose of the devshell is to invoke a shell where development can take place, having a non-functional git is clearly unacceptable. Richard suggested we could use PSEUDO_UNLOAD=1 to evade this issue, and I suggested we probably will see other similar instances like this and should make use of PATH to intercept via devshell wrappers - conveniently we already have examples of this. Here, we copy the existing "ar" example and tune it to the needs of git to combine Richard's suggestion and mine. As such we now also can store commit logs and use send-email with our user specific settings, instead of "root", so in additon to fixing basic commands like "git branch" it should also increase general usefulness. RP: Tweaked the patch so the PATH change only applies to the devshell task and is a generic git intercept rather than devshell specific. RP: Also apply the PATH change to do_install tasks since that also runs under fakeroot and several software projects inject "git describe" output into their binaries (systemd, iputils, llvm, ipt-gpu-tools at least) causing reproducibility issues from systems with different git versions. (From OE-Core rev: 0ff2cff2c1eac3fe6304644db0fc27ba3130c237) Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3266c327dfa186791e0f1e2ad63c6f5d39714814) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-03cve-check: add json formatMarta Rybczynska
Backport to dunfell from master df567de36ae5964bee433ebb97e8bf702034994a Add an option to output the CVE check in a JSON-based format. This format is easier to parse in software than the original text-based one and allows post-processing by other tools. Output formats are now handed by CVE_CHECK_FORMAT_TEXT and CVE_CHECK_FORMAT_JSON. The text format is enabled by default to maintain compatibility, while the JSON format is disabled by default. The JSON output format gets generated in a similar way to the text format with the exception of the manifest: appending to JSON arrays requires parsing the file. Because of that we first write JSON fragments and then assemble them in one pass at the end. (From OE-Core rev: 92b6011ab25fd36e2f8900a4db6883cdebc3cd3d) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-21metadata_scm.bbclass: Use immediate expansion for the METADATA_* variablesPeter Kjellerstedt
Define METADATA_BRANCH and METADATA_REVISION using immediate expansion. This avoids running `git rev-parse HEAD` multiple times during recipe parsing. (From OE-Core rev: f76fc325520386c0d25c6d6b422c85e9fb87e663) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 34e1841ec14c545c73fbe03a9f946d43d65ab326) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-21license_image.bbclass: close package.manifest fileMartin Jansa
* fixes: NOTE: Executing write_package_manifest ... DEBUG: Executing python function write_package_manifest /OE/build/oe-core/openembedded-core/meta/classes/license_image.bbclass:23: ResourceWarning: unclosed file <_io.TextIOWrapper name='/OE/build/oe-core/tmp-glibc/deploy/licenses/core-image-minimal-qemux86-64/package.manifest' mode='w+' encoding='UTF-8'> 'w+').write(output) ResourceWarning: Enable tracemalloc to get the object allocation traceback DEBUG: Python function write_package_manifest finished [YOCTO #14772] (From OE-Core rev: 3e88c663e65fbc1b2e77a8616af4371224ed0ca5) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b3114d5d438b7a63a276b4e825b62f3b1ebceed6) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-09mirrors: Add missing gitsm entries for yocto/oe mirrorsRichard Purdie
The missing gitsm:// mappings looks like an oversight, add them. (From OE-Core rev: f748360a854a5c80c8008ba6ac90546865651f10) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6600b9fca7888fb41647cd000b9efb7f0762dfde) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-23python3targetconfig: Use for nativesdk tooRichard Purdie
nativesdk is a cross compiled target and therefore should use the target config, not the native one. Copy the target entries accordingly. (From OE-Core rev: e997487c0068bfe4017fc98c4fa5b51f660a1b4e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b1b5fec350b390fa7f2d26966df1411b032faf87) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-11sstate: inside the threadedpool don't write to the shared localdataJose Quaresma
When inside the threadedpool we make a copy of the localdata to avoid some race condition, so we need to use this new localdata2 and stop write the shared localdata. (From OE-Core rev: 604146a242c3d5f5a9872bb756910f4bd1b58406) Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 90fe6948a9df0b43c58120a9358adb3da1ceb5b9) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-09uninative: Add version to uninative tarball nameRichard Purdie
uninative works via hashes and doesn't need the version in the tarball name but it does make things easier to inspect in DL_DIR. There were reasons such as ease of publication of the build tarballs but we can handle those differently now and the signature issues from the early code aren't an issue now. From 3.4 onwards we can use a version'd name. [YOCTO #12970] (From OE-Core rev: 0ec0e49d0d2a7478efbf20bc3554f0ffba40afa0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dadba70d6a24d8ebb5576598efffa973151c7218) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-09buildhistory.bbclass: create the buildhistory directory when neededJose Quaresma
When the BUILDHISTORY_RESET is enabled we need to move the content from BUILDHISTORY_DIR to BUILDHISTORY_OLD_DIR but when we start a clean build in the first run we don't have the BUILDHISTORY_DIR so the move of files will fail. | ERROR: Command execution failed: Traceback (most recent call last): | File "/xxx/poky/bitbake/lib/bb/command.py", line 110, in runAsyncCommand | commandmethod(self.cmds_async, self, options) | File "/xxx/poky/bitbake/lib/bb/command.py", line 564, in buildTargets | command.cooker.buildTargets(pkgs_to_build, task) | File "/xxx/poky/bitbake/lib/bb/cooker.py", line 1481, in buildTargets | bb.event.fire(bb.event.BuildStarted(buildname, ntargets), self.databuilder.mcdata[mc]) | File "/xxx/home/builder/src/base/poky/bitbake/lib/bb/event.py", line 214, in fire | fire_class_handlers(event, d) | File "/xxx/poky/bitbake/lib/bb/event.py", line 121, in fire_class_handlers | execute_handler(name, handler, event, d) | File "/xxx/poky/bitbake/lib/bb/event.py", line 93, in execute_handler | ret = handler(event) | File "/xxx/poky/meta/classes/buildhistory.bbclass", line 919, in buildhistory_eventhandler | entries = [ x for x in os.listdir(rootdir) if not x.startswith('.') ] | FileNotFoundError: [Errno 2] No such file or directory: '/xxx/buildhistory' (From OE-Core rev: de89dc125758f828a7886012bd9b1c8a1017ef48) Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 97bc2168da7dbacdfbf79cd70db674363ab84f6b) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-09cml1.bbclass: Handle ncurses-native being available via pkg-configNathan Rossi
The linux kernel will by default use pkg-config to get ncurses(w) paths, falling back to absolute path checks otherwise. If the build host does not have ncurses installed this will fail as pkg-config will not search the native sysroot for ncurses. To more all kernel/kconfig sources, inject the equivalent native pkg-config variables similar to what is done by the pkg-config-native script. This only affects the menuconfig python task itself and the oe_terminal call inside it. (cherry picked from commit abb95c421bb67d452691819e3f63dabd02e2ba37) (From OE-Core rev: dc6b20475a69c9fbab9a97a93119aeedf54deb23) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-09Revert "cve-check: add lockfile to task"Ross Burton
Now that all of the functions in cve-check open the database read-only, we can remove this lockfile. This means cve-check can run in parallal again, improving runtimes massively. This reverts commit d55fbf4779483d2cfd71df78d0f733b599fef739. (From OE-Core rev: 1a30a8513ca47890470ee9d19a5ea36437e664bf) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e60d149b41d14d177df20dbecaef943696df1586) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-09cve-check: get_cve_info should open the database read-onlyRoss Burton
All of the function in cve-check should open the database read-only, as the only writer is the fetch task in cve-update-db. However, get_cve_info() was failing to do this, which might be causing locking issues with sqlite. (From OE-Core rev: 2b3d13a451e99db669977d4d1172653b736ae6e1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 8de517238f1f418d9af1ce312d99de04ce2e26fc) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-23default-distrovars.inc: Switch connectivity check to a yoctoproject.org pageRichard Purdie
example.com is proving unreliable at present so switch to our own connectivity page instead. That page is very simple avoiding app overhead on our web server which was an original reason for switching to example.com. (From OE-Core rev: 0ed4759eb306596575e3e9859a023f44f814cf4c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dc6b043cb75c5751b5a98afd2201aa31f9b4b9f6) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-23cve-check: create directory of CVE_CHECK_MANIFEST before copyStefan Herbrechtsmeier
Create directory of the CVE_CHECK_MANIFEST variable before copy to it, so that the variable can use an arbitrary directory name. (From OE-Core rev: ee05539fc6fadff7f14c8609641021fc497cbd8e) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9829c16301bf2dce39fa046401a984f112fa0322) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-16sstate: A third fix for for touching files inside pseudoPeter Kjellerstedt
This continues where commit 676757f "sstate: fix touching files inside pseudo" and commit 29fc8599 "sstate: another fix for touching files inside pseudo" left off. The previous changes switched from trying to check if the sstate file is writable before touching it, to always touching the sstate file and ignoring any errors. However, if the sstate file is actually a symbolic link that links to nothing, this would actually result in an empty sstate file being created. And this in turn leads to that future setscene tasks will fail when they try to unpack the empty file. Change the code so that if an sstate file linking to nothing already exists, it is overwritten with the new sstate file. Also change it so that the temporary file that is used is always removed, even if ln fails to link the sstate file to it. Change-Id: I3800f98d0f2a0dd076352df85fad7c81460e733d (From OE-Core rev: f3cd092bf9f66d8d73075e5b777d89d8598691dd) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-22cve-check: add lockfile to taskKonrad Weihmann
this should prevent running into the very rare error sqlite3.OperationalError: attempt to write a readonly database As highlighted by https://www.sqlite.org/faq.html#q5 it is likely that the adapter won't allow use multiple exec calls at the same time. So it's best to prevent multiple accesses at a time, by reusing the already in place CVE_CHECK_DB_FILE_LOCK YOCTO #14110 (From OE-Core rev: 3c69e4eb08701516150c78cf8b48f3e90d197b2b) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 677f5741bd265be49d4a5bb933b3e8d8c4eec653) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-22cve-update-db-native: use fetch taskRoss Burton
Instead of inventing a new task to fetch the CVE data, use the existing fetch task. (From OE-Core rev: 1ed53d5cfc2be40b2d57b5392ec4d30313209934) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f5f97d33a1703d75b9fd9760f2c7767081538e00) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-08buildhistory: Fix srcrevs outputRichard Purdie
The code was assuming that the a recipe with only one srcrev wouldn't "name" it. This isn't the case as the glibc or bzip2 recipes show, you can have a single srcrev which is named. We can pull the data from the fetcher and in fact we already have it, we just need to handle the "default" case and make that code the default for all srcrev regardless of length. [YOCTO #14017] (From OE-Core rev: 9a7ea10660d0efd87e8cadf866e6dbed112b7f94) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 45ae567932ba52b758eb41754453e9828d9533a1) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>