aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
AgeCommit message (Collapse)Author
2017-12-10kernel-yocto: ensure that only a single defconfig is processedBruce Ashfield
As a follow up to the changes to ensure that KBUILD_DEFCONFIG will always get its defconfig into the processing, we also should ensure that we don't get both a KBUILD_DEFCONFIG and a SRC_URI defconfig in the configuration queue. If both are in the configuration queue, we end up with competing values and a potentially long running check of 5000+ options x 2 against the final .config. By removing the defconfig found from the SRC_URI when one is found via KBUILD_DEFCONFIG, we ensure that only one will be processed. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10kernel-yocto: Stop the build if defconfig is missingSaul Wold
The bberror does not stop the build correctly, this should be a bbfatal_log to ensure the failure correctly stops the build and logs the failure. Part of [YOCTO #12162] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10kernel-yocto: ensure sccs variable is set when using KBUILD_DEFCONFIGSaul Wold
When using KBUILD_DEFCONFIG, $sccs should be set to the $WORKDIR/defconfig regardless if it compares or is copied. Otherwise $sccs is not set and the defconfig is not found correctly. Part of [YOCTO #12162] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-24kernel-yocto: relax BSP definition testBruce Ashfield
commit 44aea7b873 [kernel-yocto: ensure that only valid BSPs are built] introduced a new check to ensure that a valid BSP definition was found, rather than building something that 'closely' matched the current MACHINE. This check breaks valid configurations which do not have a bsp definition but are otherwise completely configured machines. To allow both elements to co-exist (and not add warnings or errors to otherwise valid builds), we first check to see if an empty bsp definition was found, but then check to see if a defconfig was provided. If a defconfig has been provided, that is a sign that the board configuration is complete and we should continue the build without otherwise bothering the user. Tested on meta-raspberrypi and linux-yocto* Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-24kernel-yocto: fix typo in error messageLuca Ceresoli
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23kernel-yocto: ensure that only valid BSPs are builtBruce Ashfield
There was a bug in the search routines responsible for locating BSP definitions which returned a valid match if only the ktype matched. This meant that someone looking for "qemux86foo" (which is an invalid definition) would potentially end up building "qemuarm" and be none the wiser (until it didn't boot). With this fix to the tools search routine, and improved return code testing, we will now stop the build and report and error to the user. [YOCTO: #11878] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-17kernel-yocto: propagate configuration errors to bbclassBruce Ashfield
As pointed out by klapperichpaul@johndeere.com, missing configuration fragments were being picked up twice, once by the tools and once by the bbclass. Unfortunately, the tools error message was being detected as configs, and hence no error was reported at all. Rather than catching the output of the tools, we can instead check the return code and propagate the error message from the tools directly to the user. [YOCTO #11649] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-04-28kernel-yocto/kern-tools: fix do_validate_branches clean stageBruce Ashfield
It was reported that do_validate_branches was failing with the following error: Log data follows: | DEBUG: Executing shell function do_validate_branches | HEAD is now at fe0fb8d Merge tag 'v4.10.9' into standard/base | mkdir: cannot create directory .: File exists | | [ERROR] Can't find patch dir at ./patches/standard/base | usage: kgit s2q | WARNING: exit code 1 from a shell command. | ERROR: Function failed: do_validate_branches This was triggered by the execution of 'kgit-s2q --clean' after forcing the SRCREV to something other than the tip of the branch. --clean is being run to remove any sentinel files from previous kernel builds to ensure that the tree is in a consistent state. There were two bugs, --clean was being executed and not exiting the script as it was supposed to. Hence validation for applying patches was done, and threw the error that eventually makes it to the console. And the second bug is that since do_validate_branches actually calls kgit-s2q --clean, the dependency on kern-tools-native needs to be on that function (versus do_kernel_metadata which runs later). With the tweaked kern-tool + the dependency fix, we no longer see this error. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-19kernel-yocto: trivial: remove extra } from bsp_definitionBruce Ashfield
A typo introduced an extra } in the logging of the bsp_definition. While this won't cause problems .. it needs to be fixed! Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-19kernel-yocto.bbclass: ensure repatching when HEAD is checked outAwais Belal
In some cases it is seen that kernel_checkout and validate_branches are run again in simultaneous builds. During do_patch the kgit-s2q mechanism looks for a sentinel file inside the .git directory, finds a fence post and starts picking up patches after that. This can create trouble as validate_branches checks out the HEAD of the branch and so the patches should be reapplied rather than skipped due to finding of the fence post. We can call kgit-s2q --clean to remove the sentinel file when the branches are checked out. Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-05kernel-yocto: log the BSP definition fileBruce Ashfield
When debugging a kernel configuration issue, one of the first questions is "what BSP was used". To answer this qusetion, we log the BSP .scc file that was used to generate the kernel configuration in the kernel source meta directory. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-05kern-tools: re-enable scc merge commandBruce Ashfield
The ability to merge two branches directly from a .scc file was dropped during the streamlining of the tools. As was pointed out by David Vincent <freesilicon@gmail.com>, there is once again a valid use case for this functionality, so we restore the capability. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-06meta/scripts: Various getVar/getVarFlag expansion parameter fixesRichard Purdie
There were a few straggling expansion parameter removals left for getVar/getVarFlag where the odd whitespace meant they were missed on previous passes. There were also some plain broken ussages such as: d.getVar('ALTERNATIVE_TARGET', old_name, True) path = d.getVar('PATH', d, True) d.getVar('IMAGE_ROOTFS', 'True') which I've corrected (they happend to work by luck). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVar callsJoshua Lock
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-13kernel-yocto: explicitly trap subcommand errorsBruce Ashfield
To trap errors and halt processing, do_kernel_metadata was recently switched to exit on any non zero return code. While the concept is sound, there are subcommands that have legitimate non-zero return codes. Instead of removing set +e, we'll explicitly check the return code of the commands that can error, and throw a bbfatal to alert the user. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-07kernel-yocto: exit on non-zero return codeBruce Ashfield
Historically the processing of kernel meta data contained some commands that exited with a non-zero return code. Special processing was required to properly deal with their exit. That is no longer true, and instead of handling all return codes and doing an explicit 'exit' call, we can remove set -e from the routine and have all errors be trapped and stop processing. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-10-07utils.bbclass: add function to check for git config userStephano Cetola
If attempting to patch a git repo without a proper git config setup, an error will occur saying user.name/user.email are needed by git am/apply. After some code was removed from kernel-yocto, it was simple enough to reproduce this error by creating a kernel patch and using a container to build. This patch abstracts out functionality that existed in buildhistory for use in other classes. It also adds a call to this functionality to the kernel-yocto class. Fixes [YOCTO #10346] introduced in OE-core revision 0f698dfd1c8bbc0d53ae7977e26685a7a3df52a3 Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-14kernel-yocto: remove do_shared_workdir from SRCTREECOVEREDTASKSAndré Draszik
Various recipes depend on the kernel's do_shared_workdir task, a quick grep suggests all external kernel modules (via module.bbclass), but also perf, and potentially any additional headers as outlined in linux-libc-headers.inc are affected. Having do_shared_workdir in SRCTREECOVEREDTASKS means this task is removed when externalsrc is enabled, making all those recipes fail as the task they depend on, virtual/kernel:do_shared_workdir, doesn't exist. Remove do_shared_workdir from SRCTREECOVEREDTASKS so that all those recipes work even if externalsrc is activated. According to the comment in here, the reason for do_shared_workdir to be removed as a task is because it modifies the source tree, but that doesn't seem to be case. Signed-off-by: Andre Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08kernel-yocto: allow --allnoconfig and --alldefconfig as KCONFIG_MODESBruce Ashfield
Previously merge_config.sh was wrapped by the configme script, configme took the different KCONFIG_MODES as options, and used --allnoconfig or --alldefconfig. With the switch to merge_config.sh no longer being wrapped, the new processing wasn't matching the existing values and only supported allnoconfig or alldefconfig. To avoid breaking existing layers, and also keep any working that have already switched, we can make the case statement match both. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08kernel-yocto: restore kernel-meta data detection for SRC_URI elementsBruce Ashfield
Before the kernel tools were simplified and streamlined, there was code which not only migrated a patch/cfg/scc to the kernel build tree, it also migrated any subdirectories of those patches. The effect of this data migration was that any other meta data in a patch's directory structure would be available for processing. While we don't want to do this migration anymore, it is possible to check the path of any SRC_URI patches, and if they include a "kernel-meta" subdirectory add it to the search path. This restores the functionality without the old complexity. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-05kernel-yocto: do_kernel_configme: Fix silent sysroot poisoning errorIoan-Adrian Ratiu
do_kernel_configme calls merge_config.sh (installed in the sysroot by the kern-tools-native recipe) which may invoke the compiler to complete the configuration process. Depending on the build (and dependencies), this may error due to sysroot poisoning [1]. The errors are similar to: make[1]: Entering directory '4.1+gitAUTOINC+a7e53ecc27-r0/linux-x64-standard-build' HOSTCC scripts/basic/fixdep work-shared/x64/kernel-source/scripts/basic/fixdep.c:106:23: fatal error: sys/types.h: No such file or directory compilation terminated. make[2]: *** [work-shared/x64/kernel-source/scripts/basic/Makefile:22: scripts/basic/x86_64-nilrt-linux-fixdep] Error 1 Adding $TOOLCHAIN_OPTIONS to $CFLAGS before calling merge_configs.sh fixes the error because $TOOLCHAIN_OPTIONS defines the sysroot and make uses it to correctly compile & fill all missing kernel config options. [1] http://lists.openembedded.org/pipermail/openembedded-core/2014-October/098253.html Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-05kernel-yocto: test for empty artifactsBruce Ashfield
With the updated kernel tools, we generate a list of sccs, patches, configs and BSP definitions as part of the meta data generation. It is valid if there aren't any of these artifacts found (i.e. you are just building a branch and a default config), but invoking the tools with no inputs isn't a good idea. To avoid this issue, we generate a string based on the artifacts and skip calling the tools if there's nothing to do. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18kernel-yocto: streamline patch, configuration and audit phasesBruce Ashfield
We've been running with a set of kern-tools that were designed to work with build systems that knew nothing about git, trees, commits, etc. As such, there's been a set of shims/wrappers in place to work with within bitbake/oe-core. These were the *me scripts: createme, updateme, patchme and configme. With this commit, we strip that legacy code and use the tools directly. This means less complexity, fewer corner cases .. and no surprises when the tools are arunning. As another benefit, the tools consume much less time during a typical build and have no noticeable impact on the overall build time. Existing .scc files, features, and processing are not impacted as these tools are compatible with existing feature descriptions and kerne configuration fragments. The audit of kernel configuration fragments is now detached from the linux-yocto build structure and process. This means that they can eventually be tweaked to offer kernel audit to any type of kernel build and configuration process. Additionally, the kernel symbol audit phase can now resolve symbol dependencies and offer guidance when a symbol is missing: WARNING: linux-yocto-4.4.15+gitAUTOINC+b030d96c7b_f5e2c49d58-r0 do_kernel_configcheck: [kernel config]: specified values did not make it into the kernel's final configuration: ---------- CONFIG_BT_6LOWPAN ----------------- Config: CONFIG_BT_6LOWPAN From: /home/bruce/poky/build/tmp/work-shared/qemux86-64/kernel-source/.kernel-meta/configs/standard/features/bluetooth/bluetooth.cfg Requested value: CONFIG_BT_6LOWPAN=y Actual value: Config 'BT_6LOWPAN' has the following conditionals: BT_LE && 6LOWPAN (value: "n") Dependency values are: BT_LE [y] 6LOWPAN [n] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-09kernel-yocto: allow branch auditing to be suspendedBruce Ashfield
When working on the yocto-bsp and kernel-lab update for yocto 1.2 we found it was impossible for a end-user BSP to isolate patches on a branch, since with the following commit: [kernel-yocto: enforce SRC_URI specified branch] Any new branch would be switched to whatever was specified on the SRC_URI and undoing the work that the yocto-bsp tool did to support board specific patches. To fix this, we'll keep the enforcing of branch consistency enabled by default, but introduce a variable "KMETA_AUDIT" that when not set will skip the check. There's no impact for existing users, and it is only something that other plumbing commands and tools will need to use (or care about). [YOCTO: #9120] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-04-03kernel-yocto: enforce SRC_URI specified branchBruce Ashfield
During the simplication and cleanup of branches and kernel meta data handling, the ability to force build a branch that didn't match the meta data was dropped. There are valid uses cases when a different branch should be built (testing, development, etc), so we restore the capability with this change. If after the kernel meta data is processed the current branch does not match the SRC_URI specified branch, a warning is generated about the impending branch switch and that the user should double check that they are building what they expect. WARNING: After meta data application, the kernel tree branch is standard/base. The WARNING: SRC_URI specified branch standard/gt. The branch will be forced to standard/gt, WARNING: but this means the board meta data (.scc files) do not match the SRC_URI specification. WARNING: The meta data and branch standard/gt should be inspected to ensure the proper WARNING: kernel is being built. Reported-by: Steve Sakoman" <steve.sakoman@intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-17kernel-yocto.bbclass: move do_kernel_link_vmlinux() into kernel.bbclassAndre McCurdy
Move do_kernel_link_vmlinux() from kernel-yocto.bbclass into kernel.bbclass so that it's available to any kernel recipe. Note that the task is not enabled by default in kernel-yocto.bbclass, so don't enable by default in kernel.bbclass either. To enable, see the example in linux-yocto.inc, ie: addtask kernel_link_vmlinux after do_compile before do_install Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-17kernel-yocto.bbclass: remove do_kernel_link_vmlinux from SRCTREECOVEREDTASKSAndre McCurdy
The do_kernel_link_vmlinux() task modifies the build directory (not the source tree) and should not be skipped when externalsrc is being used. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-27kernel-yocto: fix checkout bare-cloned kernel repositoriesJianxun Zhang
The existing code doesn't tell regular (with .git) and bare cases and just move the unpacked repo to the place of kernel source. But later steps will fail on a bare-cloned repo because we can not checkout directly in a bare cloned repo. This change performs another clone to fix the issue. Note: This change doesn't cover the case that S and WORKDIR are same and the repo is bare cloned. Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-24linux-yocto: skip kernel meta data branches when finding machine branchBruce Ashfield
Before the fetcher validated the specified SRCREV was reachable on a specified branch, linux-yocto style kernel's were comparing the value of KBRANCH and branch on the SRC_URI and then allowing a SRC_URI specified branch to override KBRANCH. With the introduction of kernel meta data on the SRC_URI, this routine is incorrectly picking up a kernel-cache repository and then attempting to apply that branch information to the kernel repository. The rationalization of the branch specification is largely no longer required, and will may be removed in the future. But for now, to keep changes minimal, we can simply not return branch information that comes from kernel meta data by checking the 'type' parameter and skipping if it is of type 'kmeta'. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09kernel-yocto.bbclass: do_kernel_metadata depends on do_unpackMarkus Lehtonen
Make sure that 'do_unpack' is executed before 'do_kernel_metadata'. Enabling externalsrc for kernel disables 'do_validate_branches' task which caused 'do_kernel_metadata' to fail as the dependency chain to 'do_unpack' got broken. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25linux-yocto: split meta data from kernel repositoryBruce Ashfield
The linux-yocto tree has always been a combined set of kernel changes and configuration (meta) data carried in a single tree. While this format is effective at keeping kernel configuration and source modifications synchronized, it isn't always obvious to developers on how to manipulate the meta data versus the source. With this change, we remove the meta data processing from the kernel-yocto class and use the external meta-data repository that has always been used to seed the linux-yocto meta branch. After this change, linux-yocto can no longer process combined trees, and is simplified as a result. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16Use die() or bbfatal_log() where the log should definitely be printedPaul Eggleton
Change calls to bbfatal() to either die() or bbfatal_log() where we know we want the full log to be printed by the UI (calling bberror or bbfatal would otherwise suppress it since the change to connect these functions through to the UI.) bbfatal() is still fine to use where there is enough context information in the message such that the log isn't needed. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-07-16kernel-yocto: fix machine_srcrev check in do_patchPetter Mabäcker
do_patch is currently doing checks with machine_srcrev without initiate it which leads to below (additional debug added): DEBUG: Executing shell function do_patch . . . + [ 0 -ne 0 ] + [ != AUTOINC ] + git rev-parse --verify ~0 fatal: Needed a single revision + git merge-base HEAD usage: git merge-base [-a|--all] <commit> <commit>... or: git merge-base [-a|--all] --octopus <commit>... or: git merge-base --independent <commit>... or: git merge-base --is-ancestor <commit> <commit> or: git merge-base --fork-point <ref> [<commit>] -a, --all output all common ancestors --octopus find ancestors for a single n-way merge --independent list revs not reachable from others --is-ancestor is the first one ancestor of the other? --fork-point find where <commit> forked from reflog of <ref> + [ = ] + set +x DEBUG: Shell function do_patch finished Only reason it works today is because 'rev-parse/merge-base' with empty machine_srcrev will result in "false positive". Solve this by adding a similar non-empty check and use SRCREV as fallback as in 'do_kernel_metadata' Signed-off-by: Petter Mabäcker <petter@technux.se> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-05-22linux-yocto: drop suggestion of devshell for patch failuresBruce Ashfield
When a patch fails to apply, the kernel-yocto bbclass attempted to be helpful and suggest that devshell be used to fix the issue. The only problem is that you can't get to devshell if a patch is failing. We drop this bad advise and instead point to the linux source directory. [YOCTO: #6202] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-05-09kernel-yocto: propagate in tree defconfigs to WORKDIRBruce Ashfield
As reported by Steffen Pankratz <Steffen.Pankratz@elektrobit.com>, the previous logic of KBUILD_DEFCONFIG processing would not propagate an in tree defcofig to WORKDIR if one was not already present. We fix the propagation by copying the in tee config if a defconfig is not already in WORKDIR. Additionally we only warn (versus copying) if an in tree configuration is specified, is different than the WORKDIR version and isn't copied. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-09linux-yocto: fix race between checkout and meta data generationBruce Ashfield
There are two tasks that must run before a linux-yocto kernel is built. - Kernel checkout and relocation to work-shared (kernel_checkout) - Meta data gathering and configuration prep (kernel_metadata) The current task definitions for both are simply "before do_patch", which is correct, but kernel_checkout must run before and not race with kernel_metadata. So we set the definition of kernel_checkout to be more specific and enforce the proper ordering. [YOCTO: #7731] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-29kernel-yocto: merge duplicate kernel_configme task definitionsRoss Burton
The kernel_configme task was added twice (once in the .bbclass, one in a .inc) with different ordering constraints. Change this to be just one definition in the bbclass with the stronger ordering constraints. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-29linux-yocto: add kern-tools-native to kernel_metadata dependsRoss Burton
The autobuilder failed like this: temp/run.do_kernel_metadata.25242: line 165: createme: command not found createme is provided by kern-tools-native. do_patch has a dependency on kern-tools-native, but do_kernel_metadata runs before do_patch. So move the dependency from do_patch to do_kernel_metadata, moving the statement from the .inc to the class so it's alongside the task definition. [ YOCTO #7531 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-24kernel-yocto: allow in-tree defconfigsBruce Ashfield
In a similar manner to the kernel itself, which does the following to bring a defconfig into the configuration: defconfig: $(obj)/conf ifeq ($(KBUILD_DEFCONFIG),) $< --defconfig $(Kconfig) else @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) endif We do the same with the linux-yocto configuration processing. If a defconfig is specified via the KBUILD_DEFCONFIG variable, we copy it from the source tree, into a common location and normalized "defconfig" name, where the rest of the process will include and incorporate it into the configuration process. If the fetcher has already placed a defconfig in WORKDIR (from the SRC_URI), we don't overwrite it, but instead warn the user that SRC_URI defconfigs take precedence. [YOCTO: #7474] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20kernel-yocto: split meta data generation from patching phaseBruce Ashfield
The linux-yocto kernel has a meta-data component which accompanies the actual tree. That meta-data is processed to generate a series file that controls the patching and configuration of the kernel. patching and configuration are two distinct phases, so when working on kernel configuration, it doesn't make sense to always have to re-run the patching step just to update configuration data in the meta-series. To allow a more granular set of tasks, we break the meta-data generation into a separate task, which runs before do_patch. This allows the task to be explicitly called when working on configuration, but otherwise has no impact on the build. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-03-02kernel-yocto: inhibit BSP description warnings for custom linux-yocto kernelsBruce Ashfield
We don't require that a yocto custom kernel + defconfig have a full BSP description (but of course it would be better if they did). Since this isn't a requirement, we shouldn't alarm users by generating a BSP description warning. To implement this, we add a bsp audit level flag (like the one that exists for kconfig audits), and only set it to activate in the versioned linux-yocto recipes. [YOCTO: #7370] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23classes/kernel-yocto: extend SRCTREECOVEREDTASKSPaul Eggleton
* Add do_shared_workdir which was added recently * Add do_fetch and do_unpack to this list, because at the moment if you enable externalsrc through a bbappend the += in this class wipes out the original value from externalsrc (which is set with ?=) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21linux-yocto: warn when a generated BSP description is usedBruce Ashfield
The meta data (in tree or out of tree) that describes a BSP, its patches and configuration is not always available when a new/default or manually configured machine is built. When this happens, the tools generate a skeleton BSP and use a architecture defconfig for the build. If this is by design, the build is typically sane and everything works fine. If an existing BSP description was expected, chances are that the resulting kernel will not be correct. To avoid surprising the user when a default/skeleton BSP is used for the build, we can make it obvious to the user by emitting a warning like the following: WARNING: [kernel]: An auto generated BSP description was used, this normally indicates a misconfiguration. Check that your machine (myqemux86-64) has an associated kernel description. [YOCTO: #3383] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-20linux-yocto: make kernel configuration audit user visibleBruce Ashfield
After a linux-yocto style kernel is configured, a kernel configuration audit is executed to detect common errors or issues with the config. This output used to be visible, but was made less obvious to not alarm users unnecessarily (since some configuration issues are acceptable). There are some classes of configuration issue that are worth being visible, and that is specified configuration values that do not make the final .config. These dropped options can result in any number of runtime failures, so flagging them at build time makes sense. The visibility of auditing is controlled by KCONF_AUDIT_LEVEL: 0: no reporting 1: report options that are specified, but not in the final config 2: report options that are not hardware related, but set by a BSP The default level is 1, with level 2 and above being for BSP development only. If these conditions are detected, warnings will be generated as follows: WARNING: [kernel config]: specified values did not make it into the kernel's final configuration: Value requested for CONFIG_SND_PCSP not in final ".config" Requested value: "CONFIG_SND_PCSP=y" Actual value set: "" or WARNING: [kernel config]: BSP specified non-hw configuration: CONFIG_BLOCK CONFIG_CFG80211_WEXT CONFIG_CORDIC CONFIG_CRC8 CONFIG_EFIVAR_FS CONFIG_EFI_PARTITION CONFIG_NET CONFIG_NETDEVICES CONFIG_PARTITION_ADVANCED CONFIG_WEXT_CORE CONFIG_WEXT_PROC CONFIG_WIRELESS At this point thse are only a warnings, since there needs to be time for layers and configuration fragments to be validated against this new check. [YOCTO: #6943] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-01-29kernel-yocto.bbclass: Bug Fix inside do_kernel_checkout()Theodor Gherzan
--047d7b3a7fac0eebee050cb47483 Content-Type: text/plain; charset="UTF-8" After we check the existence of 'machine_branch' with 'git show-ref' the following if statement should change the 'machine_branch' to the default (i.e. master) if the 'git show-ref' has returned an exit code that is not 0, not the other way around. Signed-off-by: Theodor Gherzan <theodor@resin.io> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-01-16kernel-yocto: remove GUILT_BASE from terminal exportsBruce Ashfield
guilt is no longer used to manage linux-yocto kernel pathes, so we no longer need to export variables that it needed to locate patches in the tree. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-20kernel-yocto: make sure git tags get dereferenced properly in do_patch()Jeff Wang
Commit 92c1ece6c347030d48995a36f4c67861356e59d3 causes the test in do_patch() in kernel-yocto.bbclass to fail if ${machine_srcrev} is an annotated tag. The check is meant to ensure that ${machine_srcrev} is an ancestor of HEAD, but if ${machine_srcrev} is a tag, then "$(git rev-parse --verify ${machine_srcrev})" evaluates to the SHA of the tag instead of what it's pointing to. Replacing "$(git rev-parse --verify ${machine_srcrev})" with "$(git rev-parse --verify ${machine_srcrev}~0)" fixed the problem by finding the object pointed to by the tag, and not the tag itself. This also works for commit IDs that are not tags, hence is safe in a scenarios. Jeff Wang <jeffrey.wang@ll.mit.edu> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2014-12-20kernel-yocto: fix non-git buildsBruce Ashfield
The ability to build non-git repositories was broken by two changes: - The existence of an empty 'patches' directory created during the unpack phase. This dir was incorrectly identified as a valid meta directory and broke the build. By ensuring that it is removed before creating the empty repository, it will no longer be found instead of the real meta directory. - The attempt to reset the git repository to a specific SRCREV when no SRCREV was provided. By checking for a SRCREV of 'INVALID', we avoid any processing and failed git operations. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2014-12-20kernel: Rearrange for 1.8Richard Purdie
In 1.8 we want to streamline the kernel build process. Basically we currently have multiple copies of the kernel source floating around and the copying/compression/decompression is painful. Lets assume we have a kernel source per machine since in most cases this is true (and we have a sysroot per machine anyway). Basically, instead of extracting a source into WORKDIR, then copying to a sysroot, we now set S to point straight at STAGING_DIR_KERNEL. Anything using kernel source can then just point at it and use: do_configure[depends] += "virtual/kernel:do_patch" to depend on the kernel source being present. Note this is different behaviour to DEPENDS += "virtual/kernel" which equates to do_configure[depends] += "virtual/kernel:do_populate_sysroot". Once we do this, we no longer need the copy operation in do_populate_sysroot, in fact there is nothing to do there (yay). The remaining part of the challenge is to kill off the horrible do_install. This patch splits it off to a different class, the idea here is to have a separate recipe which depends on the virtual/kernel:do_patch and just installs and packages the source needed to build modules on target into a specific package. Right now this code is proof of concept. It builds kernels and kernel modules. perf blows up in do_package with issues on finding the kernel version which can probably be fixed by adding back the right bit of do_install, and adding a dependency of do_package[depends] += "virtual/kernel:do_install" to perf. The whole thing needs a good write up, the corner cases testing and probably a good dose of cleanup to the remaining code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-05kernel-yocto.bbclass: fix shell syntax errorPaul Eggleton
Spaces aren't valid around = in an assignment statement (not even with bash). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>