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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kernel: fix out of tree module builds

With the kernel build optimizations, we no longer copy the source from
the built kernel into the staging dir, since the kernel is unpacked and built
directly from the staging dir.

This means that a few build artifacts need to be restored to allow out of
tree modules to once again build.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
kerneldev: create kernel-devsrc packaging

kernel-devsrc is responsible for creating and a packaging an environment
appropriate for kernel development (on or off target).

To create this support, we only need to copy/install the results of the
virtual/kernel providers build in the staging dir ... with some minor
manipulations to the source tree (.git removal and a clean up). This
produces a source tree that is capable of rebuilding the kernel on the
target.

Installing the kernel-devsrc package on a target (along with a
toolchain) is all that remains to be done.

 $ cd /usr/src/kernel
 $ make oldconfig
 $ make -j2 bzImage

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
images: introduce core-image-kernel-dev

When building a new kernel, or testing and update to the kernel there
are a set of packages that are sensitive to APIs, build system and
other changes associated with the kernel.

After building this recipe, we can be reasonably sure that a new kernel
package and coupled userspace have been built, installed and tested
via a single image.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
lttng/perf: depend on virtual/kernel:do_install

To ensure that the minimal environment has been created for out of
tree module builds, perf and lttng should depend on the do_install
task of the kernel.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
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.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
kernel-yocto: make sure git tags get dereferenced properly in do_patch()

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>
linux-yocto/3.17: update to v3.17.1

Updating to the kver to the latest korg stable update. This fixes some
important bugs (as well as the usual mix of more minor ones), in particular
libata bugs and SSD corruption issues are fixed.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
linux-libc-headers: update to 3.17

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
linux-yocto/3.17: update to v3.17.2

Updating to the korg 3.17.2 -stable release.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
linux-yocto/3.10: update to v3.10.59

Updating to the latest 3.10 -korg stable update. We also bring in a meta
change for the valley island IO configuration.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
linux-yocto/3.14: update to v3.14.24

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
lttng-modules: fix mm_compaction_isolate_template build

linux-stable integrated the 3.16 commit f8c9301fa5a2a [mm/compaction: do
not count migratepages when unnecessary] with the 3.14.25 update.

So we have to update the lttng-module linux version codes to use the
new definition in builds greater than 3.14.24 or 3.16.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
linux-yocto/3.17: update to v3.17.6

Integrating the latest korg -stable update for v3.17

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
linux-yocto/3.10: update to v3.10.62

Updating to the latest korg -stable update for the 3.10 series. Minor
merge conflict resolution was done with the standard/ltsi and
standard/preempt-rt branches.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
linux-yocto/3.14: update to 3.14.26, integrate ltsi and -rt updates

Updating the 3.14 tree to the latest korg 3.14.26, as well as
integrating 3.14 LTSI content, and refreshing preempt-rt. Minor
conflict resolutions were performed between ltsi, stable and -rt

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>