summaryrefslogtreecommitdiffstats
path: root/meta/classes
Commit message (Collapse)AuthorAgeFilesLines
* populate_sdk_ext: Fix to use python3, not pythonRichard Purdie2020-09-161-1/+1
| | | | | | | | | | | We should be using python3 here, it was missed in the conversion. Spotted on autobuilder tests failing on systems with python missing. (From OE-Core rev: db07b09196022078346aadd565760240b7da6a71) (From OE-Core rev: 2ce4dd53443e86c707280716bfe23572eff58abb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* populate_sdk_ext: We now require python3, not pythonRichard Purdie2020-09-161-2/+2
| | | | | | | | | | | | We no longer expect a "python" binary in PATH so update the eSDK's expectations to match. This was the only failure on autobuilder test systems with python missing. (From OE-Core rev: 946ce21b10dcad506edcaadb4e4242c049e4c316) (From OE-Core rev: 775336424bcc7c083e2ac6ccd3db0b16e87dc29a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: fetch CVE data once at a time instead of in a single callRoss Burton2019-12-161-10/+10
| | | | | | | | | | | | | | | | | | | | | This code used to construct a single SQL statement that fetched the NVD data for every CVE requested. For recipes such as the kernel where there are over 2000 CVEs to report this can hit the variable count limit and the query fails with "sqlite3.OperationalError: too many SQL variables". The default limit is 999 variables, but some distributions such as Debian set the default to 250000. As the NVD table has an index on the ID column, whilst requesting the data CVE-by-CVE is five times slower when working with 2000 CVEs the absolute time different is insignificant: 0.05s verses 0.01s on my machine. (From OE-Core rev: 53d0cc1e9b7190fa66d7ff1c59518f91b0128d99) (From OE-Core rev: b52d6340acdad27d41caf057b78f181297a9a75e) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: neaten get_cve_infoRoss Burton2019-12-161-13/+5
| | | | | | | | | | | | | Remove obsolete Python 2 code, and use convenience methods for neatness. (From OE-Core rev: f19253cc9e70c974a8e21a142086c13d7cde04ff) (From OE-Core rev: 1f3863bc31e03207856f55591cbf17543e188587) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: rewrite look to fix false negativesRoss Burton2019-12-161-29/+34
| | | | | | | | | | | | | | | | | | | A previous optimisation was premature and resulted in false-negatives in the report. Rewrite the checking algorithm to first get the list of potential CVEs by vendor:product, then iterate through every matching CPE for that CVE to determine if the bounds match or not. By doing this in two stages we can know if we've checked every CPE, instead of accidentally breaking out of the scan too early. (From OE-Core rev: d61aff9e22704ad69df1f7ab0f8784f4e7cc0c69) (From OE-Core rev: 541dc24d974d3e22c45a650c34298eebc45121e8) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: we don't actually need to unpack to checkRoss Burton2019-12-161-2/+1
| | | | | | | | | | | | | | The patch scanner works with patch files in the layer, not in the workdir, so it doesn't need to unpack. (From OE-Core rev: 2cba6ada970deb5156e1ba0182f4f372851e3c17) (From OE-Core rev: cbb5d26d88465c95a4a879f8635253259e8df0f0) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: failure to parse versions should be more visibleRoss Burton2019-12-161-2/+2
| | | | | | | | (From OE-Core rev: 72f44bef3867295f73f8b91e17294b2876447c89) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: ensure all known CVEs are in the reportRoss Burton2019-12-161-2/+7
| | | | | | | | | | | | | | | CVEs that are whitelisted or were not vulnerable when there are version comparisons were not included in the report, so alter the logic to ensure that all relevant CVEs are in the report for completeness. (From OE-Core rev: 98256ff05fcfe9d5ccad360582c36eafb577c264) (From OE-Core rev: 9d01a64844998d98fcfcebbe8580422094cd2dde) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: backport rewrite from masterRoss Burton2019-12-161-55/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As detailed at [1] the XML feeds provided by NIST are being discontinued on October 9th 2019. As cve-check-tool uses these feeds, cve-check.bbclass will be inoperable after this date. To ensure that cve-check continues working, backport the following commits from master to move away from the unmaintained cve-check-tool to our own Python code that fetches the JSON: 546d14135c5 cve-update-db: New recipe to update CVE database bc144b028f6 cve-check: Remove dependency to cve-check-tool-native 7f62a20b32a cve-check: Manage CVE_PRODUCT with more than one name 3bf63bc6084 cve-check: Consider CVE that affects versions with less than operator c0eabd30d7b cve-update-db: Use std library instead of urllib3 27eb839ee65 cve-check: be idiomatic 09be21f4d17 cve-update-db: Manage proxy if needed. 975793e3825 cve-update-db: do_populate_cve_db depends on do_fetch 0325dd72714 cve-update-db: Catch request.urlopen errors. 4078da92b49 cve-check: Depends on cve-update-db-native f7676e9a38d cve-update-db: Use NVD CPE data to populate PRODUCTS table bc0195be1b1 cve-check: Update unpatched CVE matching c807c2a6409 cve-update-db-native: Skip recipe when cve-check class is not loaded. 07bb8b25e17 cve-check: remove redundant readline CVE whitelisting 5388ed6d137 cve-check-tool: remove 270ac00cb43 cve-check.bbclass: initialize to_append e6bf9000987 cve-check: allow comparison of Vendor as well as Product 91770338f76 cve-update-db-native: use SQL placeholders instead of format strings 7069302a4cc cve-check: Replace CVE_CHECK_CVE_WHITELIST by CVE_CHECK_WHITELIST 78de2cb39d7 cve-update-db-native: Remove hash column from database. 4b301030cf9 cve-update-db-native: use os.path.join instead of + f0d822fad2a cve-update-db: actually inherit native b309840b6aa cve-update-db-native: use executemany() to optimise CPE insertion bb4e53af33d cve-update-db-native: improve metadata parsing 94227459792 cve-update-db-native: clean up JSON fetching 95438d52b73 cve-update-db-native: fix https proxy issues 1f9a963b9ff glibc: exclude child recipes from CVE scanning [1] https://nvd.nist.gov/General/News/XML-Vulnerability-Feed-Retirement (From OE-Core rev: 8c87e78547c598cada1bce92e7b25d85b994e2eb) (From OE-Core rev: beeed02f9831e75c3f773e44d7efc726f1ff859c) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel.bbclass: fix installation of modules signing certificatesDmitry Eremin-Solenikov2019-10-151-1/+1
| | | | | | | | | | | | | | | | If one has provided external key/certificate for modules signing, Kbuild will skip creating signing_key.pem and will write only signing_key.x509 certificate. Thus we have to check for .x509 file existence rather than .pem one. (From OE-Core rev: 4972582767a3325d22a16db9a5479c2d0001964b) Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2527e731eba43bd36d0ea268aca6b03155376134) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-sign.bbclass: Remove tab indentations in python codeRobert Yang2019-07-271-10/+10
| | | | | | | | | | | Use 4 spaces to replace a tab. (From OE-Core rev: 2bf6098ac1cbbf7ed28522b7f7dce84c8341ce00) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uninative: Switch from bz2 to xzRichard Purdie2019-07-271-2/+2
| | | | | | | | | | (From OE-Core rev: 29fc9210b973be68de474e75068e4c72371afe5a) (From OE-Core rev: 16785ebdc50f38ef4bc30d477a6833bdd4b541d1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/runner: dump stdout and stderr of each test caseMardegan, Alberto2019-05-221-1/+2
| | | | | | | | | | | | | | | | | | | | Some CI pipelines might perform further processing of the test output (for instance, to plot some metrics into a chart). However, Since `thud` we switched away from the XML-based jUnit reporting, and at the same time we lost the ability of collecting the stdout and stderr of the various tests. We now restore this functionality by adding `stdout` and `stderr` keys to the JSON reports. This behavior is off by default; in order to enable it, one must set the `TESTREPORT_FULLLOGS` variable in the bitbake configuration. (From OE-Core rev: 68919826fe4d4db4582223569c5a939a9c2f9c72) Signed-off-by: Alberto Mardegan <amardegan@luxoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types.bbclass: fix a race between the ubi and ubifs FSTYPESHongxu Jia2019-05-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ubi, ubifs and multiubi FSTYPES calls `mkfs.ubifs' to create UBIFS images. In do_image_ubi, $vname is empty, the name of UBIFS image conflicts with the one in do_image_ubifs, and it's a race risk. [do_image_ubi] mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs ${mkubifs_args} [do_image_ubi] [do_image_ubifs] mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ubifs ${MKUBIFS_ARGS} [do_image_ubifs] In do_image_multiubi, $vname is not empty, the UBIFS image name does not conflict with others. So do not call mkfs.ubifs in do_image_ubi and depend on do_image_ubifs to create UBIFS images. The fix does not affect do_image_multiubi which still call mkfs.ubifs to create multiple UBIFS images and symlinks. [YOCTO #13272] (From OE-Core rev: 5e900f2c9319843c8905713dd3dd12a1ad435976) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rm_work: sort the value of do_build dependenciesMing Liu2019-03-241-2/+1
| | | | | | | | | | | | | | This fixes some 'basehash changed' errors when rm_work is being inherited. (From OE-Core rev: e74158b6cc1d683ab14ef5d47ec531f986fc2259) (From OE-Core rev: 8aed35802270345844239406266be37d66ba86c7) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel: Ensure an initramfs is added if configuredRichard Purdie2019-03-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | If ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.cpio does not exist, nor any of the compressed variants, nothing is copied to kernel build's ./usr directory. The code does not fail, but silently proceeds without a bundled initramfs. Change to fail and tell the user something is wrong. Also, if an initramfs is found, contrary to the comments, it does not stop at the first uncompressed/compressed cpio image found. Instead it keeps processing all so the last is used. Fix this to behave as per the comments. [YOCTO #12909] (Patch by Leon Woestenberg) (From OE-Core rev: 5b5604e288af755eb5553a97d26533445b2cf94b) (From OE-Core rev: 378f720090508d5c8c04f1b0265ba729f6ce827b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package: Add pkg_postinst_ontarget to PACKAGEVARSRichard Purdie2019-02-251-1/+1
| | | | | | | | | | | | | | Changes to pkg_postinst_ontarget were not triggering rebuilds, this fixes that. [YOCTO #13127] (From OE-Core rev: f3e2f78f282bf3a68a4923009825eb4fb460ca50) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar calls (again)André Draszik2019-02-064-6/+6
| | | | | | | | | | | | | | | | | | | | A couple have still been missed in the past despite multiple attempts at doing so (or simply have re-appeared?). Search & replace made using the following command: sed -e 's|\(d\.getVar \?\)( \?\([^,()]*\), \?True)|\1(\2)|g' \ -i $(git grep -E 'getVar ?\( ?([^,()]*), ?True\)' \ | cut -d':' -f1 \ | sort -u) (From OE-Core rev: 9f551d588693328e4d99d33be94f26684eafcaba) (From OE-Core rev: 2da88ecbbf118bb7440f48184d4b39c273ab57e9) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel.bbclass: Fix incorrect deploying of fitimage.initramfsManjukumar Matha2019-02-061-0/+3
| | | | | | | | | | | | | | | | | | | | | When kernel-fitimage and initramfs is enabled using INITRAMFS_IMAGE_BUNDLE = "1", kernel do_deploy tries to deploy fitImage.initramfs with following error | install: cannot stat 'arch/arm64/boot/fitImage.initramfs': No such file or directory Skip deploying fitimage.initramfs, since fitimage does not create fitimage.initramfs (From OE-Core rev: 0f87f8522a2c1b5a7042738887952b98060fbd9d) (From OE-Core rev: e35ced70ff3d9be4a94773df4f4558c677dcd9af) Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/testsdk: Split implementation into classesJoshua Watt2019-02-061-202/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Splits the SDK test implementation into configurable Python classes. The classes used for the normal and extensible SDKs are ${TESTSDK_CLASS_NAME} and ${TESTSDKEXT_CLASS_NAME} respectively. This allows SDK machines to override the classes used to implement the tests. For the traditional SDK, a common "run()" function is provided by the class (oeqa.sdk.testsdk.TestSDK), with several hook member functions that can be overridden in child classes, making it easier to have consistent behavior. The extensible SDK class (oeqa.sdkext.testsdk.TestSDKEXT) also has a common "run()" function, but no hooks have yet been added as there is not currently a known use case for create derived classes. These changes should be purely organizational; no functional changes have been made to either the standard SDK or extensible SDK tests. [YOCTO #13020] (From OE-Core rev: a06d53928b22d5f88276023c4d57b206db2f27f9) (From OE-Core rev: d0828522fc3a4bd3f86488edcedcce10833c18dc) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: make it work for multiple usersRobert Yang2019-02-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | There are failures when multiple users run oe-selftest on the same host: PermissionError: [Errno 13] Permission denied: '/tmp/oe-saved- tests/201812250324_qemu' This is because /tmp/oe-saved-tests was created by user A, while user B tries to write data in it, then the error will happen. This patch can fix the problem. Move the dumped data to ${LOG_DIR}/runtime-hostdump/ rather than /tmp/oe-saved-tests/ to fix the problem. (From OE-Core rev: e219fe5329599cd6c3682f521eaee3852a2c8980) (From OE-Core rev: 310a2b137f2cb249885844fa12830365f94866f0) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/classes/testimage.bbclass: Only validate IMAGE_FSTYPES when is QEMUAníbal Limón2019-02-061-6/+7
| | | | | | | | | | | | | | | | | When use simpleremote target the flash/boot process is executed manually, the IMAGE_FSTYPES validation is only needed when execute testimage against qemu. The supported_fstypes comes from oeqa.core.target.qemu module. (From OE-Core rev: e7dc5963adbacc091fe8943119262166977623ad) (From OE-Core rev: 5fedb011f9b2d4f6d14757a7cc9c2d8300fa0223) Signed-off-by: Aníbal Limón <anibal.limon@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage.bbclass: remove boot parameter systemd.log_targetKai Kang2019-02-061-7/+1
| | | | | | | | | | | | | | | | | | | | | | | Boot parameter systemd.log_target=console affects command journalctl's output and causes oe selftest case test_systemd_boot_time fail to pass. | Error at obtaining the boot time from journalctl | RESULTS: | RESULTS - systemd.SystemdJournalTests.test_systemd_boot_time - Testcase -1: SKIPPED (0.74s) systemd.log_target=console was introduced by oe-core commit a0bb649 and work with parameter systemd.log_level to enable systemd debug. systemd.log_level has been removed already, so remove systemd.log_target too to make case test_systemd_boot_time pass. (From OE-Core rev: caa776bdcf8ea34c857f45970370bf771075f4bc) (From OE-Core rev: 51423c3945d55ebabe38dd365d24f226155c1a97) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Add possibility to pass parmeters to qemuErik Botö2019-02-061-1/+4
| | | | | | | | | | | | | | | Add a variable called TEST_QEMUPARAMS in testimage.bbclass to make it possible to pass parameters to qemu. This can be useful for e.g. increasing the amount of RAM available during testimage runs. (From OE-Core rev: 1a9163f5779d233c884c8fd50e0812eabab4fdf3) (From OE-Core rev: 0469c757e4a48d8ca2e2b7b128a285cf6d50513e) Signed-off-by: Erik Botö <erik.boto@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Add support for slirpYeoh Ee Peng2019-02-061-0/+5
| | | | | | | | | | | | | | | | Enable testimage to support qemu slirp. Configure "QEMU_USE_SLIRP" & "TEST_SERVER_IP" variables to enable slirp. [YOCTO#10713] (From OE-Core rev: 3df9ee85ce7fe52f0893fd33aea3bf1fcc6ead0a) (From OE-Core rev: ab4989123d8a6c2dc8e058110c495320955bf0de) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Enable autorunning of the package manager testsuitesRichard Purdie2019-02-061-3/+1
| | | | | | | | | | | | | Now that the hangs in httpservice are fixed we can let these tests auto skip as appropriate. (From OE-Core rev: 42a0d70291d551578e21f590fcb85ca72a78ccb5) (From OE-Core rev: 1da4c2e18e0897b3dc24d0d54b5d949bec39c990) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Further cleanup DEFAULT_TEST_SUITESRichard Purdie2019-02-061-3/+1
| | | | | | | | | | | | | Now the test markup of the development tools tests is complete, this can be further tweaked to auto run the correct tests. (From OE-Core rev: bd4f8d12fe1f9f2643ee9e68fa2bb981134294fb) (From OE-Core rev: 7dce3564534ee67c88feaa14304dbee7161df145) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Simplfy DEFAULT_TEST_SUITES logicRichard Purdie2019-02-061-23/+9
| | | | | | | | | | | | | | | | | | | | | | | | Now that the tests have correct markup to automatically determine which images they can run against, clean up the default test suites logic to be simpler and not image specific. Some cleanup of the compiler tests still needs to be completed but this is a good first step. The only downside to this is more noise during testing as we now see many skipped messages for simple images like core-image-minimal. The auto type is being removed since it currently breaks badly due to the socat mandatory inclusion from the meta-selftest layer which is a problem which needs to be addressed seperately. (From OE-Core rev: 4966bc33845752eb0aeae54b72e8ba0146a7ed52) (From OE-Core rev: 16c9002d5b4ab091f49a7bec2527d2a21830ab0c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Remove duplicate dependenciesRichard Purdie2019-02-061-3/+1
| | | | | | | | | | (From OE-Core rev: 16d4368e7b85d5179374adb0a2d1ac215793e104) (From OE-Core rev: bfd72574aa1ef035ecafef3cfde9ac5f8801b93c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Correctly markup regex stringsRichard Purdie2019-02-065-19/+19
| | | | | | | | | | | | | There are various escape characters in these stings which python warns about so use the correct regex markup for them. (From OE-Core rev: 252b69c9f2abe3258366c540f56b156ed63e5437) (From OE-Core rev: 778f33d40c7e2f4174cc99d25516e5db63d6f75b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel: don't assign the build user/hostFederico Sauter2019-02-061-2/+2
| | | | | | | | | | | | | | | | | | The KBUILD_BUILD_USER and KBUILD_BUILD_HOST variables were assigned at the kernel class level, which made it impossible to override them in the local configuration. By setting only the default values of those variables in the kernel class, it is now possible to override them as expected. (From OE-Core rev: a3e8cdf9c3ba966fa4b5a21235540eb0b00fb487) (From OE-Core rev: 694d62ece58ba996a63a7089bbeb445efe922419) Signed-off-by: Federico Sauter <federico.sauter@ableton.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patch: reproducibility: Fix host umask leakageDouglas Royds2019-02-061-0/+1
| | | | | | | | | | | | | | | | | | | | | Some patch files create entirely new files, so their permissions are subject to the host umask. If such a file is later installed into a package with no change in permissions, it breaks the reproducibility of the package. This was observed on libpam, for instance: The patch file pam-security-abstract-securetty-handling.patch creates a new file (tty_secure.c). This file is later copied into the -dbg package with no change in permissions. (From OE-Core rev: 2a2bbd755b330cd63f7f6e2f2b374a3ae065b37a) (From OE-Core rev: 9841962b5bfdaaeed31f79573f6fbd9d1d56dd17) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* toolchain-scripts: run post-relocate scripts for every environmentRoss Burton2019-02-061-23/+23
| | | | | | | | | | | | | | | SDKs for multilib configurations have multiple environment scripts, so re-arrange the post-relocate hook invocation so that it runs the post-relocate hooks after sourcing each environment script. (From OE-Core rev: c4897001cb3eeda1f4f11197b28c09c950bdcf02) (From OE-Core rev: 2bb4774e6d873400e8a084e554a563925cf1c9b5) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package.bbclass: fix python unclosed file ResourceWarningChen Qi2019-02-061-1/+2
| | | | | | | | | | | | | | | | Fix the following warning. ResourceWarning: unclosed file <_io.TextIOWrapper name='/.../systemd/1_239-r0/debugsources.list' mode='a' encoding='UTF-8'> (From OE-Core rev: 91810a57f0edd8b37c5f3f989a5aca69d9a40b37) (From OE-Core rev: 284252d1b6d1672a5b6c042fa591f00d89613a22) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: add support for caching shared workdir tasksMichael Ho2019-02-061-0/+6
| | | | | | | | | | | | | | | | | | | | | The sstate bbclass uses workdir as a hardcoded string in path manipulations. This means that the sstate caching mechanism does not work for the work-shared directory which the kernel uses to share its build configuration and source files for out of tree kernel modules. This commit modifies the path manipulation mechanism to use the work-shared directory if detected in the paths when handling the sstate cache packages. (From OE-Core rev: 27642449f95e38598f9c83948ce109c5891e5877) (From OE-Core rev: f57d83c72b5f53fb10bc8377862668580d331a8c) Signed-off-by: Michael Ho <Michael.Ho@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Fix for QEMU_USE_KVMRobert Yang2019-02-061-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixed: MACHINE = "qemux86" QEMU_USE_KVM = "qemux86" IMAGE_CLASSES += "testimage" $ oe-selftest -r runqemu.RunqemuTests.test_boot_rootfs [snip] File "/buildarea1/lyang1/poky/meta/lib/oe/types.py", line 122, in boolean raise ValueError("Invalid boolean value '%s'" % value) ValueError: Invalid boolean value 'qemux86' Now QEMU_USE_KVM can only be boolean, can not contain MACHINE any more, kvm will be enabled if target_arch == build_arch or both of them are x86 archs. (From OE-Core rev: 7c1a8a624cad8d967635c6cb5f99cf655bde3d44) (From OE-Core rev: 2c12e1d9c262fb7e5fe02ae2d092789d6536413f) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* icecc: patchelf is needed by icecc-create-envDouglas Royds2019-02-061-1/+5
| | | | | | | | | | | | | | | Although we could potentially build patchelf and all its dependencies, they would all have to be blacklisted to avoid trying to build them with icecc. We use the host patchelf instead. (From OE-Core rev: 0860216a81092fba084d29696db6d0c65a226c85) (From OE-Core rev: 9d3587dda0e068efb72a89fd94002f13882fe335) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* icecc: Don't generate recipe-sysroot symlinks at recipe-parsing timeDouglas Royds2019-02-061-37/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The python function icecc_path() was being invoked inline by set_icecc_env(), meaning that it was being invoked at recipe-parsing time. As a side-effect, icecc_path() was creating the recipe-sysroot directory and symlinking icecc into it. Because this was done at parsing time (rather than configure time), we were generating otherwise-empty WORKDIRs for *all* parsed recipes, and for all virtual classes (-native, -nativesdk). In my build, this generated more than 800 of these otherwise-empty WORKDIRs. I have simplified icecc_path() to return only the intended path to the icecc symlinks in the recipe-sysroot, with no side-effect. We then create the directory and the icecc symlinks at configure time. Because get_cross_kernel_cc() is still invoked at parse-time, it needs a guard-clause for the non-kernel case. We are now finding the host icecc at do_configure time, so icecc needs to be in the HOSTTOOLS. I have made this non-fatal, so that we can still inherit icecc without icecc installed. (From OE-Core rev: d2fcaeb153fdc3f8d7143ea823139f1537055ff1) (From OE-Core rev: 46db052def5c4fa0de7943262092582c8d897117) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* icecc: Syntax error meant that we weren't waiting for tarball generationDouglas Royds2019-02-061-1/+1
| | | | | | | | | | | | | | | | If two bitbake processes try to generate the ICECC_VERSION tarball at the same time, the thread that fails to get the lock will wait 30 sec for the first to finish. A syntax error meant that this was not happening, and in particular, if tarball generation failed (eg. for lack of patchelf), it did so silently. (From OE-Core rev: 4455c46bf7f49c2b44f250aa89b63b342368e2e3) (From OE-Core rev: d4ec47005d29e30b31bc61fe126b385e9e781228) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* icecc: Trivial simplificationDouglas Royds2019-02-061-1/+1
| | | | | | | | | | | (From OE-Core rev: fa6bae80bc3392bf99ce53bbe19a0e05dbd0c4ee) (From OE-Core rev: 57673fe89a9c597d7e1d657a0710f3c60df3c28d) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* icecc: readlink -f on the recipe-sysroot gcc/g++Douglas Royds2019-02-061-1/+1
| | | | | | | | | | | | | We were accidentally doing a readlink -f on simply 'gcc', for instance (From OE-Core rev: 6d6788a3ea45d9693743d9b3319fb0368a4d5d33) (From OE-Core rev: 193eb75f21daa131b53358a4a1bf63028fe2a28c) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel: use olddefconfig as the primary target for KERNEL_CONFIG_COMMANDBruce Ashfield2019-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | As was warned by commit 312ee68752fa [kconfig: announce removal of oldnoconfig if used], oldnoconfig has been removed from the 4.20 kernel. So we switch our default mode to olddefconfig. commit fb16d8912 [kconfig: replace 'oldnoconfig' with 'olddefconfig', and keep the old name as an alias] introduced olddefconfig in the 3.10 kernel, we shuffle oldnoconfig to the fallback target. The fallback mode allows kernels between 3.10 and the currently listed oldest kernel of 3.2 to continue to configure. (From OE-Core rev: 8593dcb7e8c938530ff00ffedf7f3d02d26c3bad) (From OE-Core rev: 0bbe3d579e4363a0ee34a9490dbf10f2a7a6736c) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* populate_sdk_ext.bbclass: Include site.conf in parsing for contents for ↵Khem Raj2019-01-081-0/+5
| | | | | | | | | | | | | | | | | local.conf Some distros use site.conf to emit certain variables which are important for eSDK e.g. DISTRO with out which eSDK will not be able to ger right metadata when it tries to build (From OE-Core rev: 95659bed3f6f3216b346f70cfc9ffae9788c0fc1) (From OE-Core rev: d2f802b656dea7f9c227bd86db35e02c33f69021) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/icecc.bbclass: Fix ccache disableJoshua Watt2019-01-081-1/+1
| | | | | | | | | | | | | | The ccache disable flag was misspelled, preventing it from being disabled. (From OE-Core rev: 33fba601a7365aced9f4b206c1fadda997076d4c) (From OE-Core rev: aefa930d9cfcdc32ba9411311f269e005e5372e0) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Clarify GNU_HASH warningRoss Burton2019-01-081-1/+1
| | | | | | | | | | | | | | | We have a fatal error if ELF objects don't have GNU_HASH segments but it doesn't explain what the problem is. At least give a hint to users by suggesting that LDFLAGS wasn't passed to the compiler. (From OE-Core rev: 5d4da6713b40e10e853eb746f700096307ffe158) (From OE-Core rev: a0ac85826aeee633e01d00d7a1f188724a2937f0) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* binconfig: only try to mangles filesRoss Burton2019-01-081-3/+3
| | | | | | | | | | | | | | If a file matches the glob that is an absolute symlink then sed will try to alter files on the host, so restrict the search to just actual files. (From OE-Core rev: 5556b5ca9efac132754bd82af52a0f68bc4ce85a) (From OE-Core rev: 3d148218387e968dbf2d3d587329b37d22d7d19e) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* libc-package: fix postinst error when ENABLE_BINARY_LOCALE_GENERATION = "0"Alexander Kanavin2019-01-081-8/+2
| | | | | | | | | | | | | [YOCTO #13028] (From OE-Core rev: f630da64b010795482e013362c3fe184dcbd8d25) (From OE-Core rev: 29759c2c3b4d97c835740a7f233b8e8f7b4570a1) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: use cpio-native to build cpio imagesRoss Burton2019-01-081-0/+1
| | | | | | | | | | | | | | | | | | | | | As per the previous commit, upstream cpio has a bug which means it crashes on append. If the image being built has already had testimage ran then cpio-native will be in the sysroot. It's also possible that some distributions are shipping this broken CVE patch too. Now that our cpio-native is fixed, until we can be sure that the host cpio isn't broken depend on cpio-native if building a cpio image. [ YOCTO #13042 ] (From OE-Core rev: c3b9aedcbe538d7fa74bd814644b4899769dec46) (From OE-Core rev: a75eba71145efa1c3d206c5e5c00608a50f013bc) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* multilib_script: fix packages splitKai Kang2019-01-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | In multilib_script.bbclass it renames script file which listed in MULTILIB_SCRIPTS. It may mix up packages split. Take package curl as example, ${bindir}/curl-config is packaged to curl-dev originally. But it is renamed to curl-config-${MULTILIB_SUFFIX} and packaged to curl when multilib is enabled. And expand 'pkg' to fix QA warning: | WARNING: Variable key FILES_${PN}-dev ( | ${bindir}/curl-config-${MULTILIB_SUFFIX}) replaces original key | FILES_curl-dev (${includedir} ${FILES_SOLIBSDEV} ... ${bindir}/*-config) Insert a necessary space to the argument 'value' of d.appendVar() as well. (From OE-Core rev: 841bcbe429dcab54de3b89a927394750f9ccae60) (From OE-Core rev: de222b08fbcc46f60da811a5542d20a9346c32df) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* archiver.bbclass: Fix COPYLEFT_LICENSE_{IN, EX}CLUDEAdrian Bunk2019-01-081-3/+0
| | | | | | | | | | | | | | Setting them to empty before inheriting copyleft_filter made them not getting their documented values there. (From OE-Core rev: ee1f86ca7affc65265f219f0718f89406c9181a5) (From OE-Core rev: b5586a83155e07b0c7a7e82568c18f5e29eaaed2) Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>