summaryrefslogtreecommitdiffstats
path: root/meta/classes
Commit message (Collapse)AuthorAgeFilesLines
...
* rootfs-postcommands: Improve/fix rootfs_check_host_user_contaminatedRichard Purdie2020-07-071-4/+8
| | | | | | | | | | | | | | | | | | Currently if the find command finds /home it stops checking the other files. Tweak the find expression to fix this. Also, from Alex Kiernan <alex.kiernan@gmail.com>, generate output for each contaminated path so it's visible in the main log file. When matches are found, dump the data from the group and passwd files so useful debugging can be done based on the results. (From OE-Core rev: 602162c0e33b429b8254de04af72a2aa5111867a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 504f1d158bf7c6ad08fbce755021db2b14565231) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* gtk-icon-cache.bbclass: add runtime dependencyChangqing Li2020-07-071-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | fix error: + /usr/lib/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache /var/tmp/rpm-tmp.mdYxY6: line 12: /usr/lib/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders: No such file or directory %post(adwaita-icon-theme-3.36.1-r0.0.noarch): waitpid(2961) rc 2961 status 7f00 warning: %post(adwaita-icon-theme-3.36.1-r0.0.noarch) scriptlet failed, exit status 127 when install adwaita-icon-theme on target, which inherit gtk-icon-cache above error reported, fix by add runtime dependency to pkgs we don't use explicit RDEPENDS, so fix do_rootfs breaking by adding it into DEPENDS. Error: Problem: conflicting requests - nothing provides gdk-pixbuf needed by adwaita-icon-theme-3.36.1-r0.noarch - nothing provides gtk+3 needed by adwaita-icon-theme-3.36.1-r0.noarch (From OE-Core rev: e921edd27e71af00f07e3f1e973d2b0c6c777bf4) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 31e3d34c8a9c3e8481aa837aa0bf52adf095fe62) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* populate_sdk_ext: Fix to use python3, not pythonRichard Purdie2020-07-021-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: 1373006c28541e8fd6ceb6d5ed905ff1536ef3f7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit db07b09196022078346aadd565760240b7da6a71) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel.bbclass: Fix Module.symvers supportLili Li2020-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | Starting from v5.8-rc1 commit 269a535ca931 (modpost: generate vmlinux.symvers and reuse it for the second modpost"), kernel will generate new vmlinux.symvers instead of dumping all the vmlinux symbols into Module.symvers in the first pass. Error log: 'run.do_shared_workdir.16614' failed with exit code 1: DEBUG: cp: cannot stat 'Module.symvers': No such file or directory This change will check the file Module.symvers existence before copying it. (From OE-Core rev: e96d99824f085644162fe0599988a3408eab90f8) Signed-off-by: Lili Li <lili.li@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cd2d62a08a1dfcd890a03ee55132b6d6c65f5ab7) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: enable ovmf supportKonrad Weihmann2020-07-021-1/+5
| | | | | | | | | | | | | Add support for running wic images with EFI as testimage. Introduces a variable called QEMU_USE_OVMF for configuration. (From OE-Core rev: 458a860b45c0fb5bb3162b5a112b518c3339c1dd) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3af8aaff68ed332d812ea7dc184d392700ad7882) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: add QB_ROOTFS_EXTRA_OPT parameterKonrad Weihmann2020-07-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Content of the optional parameter will be appended to the rootfs-device in the qemu configuration, in case QB_ROOTFS_OPT is not specified. By default this is empty. Example use cases are: Defining 'readonly' when using squashfs, so multiple instances of qemu can share the same base image, something that cannot be done by just specifying 'snapshot'. Defining 'bootindex=0' which helps to get past the EFI shell in ovmf-binary. This also enables the use case of running WIC images with EFI bootloader through the testimage.bbclass. (From OE-Core rev: 1a5cb1bd56be2b784208516a7c73c49906c7022f) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e9b8c194636cb5505774a2a71bf54450580dd5b8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mime.bbclass: fix post install scriptlet errorChangqing Li2020-07-021-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fix error during post uninstall: %postun(shared-mime-info-data-2.0-r0.4.corei7_64): execv(/bin/sh) pid 78 + '[' 0 = 0 ']' + set -e + '[' x '!=' x ']' + echo 'Updating MIME database... this may take a while.' Updating MIME database... this may take a while. + update-mime-database /usr/share/mime Directory '/usr/share/mime/packages' does not exist! %postun(shared-mime-info-data-2.0-r0.4.corei7_64): waitpid(78) rc 78 status 100 warning: %postun(shared-mime-info-data-2.0-r0.4.corei7_64) scriptlet failed, exit status 1 when run post uninstall scriptlet, /usr/share/mime/packages has been removed during unintall, while update-mime-database will check xml under /usr/share/mime/packages. workaround by create this dir before update, then remove it (From OE-Core rev: 24f4f4551d220030c0f847c648a49a15bf1fe6eb) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6f262a316d6c32ff9ce96ab4bd95726772b5f20f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: avoid unexpected operating-system namesAndreas M?ller2020-06-261-0/+3
| | | | | | | | | | | | | | | | | For example 'linux-gnueabi' is not what meson consumers expect: See canonical table of OS names for Meson (thanks Ross). Surprisingly this did not pop up earlier but wrong system-name can break building as described in [1] [1] https://lists.openembedded.org/g/openembedded-core/topic/meson_host_machine_system/73023862 (From OE-Core rev: e48425a7e80283cde95886e26f17cd687bb98468) Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 010202076760329829fbde8dab4f535d6f755873) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* go.bbclass: Add `-trimpath` to default build flagsOtavio Salvador2020-06-261-1/+1
| | | | | | | | | | | | | The `-trimpath` option is important for reproducible builds so full build paths and module paths are not embedded. (From OE-Core rev: 03799cf6141abf75e7cfad5ec9822eb303b68e2f) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e3df027b3697b6a92b417bba8d442a5bd15525fd) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* go-mod.bbclass: Add class for `go mod` supportOtavio Salvador2020-06-261-0/+20
| | | | | | | | | | | | | | | | | | | | When using Go Modules, the the current working directory MUST be at or below the location of the 'go.mod' file when the go tool is used, and there is no way to tell it to look elsewhere. It will automatically look upwards for the file, but not downwards. To support this use case, we provide the `GO_WORKDIR` variable, which defaults to `GO_IMPORT` but allows for easy override. [YOCTO #13883] (From OE-Core rev: a0716c04ed4f062b3112e3d41abc7ea1fad3b7e7) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 11c2b06ac98cc5064640705712bffa156519f450) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/archiver: Create patched archive before configuringJoshua Watt2020-06-261-1/+1
| | | | | | | | | | | | | | | | | do_configure and do_preconfigure can modify source files, which causes race conditions if these tasks run in parallel with do_ar_patched. Add explicit task dependencies to ensure that do_ar_patched finishes before these tasks start. Specifically, this fixes a race condition with gcc-source where do_ar_patched races with do_preconfigure deleting gcc/gengtype-lex.c (From OE-Core rev: fdd06278dc67e8c13468b89746c562d298a2d63b) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 8a7c7794870815030239e90b03e37ed302b7e885) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* relocatable.bbclass: Avoid an exception if an empty pkgconfig dir existPeter Kjellerstedt2020-06-261-9/+11
| | | | | | | | | | | | | | Rewrite relocatable_native_pcfiles() so that it can handle that any of the checked pkgconfig directories are empty without causing an exception. (From OE-Core rev: ceffd920c7bdae29cd1a606f1c20d1b2d3666f5b) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f9c5df6dc1c13e9b05ff1b47ad84ad339f6779a4) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* populate_sdk_base.bbclass: fix warning: name not matchedwenlin.kang@windriver.com2020-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When do populate_sdk with SDK_ARCHIVE_TYPE = "zip", have below warning in log file, this patch fixes it. zip warning: name not matched: sysroots/core2-64-poky-linux/etc/tmpfiles.d/etc.conf zip warning: name not matched: sysroots/core2-64-poky-linux/etc/tmpfiles.d/home.conf zip warning: name not matched: sysroots/core2-64-poky-linux/etc/resolv-conf.systemd zip warning: name not matched: sysroots/core2-64-poky-linux/etc/mtab zip warning: name not matched: sysroots/core2-64-poky-linux/etc/resolv.conf zip warning: name not matched: sysroots/core2-64-poky-linux/var/lock zip warning: name not matched: sysroots/core2-64-poky-linux/usr/lib/environment.d/99-environment.conf zip warning: name not matched: sysroots/core2-64-poky-linux/sbin/klogd zip warning: name not matched: sysroots/core2-64-poky-linux/sbin/syslogd zip warning: name not matched: sysroots/x86_64-pokysdk-linux/usr/bin/chfn zip warning: name not matched: sysroots/x86_64-pokysdk-linux/usr/bin/chsh zip warning: name not matched: sysroots/x86_64-pokysdk-linux/usr/bin/passwd zip warning: name not matched: sysroots/x86_64-pokysdk-linux/usr/bin/chpasswd zip warning: name not matched: sysroots/x86_64-pokysdk-linux/sbin/vipw zip warning: name not matched: sysroots/x86_64-pokysdk-linux/sbin/vigr zip warning: name not matched: sysroots/x86_64-pokysdk-linux/sbin/nologin (From OE-Core rev: 72b7c3c7a35d814510aa1a52d2707a1ffddf8e8e) Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5f7df08aca81ac269490876fe84c7fc5b1d5739c) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: include epoch in product version outputRalph Siemsen2020-06-181-1/+1
| | | | | | | | | | | | | | | In the generated cve.log files, include the epoch in the product version. This better matches how versions are displayed elsewhere, in particular the bb.warn("Found unpatched CVE...") that appears on the terminal when CVEs are found. (From OE-Core rev: 99f6de1c74b581054c74c6b4598a5d47facc9964) Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e1c3c0b6e5b01304e2127f5058986697e82adf93) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel/reproducibility: kernel modules need SOURCE_DATE_EPOCH exportBruce Ashfield2020-06-051-0/+15
| | | | | | | | | | | | | | | | | | | | | If CONFIG_IKHEADERS is set to =m, then reproducibility issues creep into the modules build, since the variables we are setting for the main kernel build are not present. Since the source code must be available for a possibly git query on the timestamp, there didn't seem to be an easy way to move the environment variable setting to a common routine. As such, we duplicate the block of code that exports the required variables for reproducible builds. There is a maintenance risk to this, but any issues should be easy enough to catch. (From OE-Core rev: f511d78164581f80e7b8c592fe88ffbf38738150) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 82cdfcdccfedd320ebc0cdc778c7d4966198b96f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: When siginfo or sig files are missing, stop fetcher errorsMark Hatle2020-06-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to fetching, the system checks if the sstate file is present either locally or on the mirror. If it is, then it goes to the fetch stage. Up to three files can be fetched, sstate, sstate.siginfo and sstate.sig (if signature validation is enabled). The previous pstaging_fetch function would iterate over these, and if a download error occurred would spew forth a great amount of fetcher failure messages as well as stop fetching the next item in the set. This was resolved by adding a fetcher.checkstatus() call prior to the download. If the file isn't present, then the exception will be triggered, and no fetcher failure messages will reach the user. The exception handler is then modified to be a pass so that it will loop and pull the rest of the files that that are requested. Additionally, a check for the existance of the .sig file was added to the sstate_installpkg to avoid an error trying to load the .sig if it wasn't downloaded. (From OE-Core rev: ec58532ab6fc6343144da67789c928c751d36c06) Signed-off-by: Mark Hatle <mark.hatle@xilinx.com> Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a9085140434e2d26c0bb75bb53fcb7f7c19ef86d) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* archiver.bbclass: Fix duplicated SRC_URIs for do_ar_originalRobert Yang2020-06-051-1/+7
| | | | | | | | | | | | | | | | | | | | | The argument urls of bb.fetch2.Fetch(urls, d) are duplicated to SRC_URI, which caused errors like: bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: The SRCREV_FORMAT variable must be set when multiple SCMs are used. The SCMs are: git://github.com/docker/notary.git;destsuffix=git/src/github.com/docker/notary git://github.com/docker/notary.git The first one is from original SRC_URI, the second one is from the variable 'urls', so cleanup SRC_URI before call bb.fetch2.Fetch() can fix the problem. (From OE-Core rev: a7f50876f95a9be9fe045af1e4efddfe53a983f5) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b244c4f3427cd07376d4b8f7d27e38735bcc90e7) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: Detect and fail if 'inherit' is used in conf fileGregor Zatko2020-06-051-0/+6
| | | | | | | | | | | | | | | | | | | | | 'inherit' directive may not be used in conf files as it's supposed to be used for the inheritance of classes. Correct form in conf file is INHERIT. This commit adds: - a sanity check to find whether the wrong case exists - fail the build if so - tell user about the difference in directives [YOCTO #5426] (From OE-Core rev: bc6e27aeed5d536d2b764949c307f260f78b7810) Signed-off-by: Gregor Zatko <gzatko@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 07bf9b460fe97dec86439302a83bbefa8bac9d70) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: Run it after do_fetchKhem Raj2020-06-051-1/+1
| | | | | | | | | | | | | | | | | | | Certain recipes e.g. bash readline ( from meta-gplv2 ) download patches instead of having them in metadata, this could fail cve_check ERROR: readline-5.2-r9 do_cve_check: File Not found: qemuarm/build/../downloads/readline52-001 This patch ensures that download is done before running CVE scan, even though these will be external patches and may not contain CVE tags as it expects, but it will fix the run failures as seen above (From OE-Core rev: dbf143d79476e54e8da93101fc16eaedeec88362) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e406fcb6c609a0d2456d7da0d2406d2d9fa52dd2) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* base/insane: Check pkgs lics are subset of recipe lics only onceQuentin Schulz2020-05-282-14/+20
| | | | | | | | | | | | | | | | | | | | | | | Move logic checking that all packages licenses are only a subset of recipe licenses from base.bbclass to the insane.bbclass so that it's evaluated only once, during do_package_qa. As explained in the linked bugzilla entry, if a package license is not part of the recipe license, the warning message gets shown an unreasonable amount of time because it's evaluated every time a recipe is parsed. [YOCTO #10130] This also makes it possible to silence this error with INSANE_SKIP. (From OE-Core rev: ae404ef230882e442e9390b314e1ce023fdbbd1b) Signed-off-by: Quentin Schulz <quentin.schulz@streamunlimited.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 852408ed4be1f64c57e196688728b7ed223d3493) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* archiver.bbclass: Make do_deploy_archives a recursive dependencyPaul Barker2020-05-281-1/+3
| | | | | | | | | | | | | | | | | | | | To ensure that archives are captured for all dependencies of a typical bitbake build we add do_deploy_archives to the list of recursive dependencies of do_build. Without this, archives may be missed for recipes such as gcc-source which do not create packages or populate a sysroot. do_deploy_archives is also added to the recursive dependencies of do_populate_sdk so that all sources required for an SDK can be captured. (From OE-Core rev: 66a2e4bcafb3f8835bb21d73a9e78e7d9d15bbd3) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com> (cherry picked from commit e1feb6030cd8e77c553ec10a366cbeb7e902bada) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: Close the log file after readingAnton Eliasson2020-05-221-1/+2
| | | | | | | | | | | | | | | | | | This fixes warnings like: WARNING: package-name-0.0.1-r0 do_configure: <string>:164: ResourceWarning: unclosed file <_io.TextIOWrapper name='/source_directory/build/tmp/work/arch/package-name/0.0.1-r0/package-name-0.0.1//meson-logs/meson-log.txt' mode='r' encoding='UTF-8'> (From OE-Core rev: 789c008167e5fe94f781ab274d60b06eaa46ce25) Signed-off-by: Anton Eliasson <anton.eliasson@axis.com> Reviewed-by: Ola x Nilsson <ola.x.nilsson@axis.com> Signed-off-by: Anton Eliasson <anton.eliasson@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>
* pypi.bbclass: use new pypi UPSTREAM_CHECK_URITim Orling2020-05-221-1/+1
| | | | | | | | | | | | Upstream https://pypi.python.org/pypi/${PYPI_PACKAGE}/ redirects to https://pypi.org/project/${PYPI_PACKAGE}/ (From OE-Core rev: e5f3f961242d888f3f786af8f793bf1d247fdff0) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.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>
* pypi.bbclass: mind package suffix on version checkKonrad Weihmann2020-05-221-1/+1
| | | | | | | | | | | | | | Some pypi packages do have suffixes like dev, or a0 or b1. When doing a version check on these, the version will get falsely identified as major release versions. Add a terminating slash to rule out those false positives (From OE-Core rev: 0603f6d9f2abfa67b99b1bc39228f6aa16a0370d) Signed-off-by: Konrad Weihmann <kweihmann@outlook.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>
* sstate.bbclass: Do not fail if files cannot be touchedPeter Kjellerstedt2020-05-221-4/+11
| | | | | | | | | | | | It may be that a file is not allowed to be touched, e.g., if it is a symbolic link into a global sstate cache served over NFS. (From OE-Core rev: f528d6ffc9649536d21d625f65b415bfec7db258) 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>
* staging: Fix overlapping file failuresRichard Purdie2020-05-071-2/+10
| | | | | | | | | | | | | | | | | | | | | If there are different providers of a file and they are swiched when the recipe isn't machine specific, we can get tracebacks due to the overlapping files. The issue is that the previous provider isn't uninstalled since the system can't tell whether some later task needs them. By tracking which tasks we depend upon, the code can now choose to uninstall more things since a later task can reinstall if/as needed. The code here was to protect against code with two different tasks running in parallel which is still protected agaisnt. [YOCTO #13702] (From OE-Core rev: 86f36e3f93cdb2f5882b72e736a770aa6f46100d) 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>
* testimage.bbclass: correctly process SIGTERMAlexander Kanavin2020-05-071-4/+4
| | | | | | | | | | | | | | | | | | | | | Python's unittest will not propagate exceptions upside of itself, but rather will just catch and print them. The working way to make it stop is to send a SIGINT (e.g. simulate a ctrl-c press), which will make it exit with a KeyboardInterrupt exception. This also makes pressing ctrl-c twice from bitbake work again (previously hanging instances of bitbake and qemu were left around, and bitbake would no longer start until they were killed manually). (From OE-Core rev: 72a19f5f0f4bc4472d13b29e46a5c1673977e37a) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.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>
* insane.bbclass: Add test for shebang line lengthDomarys Correa2020-05-071-1/+24
| | | | | | | | | | | | | | | | Shebang lines longer than 128 characters can give an error depending on the operating system. This implements a test that signals an error when locating a faulty shebang. YOCTO: #11053 (From OE-Core rev: 9ed54437b00aed1d41993f7658820d8adfb09282) Signed-off-by: Domarys Correa <domarys.correa@ossystems.com.br> 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>
* kernel-yocto.bbclass: Fix deps when externalsrc is usedPaul Barker2020-05-051-0/+6
| | | | | | | | | | | | | | | | | | do_kernel_configme was recently removed from SRCTREECOVEREDTASKS so this task still runs when externalsrc is used. This task normally runs after do_patch but when externalsrc is used, do_patch is removed and this ordering restriction does nothing. This allows bitbake to execute do_kernel_configme too early, causing races with do_unpack. This is fixed by adding in a dependency on do_unpack when externalsrc is used. (From OE-Core rev: 75b47388fb18aaf58db311e570c009350d64084f) Signed-off-by: Paul Barker <pbarker@konsulko.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>
* Windows: Enable Windows builds under WSLv2 and warn accordinglyAlejandro Hernandez Samaniego2020-04-061-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the architectural changes between Windows Subsystem for Linux v2, and WSL v1 it should now be possible to run bitbake on the several distros offered through the Microsoft Store. WSLv2 is available on Windows 10 build number > 18917 The current build number may be checked by opening a cmd prompt on Windows and running: C:\Users\myuser>ver Microsoft Windows [Version 10.0.19041.113] If a distro has already been installed via the Microsoft Store, then we can check which WSL version its using by opening a Windows Powershell (notice this is a powershell and not a cmd prompt): C:\WINDOWS\system32> wsl -l -v NAME STATE VERSION * Ubuntu Running 2 Debian Stopped 1 In this case it shows two distros installed, Ubuntu running WSLv2 and Debian running WSLv1 To change the version of WSL being used by a certain distro run: C:\WINDOWS\system32> wsl --set-version <Distro> 2 e.g C:\WINDOWS\system32> wsl --set-version Debian 2 For more information on installing WSLv2 please look at: https://docs.microsoft.com/en-us/windows/wsl/wsl2-install There are some caveats related to the way storage is handled by WSLv2 though, and at this point these have to be managed by the user manually, the storage space used by WSL is not reflected immediately and since bitbake heavily uses storage, after several builds this can prove to be a bit of an issue. WSLv2 uses a VHDX file for storage, this issue can be easily avoided by optimizing this file every now and then, this can be done via the following: 1.- Find the location of your VHDX file: - Get the distro app package directory. - Open Windows Powershell as Administrator and run: Get-AppxPackage -Name "*<DISTRO>*" | Select PackageFamilyName e.g.: PS C:\WINDOWS\system32> Get-AppxPackage -Name "*Ubuntu*" | Select PackageFamilyName PackageFamilyName ----------------- CanonicalGroupLimited.UbuntuonWindows_79abcdefgh Replace the PackageFamilyName (and your user) on the following path: C:\Users\<user>\AppData\Local\Packages\<PackageFamilyName>\LocalState\ e.g. ls C:\Users\<user>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ Mode LastWriteTime Length Name -a---- 3/14/2020 9:52 PM 57418973184 ext4.vhdx The VHDX file path is: C:\Users\<user>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx 2.- Optimize your VHDX file (Also on Powershell): - Make sure WSL is shutdown wsl --shutdown - Optimize it optimize-vhd -Path C:\Users\<user>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx -Mode full A progress bar should be shown while optimizing the VHDX file. As an example, after building core-image-sato, removing the TMPDIR did not reflect any changes on Windows Explorer for storage space being used, after optimizing the VHDX file, 14 extra GB were shown as free. So, as long as the the user optimizes its storage, the builds should run smoothly. This patch warns the user that is running bitbake under WSLv2, that they should optimize the VHDX file eventually to avoid storage issues. The same check previoulsy used for WSLv1 works for WSLv2, checking for the kernel version: WSLv1: Linux version 4.4.0-19041-Microsoft (Microsoft@Microsoft.com) WSLv2: Linux version 4.19.84-microsoft-standard (oe-user@oe-host) Builds have been tested under Ubuntu and Debian distros offered and installed through the Microsoft Store, and other distros should be able to run builds just as fine. Performance wise, using the same hardware, and same configuration a comparison between builds using native Linux vs WSLv2 for the following targets has been performed: - core-image-minimal - core-image-sato - core-image-sato-sdk - meta-toolchain No real evidence of any performance changes could be found, with WSLv2 builds running even faster in some cases. Running a recently built image can be done just as smoothly, if using "nographic" as argument for runqemu, or if its a graphical image, installing an X server and running runqemu runs just as fine. Happy bitbaking. (From OE-Core rev: c42cec0c1c57c4e67dc7cdb07c5e4aba14a847d3) Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Alejandro Hernandez Samaniego <alhe@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: echo current SDK_VENDOR if it is invalidPaul Gortmaker2020-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | It can be frustrating if this sanity check triggers, but you don't know why; you haven't explicitly set any SDK vars, or similar. At least echo out the offending value, so the end user has a bit more information to go on. Before: SDK_VENDOR should be of the form '-foosdk' with a single dash After: SDK_VENDOR should be of the form '-foosdk' with a single dash; found '-overc-sdk' Cc: Ross Burton <ross.burton@intel.com> (From OE-Core rev: e238fa177bd72bc5d165fbe4f640132267a1d3fd) Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cmake: fix Python executable with cmakeMartin Kelly2020-04-052-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, CMake has two ways of finding Python executables: FindPythonInterp and FindPython/FindPython3. FindPythonInterp is deprecated and may be removed at some point. Currently, python3native sets PYTHON_EXECUTABLE, which FindPythonInterp uses. This is a problem for a few reasons: - Setting PYTHON_EXECUTABLE as an environment variable doesn't work, as CMake needs it to be set as an explicit CMake option via -D. - Projects using the newer FindPython/FindPython3 don't pickup the right Python, as the newer routines use Python_EXECUTABLE and Python3_EXECUTABLE. Fix this by setting PYTHON_EXECUTABLE, Python_EXECUTABLE, and Python3_EXECUTABLE using -D options to EXTRA_OECMAKE. The CMake routines are documented below: https://cmake.org/cmake/help/latest/module/FindPythonInterp.html https://cmake.org/cmake/help/latest/module/FindPython.html https://cmake.org/cmake/help/latest/module/FindPython3.html (From OE-Core rev: a22200a646eaf42cd4902a2fe3358d29717ac129) Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity: Require gcc 5.0 minimum versionRichard Purdie2020-04-051-3/+3
| | | | | | | | | | | | After polling various develoeprs, its clear that many layers are struggling with gcc 4.8 and its better for the project to adopt 5.0 as a minimum version at this point in time. We should have technology like buildtools-extended-tarball available to ensure things still work on Centos 7 and Debian 8. (From OE-Core rev: abc741af16311cb473b7e3185ae34265b243d804) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: add test for gcc < 4.8Tim Orling2020-04-011-1/+20
| | | | | | | | | | | | | | | | | | | | | | | It is known that old versions of gcc prior to 4.8 causes builds to fail. Add a test for BUILD_CC == 'gcc' and gcc < 4.8 and recommend using scripts/install-buildtools or user built buildtools-extended-tarball. Use the new get_host_compiler_version function from lib/oe/utils.py NOTE: another solution is to install devtoolset-6+ from scl [1], but this is a rather large install (> 1 Gb) and fairly invasive. [1] https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/ Adding this code means we can increase the minimum version easily in the future too (which will soon be needed). RP: Change minimum version from 5.0 to 4.8 for initial patch (From OE-Core rev: 3bb3b9cbad82b2f09386153226d1d4e769b7347b) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sanity.bbclass: recommend using install-buildtoolsTim Orling2020-04-011-3/+1
| | | | | | | | | | | | For old tar version (< 1.28), recommend using scripts/install-buildtools Drop check for tar version 1.24. Dubious extra value. (From OE-Core rev: 7a66434cf11b7f051699b774e4fccd6738351368) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: CPE version '-' as all versionLee Chee Yang2020-04-011-1/+1
| | | | | | | | | | | | | | | | | | CPE version could be '-' to mean no version info. Current cve_check treat it as not valid and does not report these CVE but some of these could be a valid vulnerabilities. Since non-valid CVE can be whitelisted, so treat '-' as all version and report all these CVE to capture possible vulnerabilities. Non-valid CVE to be whitelisted separately. [YOCTO #13617] (From OE-Core rev: c69ee3594079589d27c10db32bc288566ebde9ef) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* core-image.bbclass: add mention of allow-root-login, stateless-rootfsrpjday@crashcourse.ca2020-03-301-0/+2
| | | | | | | | | Add mention/description of missing IMAGE_FEATURES. (From OE-Core rev: 9f126a97d61bed481b64351fdcf27beaf6365a52) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* vala.bbclass: add libdir to XDG_DATA_DIRSChangqing Li2020-03-291-1/+1
| | | | | | | | | | | | | | Otherwise .gir files installed in the sysroot will not be found when multilib is in use. for vapigen, it need to find .vapi and .gir files under XDG_DATA_DIRS, for gobject-introspection, multilib configurations use libdir rather than datadir (From OE-Core rev: b88f0590b4606d8adc8d728086a22325c1ae56b1) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* archiver.bbclass: Correct a typoPeter Kjellerstedt2020-03-221-2/+2
| | | | | | | | | Also add a missing space in a warning message. (From OE-Core rev: 6d1d0dccafeaeb971ad18a8bb4ebdd2860d407d5) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/populate_sdk_base: Implement xz compression optionsMike Looijmans2020-03-221-1/+3
| | | | | | | | | | | | | | | | | | | Building an SDK on a machine with 8GB RAM resulted in excessive swapping due to the xz compressor using ~20GB of memory. This is because xz is being called with "-T 0 -9". To allow tuning the compression versus memory usage, introduce a variable named SDK_XZ_OPTIONS that defaults to a more sane default: SDK_XZ_OPTIONS ?= "${XZ_DEFAULTS} ${SDK_XZ_COMPRESSION_LEVEL}" The use of XZ_DEFAULTS fixes the excessive memory usage. The SDK_XZ_COMPRESSION_LEVEL variable allows overriding the speed vs compression. In an office or development environment the extra time spent on compressing a few percent more is just not worth it. (From OE-Core rev: 25533a48a19e3e6eb9f96be51b1373830b5bb9f0) Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* linuxloader: Add get_musl_loader_arch functionKhem Raj2020-03-211-12/+17
| | | | | | | | | | | | | | | get_musl_loader_arch returns the arch part of ldso for musl, this is used in get_musl_loader() as well as independently usable, which is needed for multilib support in musl. Musl stores all ldso in /lib be it multilib or not, therefore do not use base_libdir instead directly use /lib [YOCTO #11971] (From OE-Core rev: 0b694592c417c1d21913905f5032d300c9635866) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: support multiple NICsAdrian Freihofer2020-03-211-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Emulating more than one network interface with runqemu is a bit tricky, but possible. For example, the following leads to an emulated device with eth0 and eth1: QB_NETWORK_DEVICE_prepend = " \ -device virtio-net-device,mac=52:54:00:12:34:03 \ " or QB_NETWORK_DEVICE_append = " \ -device virtio-net-pci,mac=52:54:00:12:34:03 \ " When booting Qemu with two NICs, the kernel does not know which interface the specified ip=192.168.7.... command line argument should be applied. This delays the boot process for a very long time and a guest wihtout IP configuration. This add two new configuraton parameters to runqemu: QB_CMDLINE_IP_SLIRP and QB_CMDLINE_IP_TAP to explicitely specify the ip= kernel command line arguments for tap and slirp mode. Note: Simply adding "::eth0" broke some builds on the Yocto autobuilder. (From OE-Core rev: 59bfdc331c1494c05ab38804b281878a1f571f6d) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* base.bbclass: extend PACKAGECONFIG for conflict package configsKai Kang2020-03-121-3/+17
| | | | | | | | | | | | There are mutually exclusive PACKAGECONFIGs in recipes. Though it declares that package configs are exclusive, it can't prevent users to set them at same time. Extend PACKAGECONFIG to support specifying conflicted package configs. (From OE-Core rev: 734475b3f86d88a548bc9eb91d836bd1b9335e9f) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* grub-efi-cfg: enable per-label APPEND overrideRich Persaud2020-03-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | For legacy bios boot configurations, syslinux supports multiple labels with per-label APPEND definitions. grub-efi-cfg supports multiple labels, but only a single APPEND definition. Enable optional per-label APPEND definitions for grub EFI, with variable names prefixed by "grub_" to isolate grub definitions from syslinux defintions. Example use from an ISO image recipe that inherits grub-efi-cfg: LABELS_LIVE="foo bar" APPEND_grub_foo = "linuxcmdline" No change in behavior for those using APPEND without overrides. (From OE-Core rev: 20ad7705d1060300d53304c259b1f07d04b86eba) Signed-off-by: Rich Persaud <rp@stacktrust.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image-prelink: remove assumption of sysconfdir presenceChristopher Clark2020-03-111-0/+17
| | | | | | | | | | | | | | If sysconfdir is not present in the image filesystem then the temporary creation of a prelink.conf will fail. Fix this by creating sysconfdir temporarily if needed beforehand and then remove any directories that were created afterwards. fixes: OpenXT OXT-1751 (From OE-Core rev: 6bf3e3db355643c4b2e20346230c09e45e519035) Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel.bbclass: fix SOURCE_DATE_EPOCH for non-git kernel buildsChristopher Clark2020-03-101-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The source directory is not always a git repository, so when querying git for data to set SOURCE_DATE_EPOCH, specify ${S}/.git as the git directory to prevent retrieving incorrect data from any parent directory. Fixes the following errors with the prior logic when building a kernel that is not obtained from a git repository: 1. With TMPDIR set to a directory outside any git repository on a mounted filesystem, reproducible builds fail in do_compile with this git error: fatal: not a git repository (or any parent up to mount point <abspath>) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). aborting before the error handling logic. 2. With TMPDIR located within a subdirectory of a git repository, the SOURCE_DATE_EPOCH timestamp would be that of said repository rather than that of the kernel. (From OE-Core rev: 270ae94fe345b9ce98d822034cbfad7e24c5f393) Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: fix ValueErrorChee Yang Lee2020-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | fix below error for whitelisted recipe and recipe skip cve check. Error: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: <module> 0001: *** 0002:do_cve_check(d) 0003: File: '/poky-master/meta/classes/cve-check.bbclass', lineno: 59, function: do_cve_check 0055: try: 0056: patched_cves = get_patches_cves(d) 0057: except FileNotFoundError: 0058: bb.fatal("Failure in searching patches") *** 0059: whitelisted, patched, unpatched = check_cves(d, patched_cves) 0060: if patched or unpatched: 0061: cve_data = get_cve_info(d, patched + unpatched) 0062: cve_write_data(d, patched, unpatched, whitelisted, cve_data) 0063: else: Exception: ValueError: not enough values to unpack (expected 3, got 2) (From OE-Core rev: 64a362bd2dd0b4f3165d5162adbc600826af66f8) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto.bbclass: Support config fragments with externalsrcPaul Barker2020-03-101-1/+2
| | | | | | | | | | | | | | | | | The merging of config fragments is performend in the do_kernel_configme task and so config fragments will not be supported when this task is removed from the dependency tree. kernel-yocto adds additional tasks which may modify the source directory to SRCTREECOVEREDTASKS so that they are removed when using externalsrc. However, do_kernel_configme should be safe to use, the only modification to the source tree is the potential creation of the '.kernel-meta' directory and the '.metadir' file. (From OE-Core rev: 44f04c039a4d61dd18666e42b9b9865cbc3ada9e) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernelsrc.bbclass: Fix externalsrc supportPaul Barker2020-03-101-1/+1
| | | | | | | | | | | | | | | When the externalsrc class is used the tasks listed in SRCTREECOVEREDTASKS are deleted to prevent them being executed. If externalsrc is used for the kernel then this will include virtual/kernel:do_patch. We can depend on do_shared_workdir instead as this will survive when externalsrc is used. (From OE-Core rev: 2c17d35cc7b9c5e01fd5829858d2f0234e7ac8d6) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* reproducibile_build: Fix SDE file generation when unpack rerunsRichard Purdie2020-03-081-4/+5
| | | | | | | | | | | | | | | Currently, if an existing TMPDIR is rebuilt, do_fetch/do_unpack can rerun but SDE would remain unchanged. This leads to different results compared to a fresh build. An example change which triggered this is: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=cb4e69e6346a9fbeebf83a5d5397cacbd41d48b5 Instead, delete any existing SDE and recalculate if we're reunning. Also rename and drop the do_ prefix since these are for tasks, not functions. (From OE-Core rev: 5d579fc2fe71637fc6e071aa66542befa39ac8bb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>