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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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>
sanity: TMPDIR ABI change for kernel process

The kernel source is being moved into the sysroot, to do this and
preserve previous builds, we need to change the TMPDIR ABI and
provide a function to uninstall all kernels from the sysroot.

This change adds code to do that and increases the ABI number.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kernel: Clean ${S} before unpack

Currently unpack just forces sources over the current files. This change
ensures ${S} is cleaned out before sources are unpacked. This resolves
issues seen when upgrading to the new kernel class changes.

Ultimately, this should probably move to base.bbclass but one step at a
time, this solves an immediate problem blocking the other patches from
merging.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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-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>