Commit Graph

138 Commits

Author SHA1 Message Date
Bruce Ashfield 912d9f531e kernel-yocto: propagate configuration errors to bbclass
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]

(From OE-Core rev: 3470a3839577b99322c10f830cdaa61128ef6b16)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
(cherry picked from commit 960652416e2390337df6d9734375d6829ceb6420)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-27 22:36:45 +01:00
Bruce Ashfield 929cebfb97 kernel-yocto/kern-tools: fix do_validate_branches clean stage
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.

(From OE-Core rev: 4d5890b54cbdac01ee748759578b7b22ed8e61a2)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-29 11:17:22 +01:00
Bruce Ashfield 9b77a677a0 kernel-yocto: trivial: remove extra } from bsp_definition
A typo introduced an extra } in the logging of the bsp_definition.
While this won't cause problems .. it needs to be fixed!

(From OE-Core rev: 9b95f3fca2a94ca922e05321096e07a11e98f9bb)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-19 06:16:58 -08:00
Awais Belal 35a79cc495 kernel-yocto.bbclass: ensure repatching when HEAD is checked out
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.

(From OE-Core rev: d57aeafdd2b49010a9fa6d1cd9d10f3cfd5754a5)

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-19 06:16:57 -08:00
Bruce Ashfield fcc40ac908 kernel-yocto: log the BSP definition file
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.

(From OE-Core rev: 1003615b866bfe196994bdc25d305ff5eace2715)

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>
2017-02-05 09:22:17 +00:00
Bruce Ashfield 80a74318de kern-tools: re-enable scc merge command
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.

(From OE-Core rev: a0059ebbb52c659282e355664bba1a2fa282170e)

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>
2017-02-05 09:22:17 +00:00
Richard Purdie 022a8b58c8 meta/scripts: Various getVar/getVarFlag expansion parameter fixes
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).

(From OE-Core rev: 688f7a64917a5ce5cbe12f8e5da4d47e265d240f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
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\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Bruce Ashfield e3d51adafd kernel-yocto: explicitly trap subcommand errors
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.

(From OE-Core rev: a4705e62d0973c290011fc0d250501d358b659e8)

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>
2016-12-13 22:55:21 +00:00
Bruce Ashfield e38775a1d8 kernel-yocto: exit on non-zero return code
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.

(From OE-Core rev: 476ffd57cf5b6fba40d4e3f5dd913824ab8a8d3d)

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>
2016-12-07 10:46:09 +00:00
Stephano Cetola ef7828c9f2 utils.bbclass: add function to check for git config user
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

(From OE-Core rev: 25b43cb05c645e43f96bc18906441b8fdc272228)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
André Draszik 1373b52896 kernel-yocto: remove do_shared_workdir from SRCTREECOVEREDTASKS
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.

(From OE-Core rev: 29e99d7a57803e450920600b5d35c5b4e58a0ede)

Signed-off-by: Andre Draszik <git@andred.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-14 22:22:12 +01:00
Bruce Ashfield 50c4c79315 kernel-yocto: allow --allnoconfig and --alldefconfig as KCONFIG_MODES
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.

(From OE-Core rev: 614227f28a023fe148307e0d85a5e9b8d9b74372)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 08:25:11 +01:00
Bruce Ashfield 81297ee22d kernel-yocto: restore kernel-meta data detection for SRC_URI elements
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.

(From OE-Core rev: 7ef7af5c03bad28faf380986f792f7f3d4d5944d)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 08:25:11 +01:00
Ioan-Adrian Ratiu d1528403d5 kernel-yocto: do_kernel_configme: Fix silent sysroot poisoning error
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

(From OE-Core rev: 4b770d62472d1b1a26366de0a1742db240aa5239)

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-05 11:56:01 +01:00
Bruce Ashfield 5ea48fa5ee kernel-yocto: test for empty artifacts
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.

(From OE-Core rev: 58715183493de1deb90f2ab075048462b4bf6c73)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-05 11:56:01 +01:00
Bruce Ashfield 5ef0620b18 kernel-yocto: streamline patch, configuration and audit phases
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]

(From OE-Core rev: 0f698dfd1c8bbc0d53ae7977e26685a7a3df52a3)

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>
2016-08-18 09:27:53 +01:00
Bruce Ashfield 1ce221da64 kernel-yocto: allow branch auditing to be suspended
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>
2016-05-11 10:33:40 +01:00
Bruce Ashfield 6b8f8a47bd kernel-yocto: enforce SRC_URI specified branch
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>
2016-04-03 15:51:37 +01:00
Andre McCurdy 76e35f1d76 kernel-yocto.bbclass: move do_kernel_link_vmlinux() into kernel.bbclass
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>
2016-01-18 11:47:08 +00:00
Andre McCurdy d453fa183c kernel-yocto.bbclass: remove do_kernel_link_vmlinux from SRCTREECOVEREDTASKS
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>
2016-01-18 11:47:08 +00:00
Jianxun Zhang 4487e3a420 kernel-yocto: fix checkout bare-cloned kernel repositories
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>
2015-12-28 09:25:16 +00:00
Bruce Ashfield 3bab714a39 linux-yocto: skip kernel meta data branches when finding machine branch
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>
2015-10-27 07:24:24 +00:00
Markus Lehtonen 0ec0b17f4b kernel-yocto.bbclass: do_kernel_metadata depends on do_unpack
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>
2015-09-09 14:27:49 +01:00
Bruce Ashfield c29aac6a8b linux-yocto: split meta data from kernel repository
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>
2015-07-25 14:41:44 +01:00
Paul Eggleton ddc1df3e80 Use die() or bbfatal_log() where the log should definitely be printed
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>
2015-07-16 15:09:23 +01:00
Petter Mabäcker 3f9658a482 kernel-yocto: fix machine_srcrev check in do_patch
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>
2015-07-16 15:09:19 +01:00
Bruce Ashfield 03abfcb034 linux-yocto: drop suggestion of devshell for patch failures
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>
2015-05-24 07:19:17 +01:00
Bruce Ashfield a28371be8b kernel-yocto: propagate in tree defconfigs to WORKDIR
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>
2015-05-09 22:26:44 +01:00
Bruce Ashfield c1267093c6 linux-yocto: fix race between checkout and meta data generation
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>
2015-05-09 22:26:44 +01:00
Ross Burton 6978d8aaa9 kernel-yocto: merge duplicate kernel_configme task definitions
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>
2015-03-31 22:23:13 +01:00
Ross Burton a9025e876d linux-yocto: add kern-tools-native to kernel_metadata depends
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>
2015-03-31 22:23:13 +01:00
Bruce Ashfield 4dbe239ff4 kernel-yocto: allow in-tree defconfigs
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>
2015-03-25 12:39:46 +00:00
Bruce Ashfield ad6313d01b kernel-yocto: split meta data generation from patching phase
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>
2015-03-20 23:56:00 +00:00
Bruce Ashfield e02016e73b kernel-yocto: inhibit BSP description warnings for custom linux-yocto kernels
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>
2015-03-02 22:05:34 +00:00
Paul Eggleton 4a2e42d71d classes/kernel-yocto: extend SRCTREECOVEREDTASKS
* 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>
2015-02-23 17:35:28 +00:00
Bruce Ashfield 726c6c1f5e linux-yocto: warn when a generated BSP description is used
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>
2015-02-21 22:05:34 +00:00
Bruce Ashfield dfa83e6625 linux-yocto: make kernel configuration audit user visible
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>
2015-02-21 22:05:33 +00:00
Theodor Gherzan af691920c0 kernel-yocto.bbclass: Bug Fix inside do_kernel_checkout()
--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>
2015-01-29 15:36:49 +00:00
Bruce Ashfield 2eaeba1f9a kernel-yocto: remove GUILT_BASE from terminal exports
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>
2015-01-16 23:08:18 +00:00
Jeff Wang 6a5a2dff3c kernel-yocto: make sure git tags get dereferenced properly in do_patch()
Commit 92c1ece6c3 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>
2014-12-21 12:37:53 +00:00
Bruce Ashfield 5b71b69355 kernel-yocto: fix non-git builds
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>
2014-12-21 12:37:53 +00:00
Richard Purdie 86893e4ea5 kernel: Rearrange for 1.8
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>
2014-12-21 12:37:53 +00:00
Paul Eggleton 8ad1d1d6f6 kernel-yocto.bbclass: fix shell syntax error
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>
2014-12-05 18:01:05 +00:00
Bruce Ashfield 11dafe8447 kernel-yocto: fix branch validation for AUTOREV, non machine_meta kernels
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>
2014-10-24 17:36:17 +01:00
Darren Hart 78b44ce53d kernel-yocto.bbclass: Fixup shell condition test syntax error
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>
2014-09-30 14:10:34 +01:00
Bruce Ashfield 92c1ece6c3 kernel-yocto: replace --is-ancestor with basic git porcelain commands
--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>
2014-09-01 14:35:41 +01:00
Bruce Ashfield 9a3292efcb kernel-yocto: convert echo statements to bb* equivalents
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>
2014-09-01 14:35:41 +01:00
Bruce Ashfield 63f2e18987 kernel-yocto: allow custom non-meta, SRCREV format builds
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>
2014-09-01 14:35:40 +01:00
Bruce Ashfield ba7614b0e6 kernel-yocto: clean overly complex branch checkout
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>
2014-09-01 14:35:40 +01:00