summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* kernel-yocto: allow branch auditing to be suspendedBruce Ashfield2016-05-111-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: 1d4c120edeb6e45665eafd6962a10ebb89d758eb) 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>
* kernel-yocto: enforce SRC_URI specified branchBruce Ashfield2016-04-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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> (From OE-Core rev: d91a668bc0f6c2cfc52174b4039c7ea0d84e8d4d) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto.bbclass: move do_kernel_link_vmlinux() into kernel.bbclassAndre McCurdy2016-01-181-12/+0
| | | | | | | | | | | | | | | | 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 (From OE-Core rev: a29371848deda618a42f9a30f9856a44c2342fe6) Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto.bbclass: remove do_kernel_link_vmlinux from SRCTREECOVEREDTASKSAndre McCurdy2016-01-181-1/+1
| | | | | | | | | | | The do_kernel_link_vmlinux() task modifies the build directory (not the source tree) and should not be skipped when externalsrc is being used. (From OE-Core rev: 70b8a60d42831c701d10066eb57aaaad7a6fb7ae) Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: fix checkout bare-cloned kernel repositoriesJianxun Zhang2015-12-281-3/+10
| | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: ccfa2ee5c4f509de4c18a7054b2a66fc874d5d69) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* linux-yocto: skip kernel meta data branches when finding machine branchBruce Ashfield2015-10-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | 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'. (From OE-Core rev: 87363ec019e04b486dee5f07b7226465be7acd6c) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto.bbclass: do_kernel_metadata depends on do_unpackMarkus Lehtonen2015-09-091-1/+1
| | | | | | | | | | | | | | 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] (From OE-Core rev: 8939ea428f642fd6fa48807ded1f9040f09ed375) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* linux-yocto: split meta data from kernel repositoryBruce Ashfield2015-07-251-71/+5
| | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 523e4f6a6913b64453579d27a02467e14f7df42e) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Use die() or bbfatal_log() where the log should definitely be printedPaul Eggleton2015-07-161-8/+8
| | | | | | | | | | | | | 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. (From OE-Core rev: 04ed9a19e1b08003329138b8ab83691d13c11fd9) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: fix machine_srcrev check in do_patchPetter Mabäcker2015-07-161-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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' (From OE-Core rev: 5f7403151fc8bfd5b1d77f6626717c8b84d33d93) Signed-off-by: Petter Mabäcker <petter@technux.se> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* linux-yocto: drop suggestion of devshell for patch failuresBruce Ashfield2015-05-241-1/+1
| | | | | | | | | | | | | | | | | 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] (From OE-Core rev: d6a0c0f60ea85235479d968f75d067a10ce21574) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: propagate in tree defconfigs to WORKDIRBruce Ashfield2015-05-091-5/+6
| | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 58cc903a5156063b24e48011438a709cb6e09f54) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* linux-yocto: fix race between checkout and meta data generationBruce Ashfield2015-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: 9d806f3d05de918952f839f5e595cb71cd1261db) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: merge duplicate kernel_configme task definitionsRoss Burton2015-03-311-1/+1
| | | | | | | | | | | | | 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. (From OE-Core rev: b9646b9d31c3e0c70337a8c10ebfc087a0e2b829) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* linux-yocto: add kern-tools-native to kernel_metadata dependsRoss Burton2015-03-311-0/+1
| | | | | | | | | | | | | | | | | | 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 ] (From OE-Core rev: 4a0371847ff0c30d9b60db63559d89dddfcb009f) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: allow in-tree defconfigsBruce Ashfield2015-03-251-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: 5f5595eebeb81be7e824d998228e4ef9f0bfac7d) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: split meta data generation from patching phaseBruce Ashfield2015-03-201-2/+7
| | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 1be4c68fb876b63f19d107275b701fe1c1c121db) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: inhibit BSP description warnings for custom linux-yocto kernelsBruce Ashfield2015-03-021-6/+7
| | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: d2fb7fff291b83700d487be093223c1533d915ce) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/kernel-yocto: extend SRCTREECOVEREDTASKSPaul Eggleton2015-02-231-1/+1
| | | | | | | | | | | | * 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 ?=) (From OE-Core rev: 5717e3b60731d2cb9394c13bff049a467c3aeec1) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* linux-yocto: warn when a generated BSP description is usedBruce Ashfield2015-02-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: f4a460afc4e2676cbf1daaa1d6723da9e6146526) 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>
* linux-yocto: make kernel configuration audit user visibleBruce Ashfield2015-02-211-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: ad4d59495194b37bc510e9891bd14c0a2ac30dba) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto.bbclass: Bug Fix inside do_kernel_checkout()Theodor Gherzan2015-01-291-1/+1
| | | | | | | | | | | | | | | | | --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> (From OE-Core rev: cc95da21914d08bfbf1936830985f824e8813904) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: remove GUILT_BASE from terminal exportsBruce Ashfield2015-01-161-2/+1
| | | | | | | | | | | | 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. (From OE-Core rev: eb0209360d14b57fbef6fa20bdd9948e8337f24b) 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>
* kernel-yocto: make sure git tags get dereferenced properly in do_patch()Jeff Wang2014-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | 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> (From OE-Core rev: f79c9334f670ed6fce86047fbadb817af8d4fe14) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: fix non-git buildsBruce Ashfield2014-12-211-1/+3
| | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: d5451dda1b8cfbbe8b6a779b0cd9b1397ebf1a07) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel: Rearrange for 1.8Richard Purdie2014-12-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 3b3f7e785e27990ba21bc7cd97289c826a9a95d1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto.bbclass: fix shell syntax errorPaul Eggleton2014-12-051-1/+1
| | | | | | | | | | | Spaces aren't valid around = in an assignment statement (not even with bash). (From OE-Core rev: fb419b1a3f5dbc5e5019be9d09c4acdbeb460c19) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: fix branch validation for AUTOREV, non machine_meta kernelsBruce Ashfield2014-10-241-6/+8
| | | | | | | | | | | | | | | | | The simplication of do_validate_branches missed a case where a custom kernel can supply SRCREV="${AUTOREV}", and not use SRCREV_machine at all. In this case, we will incorrectly try and test the tree for a non-existent commit, and break the build. By simplying the condition of the check to look for an empty SRCREV_machine, we can skip manipulating the tree and testing for a SRCREV. (From OE-Core rev: 212a4bd9b086365c022842a2ac6a2a25bd486002) 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>
* kernel-yocto.bbclass: Fixup shell condition test syntax errorDarren Hart2014-09-301-1/+1
| | | | | | | | | | | | A warning is issued when run about an unexpected operator due to a syntax error with an extra if empedded in the shell conditional. Remove the extra if. (From OE-Core rev: f0566e127abc7bb90588b2a8bee12ad3e7d35b3e) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: replace --is-ancestor with basic git porcelain commandsBruce Ashfield2014-09-011-2/+1
| | | | | | | | | | | | | | | --is-ancestor is a relatively new git option [commit 5907cda1, Aug 30 2012]. To support build machines with older versions of git installed, we can use the basic porcelain commands to acheive the same check. merge-base: "--is-ancestor A B" can be replaced with: if test "$(git rev-parse --verify A)" = "$(git merge-base A B)" (From OE-Core rev: 2ddfffe52720d1df70b04131eac553776da7bc73) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: convert echo statements to bb* equivalentsBruce Ashfield2014-09-011-32/+22
| | | | | | | | | | | Use the bbinfo, bberror, bbfatal equivalents to the existing echo statements within the kernel-yocto processing. This makes us consistent with the other messages from the build system. (From OE-Core rev: 1686d69de08bcecd39942802df18c4f0ca029ffe) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: allow custom non-meta, SRCREV format buildsBruce Ashfield2014-09-011-20/+22
| | | | | | | | | | | | When custom respositories are built (like a pure kernel.org repo), the machine_meta SRCREV format is not applicable. As such, we shouldn't check for the meta branch and we shouldn't only check SRCREV_machine based revisions. (From OE-Core rev: bf555ee3305114483aa5083cde1accd23b46a39e) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: clean overly complex branch checkoutBruce Ashfield2014-09-011-6/+5
| | | | | | | | | | | | | Since the git fetcher ensures that branches exist, we no longer need to validate the branch and have a conditional checkout of the source. We can remove some checks and ensure that whenever we exit the do_kernel_checkout routine that a branch is always checked out. (From OE-Core rev: 2ffa3f8be6996877cd552ff22260de35c19c413d) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: use show-ref instead of branch -aBruce Ashfield2014-09-011-11/+11
| | | | | | | | | | | | | | It's better to check a branches existence via show-ref versus the end user branch commands. So we make the switch. Also as part of this change, we move the conversion of remote branches to local branches above the meta branch checking. This is required to ensure that the branch is local for the show-ref check. (From OE-Core rev: 04bd4cee625574cfa67679b6b2a150a21106c5bf) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: simplify branch SRCREV validationBruce Ashfield2014-09-011-25/+24
| | | | | | | | | | | | The checking of machine and meta branch SRCREVs was inconsistent and didn't allow a mixed AUTOREV machine/meta branch combination. By simplifying the checks and changing the logic, we can now allow this combination. (From OE-Core rev: e272cfbba87a98393d6c22bd96c7f1cb6902170a) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: remove KBRANCH_DEFAULTBruce Ashfield2014-09-011-16/+0
| | | | | | | | | | | | | KBRANCH_DEFAULT was introduced as a way to trigger the enforced build of a particular branch of the tree. With the fetcher now enforcing SRCREVs existing on a branch, we can simply validate that the SRCREV is reachable from the final branch and no longer care about enforcing a given branch. (From OE-Core rev: fbacbb0ca79cdae33803fdd3158671488b9bbcbe) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: remove branch existence checking in do_validate_branchesBruce Ashfield2014-09-011-21/+8
| | | | | | | | | | | | | | Now that the fetcher will enforce branch existence, we no longer need to confirm that a branch exists, and that it was the branch requested to be built. We know the branch exists and we'll confirm that the specified SRCREV is going to be built after we've patched the tree. (From OE-Core rev: 93a7c7bd8e860e621af7174ef10d571b0d8622b2) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: remove SRC_URI kbranch validationBruce Ashfield2014-09-011-6/+0
| | | | | | | | | | | We no longer need to check if the KBRANCH matches the branch specified in the SRC_URI. This is taken care of by the fetcher at the beginning and SRCREV ancestor validation after patching. (From OE-Core rev: a9b6550d3e2f5bf21fd05a17bca3e57c5b74e057) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: remove containing branch checkBruce Ashfield2014-09-011-7/+0
| | | | | | | | | | The bitbake fetcher now enforces that a commit is contained by a branch, so this code can be dropped from do_validate_branches. (From OE-Core rev: 9e473d348d9e0db34e03446065c6c48d36964e1e) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: move SRCREV validation to patching phaseBruce Ashfield2014-09-011-16/+23
| | | | | | | | | | | | | Rather than attempting to condition the entire tree to machine SRCREV (since we don't know what branch will be built), we can instead wait until patching has completed and then confirm that we are indeed building a decendant of the specified SRCREV. The result is a much simpler check, and no mangling of the tree. (From OE-Core rev: 97075af9e9a691276cd417f1181ca73223f52d1c) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: use cat-file instead of git-showBruce Ashfield2014-09-011-4/+4
| | | | | | | | | | | | | Parsing the output of git show is error prone, since it changes based on the type of issue with bad comit IDs. Since the output is no longer used in the case of a valid ref, we can switch to git-cat-file and simply check the return code. (From OE-Core rev: 228c05013fe691321ec00467d8d0c0bb64dd175c) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: remove redundant SRCREV checkBruce Ashfield2014-09-011-21/+12
| | | | | | | | | | | | | | | | do_validate_branches checks to ensure that a valid machine SRCREV was set. A test against an empty SRCREV is done in two separate locations, we only need one, since the first check immediately returns and the second check never hits. At the same time, we can stop referring to the same commit hash by 3 different names. Instead we assign to a local variable at the top of the routine, and refer to it at all times. (From OE-Core rev: 05508339882c7cc1fe3f1f67f72314fdcab979b7) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: quote kconfig mode checkBruce Ashfield2014-05-061-1/+1
| | | | | | | | | | | | | | | | | | We allow inheriting recipes to control the kconfig mode used by merge_config.sh via the KCONFIG_MODE variable. An error crept into the variable reference, and since it is not quoted, the true condition always runs. The result is that operations without an explicit kconfig mode cannot trigger allnoconfig for defconfig builds, which can result in some options being dropped from the final .config. Quoting the reference allows it to evaluate properly. (From OE-Core rev: aad19e4381a8a09c354e5899885997c5b4cd115b) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: replace '=' with '+='Ming Liu2014-03-111-1/+1
| | | | | | | | | | | | | | | | The dependency to CCACHE_DIR was moved to ccache.bbclass in commit 2acf8da4f13c175ea818b9514677b7059de1e3e2: [ ccache: Separate out into its own class ] then the '=' should be replaced by '+=', otherwise, it will overwrite the original ${CCACHE_DIR} in dirs. Signen-off-by: Ming Liu <ming.liu@windriver.com> (From OE-Core rev: e8b90254747651670031e6b2b8a702732124ecac) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: fix diffconfig/kernel_configme breakageChristopher Larson2014-03-071-1/+7
| | | | | | | | | | | | | | | | | | | | The bbclass did the following: do_diffconfig[depends] += "virtual/kernel:do_kernel_configme" This clearly introduces a cross-kernel task dependency if the recipe inheriting this class isn't the preferred provider of virtual/kernel, which is obviously wrong, but further, will break the build if a kernel-yocto based kernel is parsed and not skipped, but virtual/kernel refers to a non-kernel-yocto recipe, which would not have the do_kernel_configme task. Work around this by adding the in-recipe task dep programmatically with bb.build.addtask when do_diffconfig exists. (From OE-Core rev: 0e6881146d87f0d214d80bc92e54c113906db63a) Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: Disable ANSI escape codes from git branchMatt Fleming2014-03-071-2/+2
| | | | | | | | | | | | | | | 'git branch' may use ANSI escape codes in its output (to provide colour) which doesn't play well with commands expecting pure plain text, e.g. fatal: '^[[31mmaster^[[m' is not a valid branch name. Use the --no-color option to ensure all branch names are plain text. Cc: Bruce Ashfield <bruce.ashfield@gmail.com> (From OE-Core rev: 87acfdb28380c26344a79a9dc0b4b403173bdc44) Signed-off-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: always checkout machine branch when existing validate_branchesBruce Ashfield2014-02-281-21/+16
| | | | | | | | | | | | | | | | | | | | The validate_branches routine is responsible for ensuring that the specified SRCREV exists, and that the tree has been prepared for eventual patching starting directly from that SRCREV. On exit, the routine checks out the specified machine branch and the preparation is complete .. except if a KMETA branch isn't used, we exit early since the branch can't be validated. To make the exit condition consistent for all cases, we can move the KMETA validation inside a conditional and allow the same exit path for both cases. (From OE-Core rev: 6eb63237c3bf48377f75e48e637d76108c8666df) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: Add do_diffconfig taskJoão Henrique Ferreira de Freitas2014-02-201-0/+2
| | | | | | | | | | | | | | Instead of using 'diff' command between two kernel config files, the task diffconfig does the job creating the file $WORKDIR/fragment.cfg that user should review and use. [YOCTO #3862] (From OE-Core rev: db2a44c8f08f2371a52ff6662d6bc64bc42ad551) Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: Add a missing '['Peter Kjellerstedt2013-10-141-1/+1
| | | | | | | (From OE-Core rev: 68a7d9f0e19ed577854a04610efc902062a369a8) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: improve error checking on non-git reposBruce Ashfield2013-09-061-1/+12
| | | | | | | | | | | | | | | | | | While non-git kernel repos are not the preferred format for a kernel upstream, they are supported. Depending on the creator of the archive the expanded source directory name varies. If the recipe for the kernel doesn't properly set S to the right value, a cryptic git error message is produced. We can detect the situation and offer some advice on how to fix the issue. A second check is also added in this commit for archive based kernel repos which won't have a SRCREV to validate. If we have no SRCREV or SRCREV is INVALID, we can exit the branch validation step immediately. This saves yet another cryptic git error message and simplifies a custom tgz based recipe. (From OE-Core rev: 0ebf67e8b4f7aaf259d7abac4af645070d846ec8) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>