summaryrefslogtreecommitdiffstats
path: root/meta/classes
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* cve-check: show whitelisted statusChee Yang Lee2020-03-071-5/+7
| | | | | | | | | | | change whitelisted CVE status from "Patched" to "Whitelisted". [Yocto #13687] (From OE-Core rev: 181bdd670492525f9488d52c3ebb9a1b142e35ea) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* populate_sdk_ext: enable custom templateconf.cfgAndrej Valek2020-03-071-3/+7
| | | | | | | | | | Do not always override templateconf.cfg content. Add option to use already existing file. (From OE-Core rev: e524e49ef22fd69882d5d2d01cd84db790e9cb88) Signed-off-by: Andrej Valek <andrej.valek@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate: Drop obsolete check in hash validationRichard Purdie2020-03-061-4/+0
| | | | | | | | | | | | | | Now this function has a summary parameter we can drop this check. It could well be why the mysterious "locked sigs" selftest fails intermittently if this function were called with a single hash to check. [YOCTO #13605] (with luck) (From OE-Core rev: 02aabe0e59f73bf206d9bada1e7089832ceed254) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto.bbclass: fix a wrong inter-task dependencyMing Liu2020-03-061-1/+1
| | | | | | | | | | | | do_kernel_checkout and do_symlink_kernsrc are both modifying ${S}, they could conflict with eacher other, move do_kernel_checkout after do_symlink_kernsrc does fix that. (From OE-Core rev: 965090f42bc0576e938a0575b7938a1ff60b0018) Signed-off-by: Ming Liu <liu.ming@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/kernel.bbclass: Fix parsing errorsJoshua Watt2020-03-061-2/+2
| | | | | | | | | | | legitimize_package_name wants the actual value of KERNEL_REVISION, so use d.getVar() to fetch it as is done elsewhere in the file. Failing to do so can result it weird errors at parsing time. (From OE-Core rev: 9bff4d14693c1890fc181ec68c9f883dc4e4accf) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mime-xdg.bbclass: Fix typo in commentAndreas Müller2020-03-011-1/+1
| | | | | | | (From OE-Core rev: d6fc0081f53ebc5b12ffff917cf3c04c270a69f1) Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_ipk: Add missing variables to the task hashRichard Purdie2020-02-231-0/+4
| | | | | | | | | Several variables used by the task are not included in the hash, as highlighted by recent changes to MAINTAINERS not causing rebuilds. Fix this. (From OE-Core rev: 0bfb2e984062e2a00f8989d26aebb89b112d81d2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package: Correct variable dependeciesRichard Purdie2020-02-231-2/+4
| | | | | | | | | | | Ensure that the plain variable X is also added to the dependencies as well as X_<pkg>. Allow the funciton to be called with a different variable list too. (From OE-Core rev: c392401e10ff43d10b7e57c9d552522a02c91878) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "rootfs: Make BUILDNAME a weak default in reproducible_build_simple"Peter Kjellerstedt2020-02-212-1/+5
| | | | | | | | | | | | | | | This reverts commit 8380df6566db49ef184b837432558750f77f592f. Giving BUILDNAME a static default in reproducible_build_simple.bbclass to have /etc/version be generated with that name lead to other users of BUILDNAME no longer working as expected. E.g., buildstats.bcclass would now write its information in a single directory, overwriting the statistics for each build. (From OE-Core rev: dcd1fbe153369634c73370cbe22e1dbdac080146) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane.bbclass: Correct typo inhert->inheritKhem Raj2020-02-181-1/+1
| | | | | | | (From OE-Core rev: 8fdceff7a9581173726c2a2636a5815accca73e2) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* fix various, innocuous typosRobert P. J. Day2020-02-181-1/+1
| | | | | | | | | | | | | | Corrections: - environment - accommodate - conversion - compatible (From OE-Core rev: 9797d3b45b4e1b9d77f0f2ee299c17b48d8d3cf6) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* weston: add a basic runtime testAlexander Kanavin2020-02-181-1/+1
| | | | | | | | | The test is checking that weston is able to start. (From OE-Core rev: 57700767f90eea8f2b78187c42581aca42d50bbf) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Honor APPENDKevin Hao2020-02-151-1/+1
| | | | | | | | | | | | | | | | | | APPEND is used to add additional parameters to kernel by features, such as read-only-rootfs. So we should honor this variable when we compose the kernel parameter in wic. I know we also can resolve this kind of issue by using the .wks.in template introduced by commit 42e870c5ed4b ("image_types.bbclass: support template .wks.in files for wic"), but the APPEND is needed by all the wks, it would seems pretty ridiculous to me to change all the .wks to .wks.in and then foist the APPEND into them. So the APPEND is definitely deserved to export to the wic directly. [Yocto #12809] (From OE-Core rev: 18981b8a457104391dfd94938c247eac04e4ed50) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image.bbclass, package-index.bb: Delete do_populate_lic taskKhem Raj2020-02-151-0/+1
| | | | | | | | | These are meta packages (From OE-Core rev: e6ea95ae85763670aef35f7cb025eea693138d07) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* populate_sdk_ext: We now require python3, not pythonRichard Purdie2020-02-151-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) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* staging: Handle races between binaries and their libsRichard Purdie2020-02-151-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | There is a long standing issue where a binary could be installed into the sysroot before its library dependencies. We've always argued nothing should use the binary until it has been installed by a dependency but there are issues around binaries which conflict with the host system, for example patch, python3, gzip and more. With the recent patch changes we've seen issues like: ERROR: gdb-cross-canadian-powerpc-8.3.1-r0 do_patch: Command Error: 'quilt --quiltrc /home/pokybuild/yocto-worker/qemuppc/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/gdb-cross-canadian-powerpc/8.3.1-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output: Applying patch 0009-Change-order-of-CFLAGS.patch patch: /lib64/libattr.so.1: version `ATTR_1.3' not found (required by patch) Patch 0009-Change-order-of-CFLAGS.patch does not apply (enforce with -f) which is a symptom of this issue (libattr-native is a dependency of patch-native). There are other ways to fix this such as disabling libattr in patch, installing patch to a subdirectory and requiring PATH manipulation and so on. We can simply fix the staging code to handle /bin/ after everything else so do that and avoid all these other complications. (From OE-Core rev: 29d17fe23265bf0c7defa14ffc0f677af15c6818) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devicetree.bbclass: include symbols in base DTAlex Kiernan2020-02-141-1/+1
| | | | | | | | | | | | | | | When processing overlays, the base device tree must be compiled with symbols, otherwise attempting to apply overlays in U-Boot will fail with: failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND base fdt does did not have a /__symbols__ node make sure you've compiled with -@ (From OE-Core rev: d075e39c05ace6dad2c66a5e8c4b1e75aa751b6a) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: fix devicetree reproducibilityAlex Kiernan2020-02-141-1/+1
| | | | | | | | | | | Ensure that the order of dtb/dtbo files in the generated fitimage is reproducible. Fixes: 71bfa9838cbf ("kernel-fitimage: Handle overlays in EXTERNAL_KERNEL_DEVICETREE") (From OE-Core rev: 9e4a91b63dd8e0c1708da2ac7de461b35fb0b011) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* icecc.bbclass: replace superfluous "+=" with "="Robert P. J. Day2020-02-141-1/+1
| | | | | | | (From OE-Core rev: 8cd1150a813ba7aa395f3f62c6b91a3561e81c92) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* crosssdk: Set nativesdk specific distro featuresKhem Raj2020-02-141-0/+6
| | | | | | | | | | | | Currently, normal distro features e.g. ld-is-gold is impacting crosssdk recipes, which actually should not be the case, since that feature is essentially intended for target packages and not nativesdk packages (From OE-Core rev: aec9f9bd9549938a6ed42e9879f3a2fdcc89463d) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_ipk: Minor import tweak + ensure packages regeneratedRichard Purdie2020-02-131-2/+2
| | | | | | | | | | | | The recent opkg-utils change didn't update all the packages since its marked as ABISAFE (and has to be due to update-alternatives). Fix a minor import issue to avoid multiple imports of glob which also causes packages to re-generate. (From OE-Core rev: ef24a545d11febb96d1c0f02c60d9701295ef592) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* populate_sdk_base: if the SDKIMAGE_FEATURES changes, refresh the SDKMark Hatle2020-02-131-0/+1
| | | | | | | | | | | Since the features are processed by a python fragment, we need to explicitly list the variables that should affect the resulting hash, and thus sstate re-use. (From OE-Core rev: c7c12efba87c803d94a7c9c2f8c98b66aeba6d43) Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitimage: Handle overlays in EXTERNAL_KERNEL_DEVICETREEAlex Kiernan2020-02-131-3/+2
| | | | | | | | | | | When using EXTERNAL_KERNEL_DEVICETREE, collect DTB overlays too (*.dtbo) as well as iterating down into sub-directories so using the behaviour for naming which matches KERNEL_DEVICETREE. (From OE-Core rev: 169ebd59f11845a3a5a7157719217ccf0844e448) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Extend runtime testing infrastructure to allow unconventional ↵Alejandro Hernandez Samaniego2020-02-131-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | booting processes to be tested The current runtime infrastructure contains hardcoded values which Ill refer to as patterns, these patterns are either searched through or sent via the serial terminal to communicate between HOST and TARGET. These patterns are required since they allow us to check when a device has finished booting, to log in, and to check whether a command sent from our tests has returned, this way we are able to check both the status of the commands that were sent along with its output. The testing process goes somewhat as follows: 1. Launch QEMU and start booting. 2. Check when the device has booted by looking for the pattern login:. 3. Log in as the root user (default for our images). 4. Check that we were able to log in succesfully. 5. Start running the runtime test cases defined by TEST_SUITES. 6. One of such test cases could send a command to the QEMU target. 7. Check whether that command returned. 8. Check its output and status, return whether the test case passed or failed. This patch allows this set of patterns to be defined instead of being hardcoded, but it also automatically sets the defaults that we have been using in the past if they have not been manually defined, for this reason, the patch is less invasive and should not affect in any way how tests are currently being run. Cases that can be enabled with this patch: - A customized image that does not use the root user (or maybe we want to check what happens if we dont use the root user). - An image where the PS1 env variable has been modified, and the prompt pattern wouldnt match the default. - Baremetal applications, which do not follow the conventional way of booting Linux and would probably not show a prompt for a user to log in, same applies for testing bootloaders. - poky-tiny: Using DISTRO=poky-tiny and an image such as the core-image-tiny from meta-intel, which boots directly to RAM, and does not show a log in prompt since it does not contain a conventional init process. The code itself contains comments that should be self explanatory but here is an example on how these patterns can be defined in a hypothetical case where we want to run test cases as the webserver user instead: TESTIMAGE_BOOT_PATTERNS = "send_login_user search_login_succeeded" TESTIMAGE_BOOT_PATTERNS[send_login_user] = "webserver\n" TESTIMAGE_BOOT_PATTERNS[search_login_succeeded] = "webserver@[a-zA-Z0-9\-]+:~#" The variable TESTIMAGE_BOOT_PATTERNS defines which patterns to override when used to communicate with the target when booting, anyone familiar with the PACKAGECONFIG syntax should have no trouble setting these. Other patterns would still be set up as default, e.g. search_reached_prompt would still be login: The accepted flags for TESTIMAGE_BOOT_PATTERNS are the following: search_reached_prompt, send_login_user, search_login_succeeded, search_cmd_finished. They are prefixed with either search/send, to differentiate if the pattern is meant to be sent or searched to/from the target terminal. A working example of this code that falls under the baremetal case mentioned above along with a test case is present on the meta-freertos layer, which tests an RTOS image built with OpenEmbedded and automatically runs a test case on it after booting such image: As usual, INHERIT += "testimage" needs to be present on local.conf $ bitbake freertos-demo -c testimage RESULTS: RESULTS - freertos_echo.FreeRTOSTest.test_freertos_echo: PASSED (2.00s) SUMMARY: freertos-demo () - Ran 1 test in 2.006s freertos-demo - OK - All required tests passed (successes=1, skipped=0, failures=0, errors=0) (From OE-Core rev: 3ab2cbfeff371e8791b031a2852eeef80101a831) Signed-off-by: Alejandro Hernandez Samaniego <aehs29@gmail.com> Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Allow testing on QEMU machines with a single serial portAlejandro Hernandez Samaniego2020-02-131-0/+1
| | | | | | | | | | | | | | | | | commmit 6cde67d0a84 enables the use of qemurunner on machines that only have a single serial port, but still sets the default value as serial_ports=2 if not provided. The testimage class does not call qemurunner with a serial_ports argument, hence always defaulting to two. Pass the serial_ports argument from the testimage class to allow tests to run on QEMU machines with a single serial port. (From OE-Core rev: a50d0163770f0b405a8de8a8a9cccd48c1de4112) Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstate.bbclass: fix issue while handling long sstate filenamesJaewon Lee2020-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When moving to python3, divison using '/' now returns float instead of an integer. In upstream commit b8025e972081b70960ffcbcbe43a7118041556a1 sstate filenames longer than the limit are changed to just include necessary info + 3 fields just for information. The space left over after the necessary info is divided into 3 for each of the fields. Using '//' instead to do the division to solve the following error message: avail = (254 - len(hash + "_" + taskname + extension) - len(components[0]) - len(components[1]) - len(components[5]) - len(components[6]) - 7) / 3 > components[2] = components[2][:avail] components[3] = components[3][:avail] TypeError: slice indices must be integers or None or have an __index__ method (From OE-Core rev: 2acfee61a062c6520a413b2a797544d968bb0c76) Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com> Signed-off-by: Mark Hatle <mark.hatle@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package.bbclass: Support stripping and debug copy of static librariesMark Hatle2020-02-082-4/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, we won't copy and strip static libraries. However, this functionality can be useful in some cases where people are doing development on the target, and don't generally want the larger debug capable static libraries. To enable the new functionality set: PACKAGE_DEBUG_STATIC_SPLIT = '1' Add a new function splitstaticdebuginfo. Thus function will copy the unmodified static library into the specific debug directory location. By keeping an unmodified version, it is possible for a user trying to debug something to use -L /usr/lib/.debug-static and their existing build commands to switch from stripped to full debug versions. The PACKAGE_DEBUG_SPLIT_STYLE will select between two different approaches, /usr/lib/debug-static or <path>/.debug-static. Additionally you can now choose to strip static libraries to conserve space. If either 'PACKAGE_DEBUG_STATIC_SPLIT' or 'PACKAGE_STRIP_STATIC' is set to 1, the static library will be stripped. (This is not on by default, as it could make diagnosing static library usage difficult in some cases.) Add to insane.bbclass a skip to the staticdev warning for the specific -dbg package versions. (From OE-Core rev: 17fa66c8199d73f0b59b2b3e609075933bf1e74b) Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package.bbclass: Allow INHIBIT_PACKAGE_STRIP_FILES to skip .ko and static libsMark Hatle2020-02-081-6/+7
| | | | | | | | | | | Change the order of the skip processing to happen before any .ko and static library processing. This will allow these types of files to be individually skipped if necessary. (From OE-Core rev: c50fcd54ffe60b63d042d05e6cf538a593dc410f) Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package.bbclass: Fix debug source processing for static librariesMark Hatle2020-02-081-1/+1
| | | | | | | | | | | | Format of the sources list is the [ (file, [source, ...]), ... ] before this change, the static libraries were processed but the items were included incorrectly causing no sources for static libraries to be included. (From OE-Core rev: fa356b23c2f4599681693bba50d36659b07a8125) Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>