summaryrefslogtreecommitdiffstats
path: root/meta/classes
AgeCommit message (Collapse)Author
2020-09-28go-mod.bbclass: use append to add `modcacherw`Peter A. Bigot
This class provided default build flags but includes the base go class which also provides default flags. Use a different mechanism to extend the default flags without discarding `-trimpath` from the base class. Signed-off-by: Peter A. Bigot <pab@pabigot.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-28kernel.bbclass: ensure symlink_kernsrc task gets run even with externalsrcRasmus Villemoes
Commit c5dfc2586b41 (kernel.bbclass: run do_symlink_kernsrc before do_patch) fixed a race between do_symlink_kernsrc and do_populate_lic. However, I missed the fact that when externalsrc.bbclass is in use, the do_patch task doesn't exist, meaning that do_symlink_kernsrc now doesn't get run at all, breaking the build. We need this task to run regardless of whether do_patch exists or not, so reinstate the configure->symlink_kernsrc dependency explicitly. Fixes: c5dfc2586b41 (kernel.bbclass: run do_symlink_kernsrc before do_patch) Reported-by: Chanho Park <parkch98@gmail.com> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-28sstate.bbclass: Check file ownership before doing 'touch -a'Norman Stetter
In contrast to 'touching' a file without parameters 'touch -a' can only be performed by the file owner. In case of a shared sstate-cache served locally (e.g. over NFS), where the user running bitbake is not the owner of sstate-cache files, even if he has write access on group level, the sstate_unpack_package task will fail. Checking if the file is owned by the user before attempting to run 'touch -a' on it solves this. Signed-off-by: Norman Stetter <norman.stetter@garz-fricke.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-25kernel-yocto: add KBUILD_DEFCONFIG search location to failure messageBruce Ashfield
It was pointed out that since the check for the existence of KBUILD_DEFCONFIG knows where it is looking, that should be part of the error/log message. We only look in one location for the defconfigs, so add where we checked to the message. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-24qemuboot: Add QB_RNG variableKhem Raj
RNG passthru has been enabled on all qemu machines but its being added to each one of them, with this patch its turned into QB variables which defaults to host passthru, yet it can be overridden if needed via machine or config metadata if needed. Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-21testexport: rename create_tarball methodKonrad Weihmann
as otherwise when using it in combination with archiver.bbclass we would have 2 methods of the same name but with different signatures leading to various hard to understand exceptions Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-20image-artifact-names: make variables overridableJens Rehsack
Since the newly introduced image-artifact-names class is inherited at later processing stage, individual IMAGE_NAME settings are overridden (hopefully by accident instead on purpose). Allow derived distributions define their own name schema by setting defaults iwth question mark. Signed-off-by: Jens Rehsack <sno@netbsd.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-16kernel.bbclass: use camelCase notation for bash variables in do_deployMartin Jansa
* to match other variables there like deployDir imageType [YOCTO #12937] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-16kernel.bbclass: eliminate (initramfs_)symlink_name variablesMartin Jansa
* they are used only once, we can use the value directly * notice that .bin extension isn't part of the variable values [YOCTO #12937] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-16kernel.bbclass: use bash variables like imageType, base_name without {}Martin Jansa
* just to make sure it looks like bash variable not bitbake variable in run.do_* scripts [YOCTO #12937] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-16image-artifact-names: introduce new bbclass and move some variables into itMartin Jansa
* similar to kernel-artifact-names for other recipes/bbclasses which need to use some deployed artifacts * bitbake.conf: move IMAGE_BASENAME, IMAGE_VERSION_SUFFIX, IMAGE_NAME, IMAGE_LINK_NAME variables * image_types.bbclass: move IMAGE_NAME_SUFFIX variable * currently IMAGE_NAME_SUFFIX is used only by image.bbclass, image_types.bbclass and meta/recipes-core/images/build-appliance-image_15.0.0.bb but if it's needed by some recipe which isn't itself an image, then it's useful in bitbake.conf, e.g. we have a recipe for creating VirtualBox appliances which combines .wic.vmdk with .ovf file to create .zip with appliance, but for that we need the filename of .wic.vmdk which now contains IMAGE_NAME_SUFFIX https://github.com/webOS-ports/meta-webos-ports/blob/4980ce52a43ac6897657602810313af359f0b839/meta-luneos/recipes-core/images/luneos-emulator-appliance.inc#L24 * we were hardcoding .rootfs suffix where needed, but for quite long time it's configurable with IMAGE_NAME_SUFFIX since: commit 380ee36811939d947024bf78de907e3c071b834f Author: Patrick Ohly <patrick.ohly@intel.com> Date: Mon Mar 7 18:07:52 2016 +0100 image creation: allow overriding .rootfs suffix and might not match with hardcoded .rootfs, so make it easier to use IMAGE_NAME_SUFFIX where needed even without inheritting whole image_types.bbclass [YOCTO #12937] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-15insane: check for missing update-alternatives inheritAndrey Zhizhikin
Add a package QA check to test if the recipe sets ALTERNATIVE variable for any of its packages, and does not inherit update-alternatives class. This causes the do_rootfs to fail since a proper alternative cannot be created. Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-14wic/bootimg-efi: IMAGE_EFI_BOOT_FILES variable added to separate bootimg-efi ↵Khairul Rohaizzat Jamaluddin
and bootimg-partition Due to recent changes in bootimg-efi to include IMAGE_BOOT_FILES, when both bootimg-partition and bootimg-efi occur in a single .wks and IMAGE_BOOT_FILES are defined, files listed in IMAGE_BOOT_FILES will be duplicated in both partition. Since IMAGE_BOOT_FILES are crucial for bootimg-partition, but optional for bootimg-efi, hence allowing bootimg-efi to have the option to ignore it. The new variable, IMAGE_EFI_BOOT_FILES, was added to help handle this issue. Its basic usage is the same as IMAGE_BOOT_FILES. Usage example: ${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.ext4;rootfs.img \ This commit is also squashed with the updated testcase to cover for this change. [YOCTO #14011] Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-13populate_sdk_ext: Do not assume local.conf will always existKhem Raj
Some distros may not have local.conf, and use auto.conf or site.conf alone to describe distro config metadata, therefore make code robust to not fail eSDK builds for such setups Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-11cve-update-db-native: use fetch taskRoss Burton
Instead of inventing a new task to fetch the CVE data, use the existing fetch task. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-11license_image.bbclass: Fix symlink to the image license manifest dir creationDiego Sueiro
If IMAGE_LINK_NAME is empty don't try to create the symlink. [YOCTO #14042] Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-11linuxloader.bbclass: Define riscv32 ldso for muslKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-09cve-check: avoid FileNotFoundError if no do_cve_check task has runChris Laplante
For example, if you just run 'bitbake cve-update-db-native' in a clean build system, |cve_tmp_file| won't exist yet. Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-09cve-check/cve-update-db-native: use lockfile to fix usage under multiconfigChris Laplante
Previously CVE_CHECK_DB_FILE / CVE_CHECK_DB_DIR was the same across multiconfigs which led to a race condition wherein multiple cve-update-db-native:do_populate_cve_db tasks could attempt to write to the same sqlite database. This led to the following task failure: Error executing a python function in exec_python_func() autogenerated: 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_populate_cve_db(d) 0003: File: '/mnt/data/agent/work/74f119cccb44f133/yocto/sources/poky/meta/recipes-core/meta/cve-update-db-native.bb', lineno: 103, function: do_populate_cve_db 0099: if year == date.today().year: 0100: cve_f.write('CVE database update : %s\n\n' % date.today()) 0101: 0102: cve_f.close() *** 0103: conn.commit() 0104: conn.close() 0105:} 0106: 0107:def initialize_db(c): Exception: sqlite3.OperationalError: disk I/O error Use a lockfile to ensure multiple tasks don't step over each other. Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-08image.bbclass: fix REPRODUCIBLE_TIMESTAMP_ROOTFS referenceMatt Madison
Commit 97b439469a45a089431ca9c31893288c855045f4 added a fallback mechanism for getting the rootfs timestamp. However, it uses curly braces around the variable name, which causes bitbake resolve the variable reference, rather than the shell, so the git timestamp never gets used. Fix the reference to restore the intent of making it a fallback for when there is no git timestamp to retrieve. Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-05insane: only load real files as ELFRoss Burton
The file path checks are passed an ELF object if the file is an ELF. It doesn't make a lot of sense to load symlinks to ELFs as if they're in the same package then the real file will be checked too. This should speed up do_package_qa slightly as libraries won't be scanned repeatedly. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-03package.bbclass: hash equivalency and pr serviceMark Hatle
When the PR service is enabled a number of small changes may happen to variables. In the do_package step a call to package_get_auto_pr will end up setting PRAUTO and modifying PKGV (if AUTOINC is there). PRAUTO is then used by EXTENDPRAUTO, which is then used to generate PKGR. Since this behavior typically happens BEFORE the BB_UNIHASH is calculated for do_package, we need a way to defer the expansion until after we have the unihash value. Writing out the pkgdata files w/o AUTOPR and PKGV (AUTOINC) expanded to placeholder values is the easiest way to deal with this. All other variables are expanded as expected. In the next task, typically do_packagedata, we will then use the UNIHASH from the do_package to get the PR (AUTOPR) as well as generate the AUTOINC replacement value (now PRSERV_PV_AUTOINC). The do_packagedata then translates the placeholders to the final values when copying the data from pkgdata to pkgdata-pdata-input. Also update the prservice test case. With unihash, just changing the do_package (via a _append) will not change the PR. So write the date to a specific file that is incorporated into the unihash to ensure it is always different for the test. Various assert messages were also updated to make it easier to figure out where/why a problem occured. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-03kernel-yocto: only replace leading -I in include pathsYanfei Xu
We just want to remove the first '-I' in $d, hence removing the g' of sed avoid changing the real path which is include '-I' We also add an anchor to the regex to only match -I at the start of the path. Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-02insane: improve gnu-hash-style warningRoss Burton
Instead of showing a filename under packages-split, show the package name and filename inside the package. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-02insane: fix gnu-hash-style checkSumit Garg
Fix gnu-hash-style check that always returned True after commit [1] leading to false positive presence of "GNU_HASH" in objdump output. Fixes: 9ff90bf04a4c ("mips: Enable gnu-hash-style on glibc") [1] Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-02license_image.bbclass: Create symlink to the image license manifest dirDiego Sueiro
In the LICENSE_DIRECTORY each time an image recipe is built a new directory is created to hold the image license manifests. By creating a symlink to the most recent created image license manifest directory, we make things easier for users to collect and pack the data. Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-28kernel-yocto: checksum all modifications to available kernel fragments ↵Bruce Ashfield
directories This is based on the patch from Zhaolong Zhang <zhangzl2013@126.com> [kernel-yocto: checksum indirect cfg and scc files] While the recommended manner to share/reuse feature fragments is to maintain them in a kernel-meta repository and track the changes via the standard SRCREV fetcher mechanism, that method is not always practical for small sets of features or for quick testing of changes. These other flows use .scc files on the SRC_URI. It has been noted that config fragments or other features indirectly included by those .scc files will not trigger the kernel meta-data to be re-run and hence a build can continue with stale data (or not be triggered at all). To solve this issue, we can collect the directories that are searchable via FILESEXTRAPATHS and add them to the do_kernel_metadata task checksum. This allows modifications, additions and removals from the potential kernel feature directories to trigger a re-execution of the meta data task. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-28kernel.bbclass: Move away from calling package_get_auto_prMark Hatle
...instead we call read_subpackage_metadata. Calling package_get_auto_pr *should* result in the same PKGV AUTOINC replacement. However, it will also end up changing PKGR differently then do_package as the BB_TASKHASH used will be for the wrong task. Generally this won't cause any real-world issue, but it could cause problems. Moving to read_subpackage_metadata ensures that the values used in do_package will be read in and used for kernel deployment. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-28buildhistory.bbclass: Rework to use read_subpackage_metadataMark Hatle
Using this mechanism ensures that we have a single point to implement the loading of the package and subpackage meta data. This also then allows the buildhistory class to use the regular datastore vs it's own custom arrays for processing history items. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-28kernel-yocto: allow promotion of configuration warnings to errorsBruce Ashfield
It was requested to add the ability to upgrade configuration warnings to errors, so that they can't be missed in a build. Add a flag KMETA_AUDIT_WERROR, that when set, triggers a bb.fatal at the end of configuration checking if any warnings are found. This is off by default, but is available for those that want to enable it in their kernel recipe or bbappend. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-28package.bbclass: explode the RPROVIDES so we don't think the versions are ↵Ross Burton
provides emit_pkgdata() creates symlinks for each of the RPROVIDES in pkgdata/MACHINE/runtime-rprovides. However this string can contain versions which results in directories called (=2.32), so pass the RPROVIDES string through bb.utils.explode_deps() to strip the versions out. Helps mitigate - but not solve - #13999. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-27image_types_wic: Add ASSUME_PROVIDED to WICVARSVijai Kumar K
Add ASSUME_PROVIDED to WICVARS so that wic can use that when running on bitbake environment. This fixes the below build failure in do_image_wic when --include-path is used in wks file. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-26kernel.bbclass: Remove do_install[prefunc] no longer neededMark Hatle
Prior work has refactored the do_install task multiple times, and any references to PKGV and PKGR (even indirect ones) have been removed. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-26package_tar.bbclass: Sync to the other package_* classesMark Hatle
Sync up the anonymous python definition with the other package_*.bbclass files. This should make future maintenance easier, even though it has no difference in behavior from what was there. Additional, there was a missing deltask in the nopackages.bbclass related to the package_tar which has been corrected. This could cause problems on native recipes when package_tar was enabled. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-26kernel.bbclass: run do_symlink_kernsrc before do_patchRasmus Villemoes
There's a race between do_symlink_kernsrc and do_populate_lic, since the latter is ordered "after do_patch"; so the two may run in parallel. In some cases, that actually causes do_populate_lic to fail if it happens to look for a license file somewhere under ${S} in the short window after shutil.move and before the symlink has been created. Fix that by simply ordering symlink_kernsrc before do_patch. Any task that pokes around in ${S} looking for files should be ordered after do_patch, so this should also fix similar latent races with other ad hoc tasks. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-22nativesdk-sdk-provides-dummy: Add /bin/shRichard Purdie
By doing this we can revert b18c32ab6bc9c4f1953e9f79aa39bc92d1c4e30d which was a pretty ugly hack anyway and now means the different providers are all being handled consistently. Anyone with SDK recipes will need to ensure nativesdk-sdk-provides-dummy is included in those builds (or an equivalent). This is a good thing to do anyway. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-20package.bbclass: Sort shlib2 output for hash equivalencyMark Hatle
The output was unsorted, so different versions of python, different input ordering could have have changed the files, and thus changed the hashes making the system think the output was different, even when unmodified. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-15packagefeed-stability: Remove as obsoleteRichard Purdie
This class had great ideas and potential but now we have hash equivalence and reproducibility, its effectively obsolete. I'm not aware of any serious use of the class, we certainly don't get bug reports or patches so remove it and focus on those other areas. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-13kernel-yocto: split meta data gathering into patch and config phasesBruce Ashfield
do_kernel_metadata gathers and sanitizes the meta-data that is used in later steps of the kernel-yocto build process. The processing takes the form of configuration and patch gathering. The current single pass of both config and patch gathering means that patches can't modify in-tree configuration elements (although this makes tracing configuration changes harder, it is a valid workflow). We can divide the routine into a patch and configuration phase, and call the config variant after patching is done. This keeps the common parts of the gahering intact, but allows us flexibilty in when the stages happen. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-13kernel-yocto: set cwd before querying the meta data dirBruce Ashfield
To aid classifying options and streamling reports, fragments and classification info are consolidated into a kernel meta directory. The name of the meta directory is (somewhat) flexible, and hence is queried by the tools and created if it doesn't exist. The recent enhancements to the .config auditing introduced a new query for the meta directory, but isn't being run in the kernel's source directory .. and is hence creating an unwanted file in $TOPDIR. We set the kernel source directory as the cwd for the call, and everything goes back to where it belongs. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-13kernel.bbclass: Configuration for environment with HOSTCXXZhang Qiang
When compiling xilinx-zynq board linux-kernel-dev(v5.8) if "GCC_PLUGINS=y", The following error will appear: "HOSTCXX -fPIC scripts/gcc-plugins/arm_ssp_per_task_plugin.o fatal error: gmp.h: No such file or directory" the GCC_PLUGINS depend on return result of gcc-plugin.sh execution however in gcc-plugin.sh use HOSTCC to detect the feature of GNU extension of gcc, this will result that HOSTCC can compile the file successfully, but HOSTCXX is used in the actual compilation process. Signed-off-by: Zhang Qiang <qiang.zhang@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-10cmake.bbclass: Rework compiler program variables for allarchNathan Rossi
CMake projects can specify the NONE project type. Projects that do this do not use any C or C++ compiler, this currently works fine with caveat that when changing the machine/arch the compiler is different causing signature hash differences. To avoid the signature hash differences clear the associated C/CXX compiler variables. In order to achieve this with overrides, simplify the existing construction of the values using a python function and variable setting and remove the anonymous variable setup. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-08uninative: Handle PREMIRRORS genericallyRichard Purdie
Currently uninative handles SOURCE_MIRROR_URL but not generic PREMIRRORS. It can handle this better, attempt to iterate PREMIRRORS entries. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-08populate_sdk_ext: Ensure buildtools doesn't corrupt OECORE_NATIVE_SYSROOTRichard Purdie
buildtools is built as a nativesdk which needs to use OECORE_NATIVE_SYSROOT for its own purposes and can reset it. Save and restore the value within the eSDK so the two don't clash. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-08kernel-yocto: enhance configuration queue analysis capabilitiesBruce Ashfield
Enable the kernel-yocto bbclass to use enhanced capabilities from the kern-tools symbol_why.pl. We bump the kern-tools SRCREV to pickup the reworking of symbol_why, which uses Kconfiglib to provide analysis on configuration values. This is useful for debugging why a symbol specified in a fragment did not end up in the final .config. We introduce two ways to interact with the new symbol_why: 1) a replacement of the existing kconf_check script 2) a dedicated task that is explicitly invoked to dump details on the configuration. The kconf_check replacement is transparent to the user, and is run in exactly the same way as it was previously. But we get better output and more detailed diagnostics if there are symbols that don't make it into the final .config The second way to interact with symbol why is via the new task do_config_analysis. This is invoked like any other task, and by default will provide a full configuration analysis and point the user at files to look at for details. If a more targetted analysis is desired, then specific symbols can be set in the CONFIG_ANALYSIS variable. When this variable is set, the task will only run for the given symbols and provide per-variable links to the user. This variable can be set like any other, including specification in the local.conf: CONFIG_ANALYSIS_pn-linux-yocto-dev = 'NF_CONNTRACK LOCALVERSION' Which produces output as follows: WARNING: linux-yocto-dev-5.8-rc++gitAUTOINC+d22beb8f8a_8fc484ed37-r0 do_config_analysis: Configuration analysis executed, see: tmp/work/qemuarm64-poky-linux/linux-yocto-dev/5.8-rc++gitAUTOINC+d22beb8f8a_8fc484ed37-r0/NF_CONNTRACK-config-analysis.txt for details WARNING: linux-yocto-dev-5.8-rc++gitAUTOINC+d22beb8f8a_8fc484ed37-r0 do_config_analysis: Configuration audit executed, see: tmp/work/qemuarm64-poky-linux/linux-yocto-dev/5.8-rc++gitAUTOINC+d22beb8f8a_8fc484ed37-r0/NF_CONNTRACK-config-audit.txt for details WARNING: linux-yocto-dev-5.8-rc++gitAUTOINC+d22beb8f8a_8fc484ed37-r0 do_config_analysis: Configuration analysis executed, see: tmp/work/qemuarm64-poky-linux/linux-yocto-dev/5.8-rc++gitAUTOINC+d22beb8f8a_8fc484ed37-r0/LOCALVERSION-config-analysis.txt for details WARNING: linux-yocto-dev-5.8-rc++gitAUTOINC+d22beb8f8a_8fc484ed37-r0 do_config_analysis: Configuration audit executed, see: work/qemuarm64-poky-linux/linux-yocto-dev/5.8-rc++gitAUTOINC+d22beb8f8a_8fc484ed37-r0/LOCALVERSION-config-audit.txt for details Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-08cml1: Add the option to choose the .config root dirDiego Sueiro
Introduce the KCONFIG_CONFIG_ROOTDIR variable to allow recipes which the .config file is not under the ${B} to select the root directory location for the config file. Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-08kernel-fitimage: build configuration for image tree when dtb is not presentUsama Arif
This patch adds support for adding configuration node even when dtb is not part of the FIT image. The conf and default node number are therefore changed to point to kernel ID rather than dtb ID when dtb does not exist. Signed-off-by: Usama Arif <usama.arif@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-06kernel-devicetree: Fix intermittent build failures caused by DTB buildsTyler Hicks
Fix a build-time race condition that resulted in intermittent build failures in the do_assemble_fitimage task. The race condition involved the do_assemble_fitimage task reading the vmlinux file while the do_compile_kernelmodules task was re-writing the vmlinux file. This can be seen with an aarch64 image build that uses a 5.4 based kernel and sets KERNEL_DEVICETREE. The problem is that the do_compile snippet that the kernel-devicetree class appends did not specify the full kernel build environment when building the DTB(s) from the kernel tree. This resulted in CONFIG_CC_CAN_LINK=y being removed from the kernel config file just before the do_compile task completed. The CONFIG_CC_CAN_LINK=y line was then re-inserted into the kernel config file as part of the do_compile_kernelmodules task. In some cases, this resulted in the do_compile_kernelmodules task to re-link vmlinux which sometimes occured at the same time that the do_assemble_fitimage task was attempting to use vmlinux. The do_assemble_fitimage task would fail with the following error message: aarch64-poky-linux-objcopy:vmlinux: file format not recognized We can use the pine-a64-lts machine, from the meta-pine64 layer, to show that the kernel config file was changed between do_compile and do_compile_kernelmodules: $ C=tmp/work/pine_a64_lts-poky-linux/linux-pine64/5.7+gitAUTOINC+ae03bade3b-r0/linux-pine_a64_lts-standard-build/.config $ bitbake -c do_kernel_configcheck virtual/kernel ... $ md5sum $C; grep CC_CAN_LINK $C 32b133cf8a749a91f698a7ca8616c84f ... CONFIG_CC_CAN_LINK=y $ bitbake -c do_compile virtual/kernel ... $ md5sum $C; grep CC_CAN_LINK $C 2fd2ec2a66eecc329dcb5afaf005eada ... $ bitbake -c do_compile_kernelmodules virtual/kernel ... $ md5sum $C; grep CC_CAN_LINK $C 32b133cf8a749a91f698a7ca8616c84f ... CONFIG_CC_CAN_LINK=y With this change, the do_compile snippet appended by the kernel-devicetree class does not modify the kernel config. The kernel config is unchanged across the do_compile and do_compile_kernelmodules tasks and do_compile_kernelmodules will not attempt to re-link vmlinux. Signed-off-by: Tyler Hicks <tyhicks@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-06kernel/yocto: allow dangling KERNEL_FEATURESBruce Ashfield
KERNEL_FEATURES are explicitly checked by the kern-tools, and trigger and error when not present. This is since the KERNEL_FEATURES are specified by layers or BSPs as elements that are requied for correct operation. That being said, in order to support more kernel recipes that are using fragments, but not necessarily the yocto kernel-cache for meta-data, this change introduces: KERNEL_DANGLING_FEATURES_WARN_ONLY As you'd expect, when set, missing kernel features only print a message and warn that runtime issues may occur, but otherwise allow the kernel configuration and build process to continue. This was noticed/required when meta-virtualization adopted a more generic kernel bbappend (to serve the needs of more layers in the ecosystem), but also specifies some KERNEL_FEATURES. If layers using a recipe derived from kernel-yocto, but not the main kernel-cache, used meta-virtualization and error would be thrown due to missing features. We now can both allow them to continue, and also provide a more useful message to resolve the issue. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-06meson.bbclass: add a cups-config entryAlexander Kanavin
This is required by newer meson versions in cross builds, as acknowledgement that the tool in PATH is ok to use. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>