Commit Graph

260 Commits

Author SHA1 Message Date
Andre McCurdy 61fe46da92 kernel.bbclass: dont assume ${B}/include/generated exists
Older kernels (e.g. 2.6.32) don't create an include/generated directory,
so check that the directory exists before trying to copy files from it
in do_shared_workdir().

(From OE-Core rev: 5bebaf37429c28134aeb6fd261e282e9a0397771)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-11 09:28:50 -07:00
Ross Burton c713a22368 kernel: fix path assumptions in tasks
Several of the kernel class tasks were making assumptions about what directory
they were executed in.  Clarify the code by making paths absolute or passing -C
to oe_runmake.

(From OE-Core rev: d596286bc4cf19774447b136a27acf3c61aad2ff)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:21 +01:00
Marek Vasut 7f131b8863 kernel: Pull uImage generation into separate class
Pull the uImage image format generation from kernel.bbclass into
a separate kernel-uimage.bbclass. Introduce new KERNEL_CLASSES
variable, which allows registration of additional classes which
implement new kernel image types. The default value of is to
register kernel-uimage to preserve the original behavior.

(From OE-Core rev: 086536ac84fcc9350802c09166f600becd52a1f8)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Koen Kooi <koen@dominion.thruhere.net>
Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: Ross Burton <ross.burton@intel.com>
Cc: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:57:51 +01:00
Marek Vasut 12f983b66a kernel: Pull out the linux.bin generation
Pull the generation of linux.bin image, which is then packed into uImage,
into a separate function. No functional change.

(From OE-Core rev: 2879e5423aff8df5731712b853d71a73047a2fd7)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Koen Kooi <koen@dominion.thruhere.net>
Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: Ross Burton <ross.burton@intel.com>
Cc: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:57:51 +01:00
Marek Vasut 88d79fee80 kernel: Rework do_uboot_mkimage
Rework the function so part it's internals can be re-used by fitImage
image type. The name of the temporary file , linux.bin , is recycled
a little more as it's now used for both the case where it is gzip
compressed and where it is not. This should be fine, since the file
is temporary and removed after the uImage was created anyway.

There is no functional change here.

(From OE-Core rev: 63e3816b161f8659850d6123a53bdf128780e13d)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Koen Kooi <koen@dominion.thruhere.net>
Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: Ross Burton <ross.burton@intel.com>
Cc: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:57:51 +01:00
Marek Vasut 92864a9830 kernel: Clean up KERNEL_IMAGETYPE_FOR_MAKE
Remove the lambda function setting KERNEL_IMAGETYPE_FOR_MAKE and instead
set it in the anonymous python function. This also allows us to handle
image types which are not supported directly by kernel, but require some
other kernel target to be built. This is the case for example with the
fitImage, which is the uImage successor.

There is no functional change.

(From OE-Core rev: a1690131691507bbf5853540229b3ad775b836bf)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Koen Kooi <koen@dominion.thruhere.net>
Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: Ross Burton <ross.burton@intel.com>
Cc: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:57:51 +01:00
Richard Purdie f5f2467e4b kernel/rm_work: Improve interaction
The do_shared_workdir task does leave behind the necessary information in
shared-work after it completes. We don't make this a "full" sstate task
however since that means tarring up and copying what is usually a large
amount of data which would be better extracted straight from the original
SCM.

The issue with rm_work occurs since it removes the do_shared_workdir stamp
meaning subsequent builds will add it back if they need to touch any kernel
modules for example. This ends up triggering a near enough complete kernerl
rebuild since if configure reruns, populate_sysroot has to rerun.

This change promotes the task to have a "setscene" variant but it doesn't use
any of the sstate class lifting to generate the sstate file. The sstate function
will therefore never get called since the sstate object will never exist.

We can add the task to the list of tasks rm_work promotes to a setscene variant
and unwanted rebuilds of the kernel should be avoided.

(From OE-Core rev: 55b4f7fd217f0c65d457c731150340c18fb3fa19)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-15 17:44:59 +01:00
Ed Bartosh 02d0a003d6 kernel.bbclass: Fix race condition
Race condition between do_compile_kernelmodules and do_shared_workdir
tasks occurs when do_compile_kernelmodules changes files in
include/generated/* while do_shared_workdir tries to copy them to
shared working directory.

Fixed race by moving do_shared_workdir after do_compile but before
do_compile_kernelmodules.

[YOCTO #7321]

(From OE-Core rev: b4ec689f71fe9504559c1921c893f5e096d6b744)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-07 13:40:36 +01:00
Richard Purdie 3f15d8a807 kernel: Fix depmod for multilib
Using populate_sysroot for this data was a nice idea but flawed as it
doesn't work in multilib builds. Instead we can use PKGDATA_DIR since
this is consistent over multilib builds. It also turns out to be
slightly neater code too. Hopefully this resolves the problem once and
for all.

(From OE-Core rev: 6cccae3ca54c1177a1d91d23c3e151d74e735ee9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-29 15:36:52 +00:00
Richard Purdie 11ef55a93b kernel/image/depmodwrapper: Fixups for depmod
With the rpm package backend enabled, running:

bitbake <image>
bitbake virtual/kernel -c clean
bitbake <image> -c rootfs -f

results in an image with incorrect kernel module dependency information.
The problem is that the System.map and kernel-abiversion files are needed
for depmod and after the recent kernel changes, these are no longer in
sstate.

Its reasonable to require the kernel to unpack/build if you're
about to build a module against it. It is not reasonable to require this
just to build a rootfs.

Therefore stash the needed files specifically for depmod.

Also fix some STAGING_KERNEL_DIR references which were incorrect, found
whilst sorting through his change.

(From OE-Core rev: b851504dcf5e147c9efb1c7b6a4d22c1a1a87cd7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-23 14:32:02 +00:00
Vincent Génieux 9839638238 fix '[[: not found' error message using dash
Remove bash specific syntax '[[ test ]]' replaced with '[ test ]'.

Fixes [YOCTO #7112]

(From OE-Core rev: f2ff849d5936d3dc5e24301e0620da265df50fea)

Signed-off-by: Vincent Génieux <vincent2014@startigen.fr>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-23 11:36:29 +00:00
Darren Hart 34f3d55950 kernel.bbclass: Update cleandirs to remove new kernel staging dirs
Fixes [YOCTO 6818]

Update do_unpack[cleandirs] to include the STAGING_KERNEL_BUILDDIR, and
add the same set of updated cleandirs for do_clean.

(From OE-Core rev: 0726f8099c1407eea9e53a62be94defbab32265e)

Signed-off-by: Darren Hart <dvhart@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-01-16 23:08:18 +00:00
Bruce Ashfield 46cdaf1c7b kernel: move source and build output to work-shared
commit 3b3f7e785e279 [kernel: Rearrange for 1.8] began the process of
moving the kernel source and build artefacts out of sstate control and
into a shared location.

This changed triggered some workflow issues, as well as bugs related
to the kernel source containing build output, and hence being dirty and
breaking kernel rebuilds.

To solve these issues, and to make it clear that the kernel is not under
sstate control, we move the source and build outputs to:

  work-shared/MACHINE/kernel-source
  work-shared/MACHINE/kernel-build-artifacts

Where kernel-build-artifacts is the kernel build output and
kernel-source is kept "pristine". The build-artifacts contain everything
that is required to build external modules against the kernel source,
and includes the defconfig, the kernel-abiversion, System.map files and
output from "make scripts".

External module builds should either pass O= on the command line, or
set KBUILD_OUTPUT to point to the build-artifacts. module-base.bbclass
takes care of setting KBUILD_OUTPUT, so most existing external module
recipes are transparently adapted to the new source/build layout.

recipes that depend on the kernel source must have a depedency on the
do_shared_workdir task:

 do_configure[depends] += "virtual/kernel:do_shared_workdir"

With this dependency added, the STAGING_KERNEL_DIR will be populated and
available to the rest of the build.

(From OE-Core rev: 6a1ff0e7eacef595738f2fed086986fd622ec32a)

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
Otavio Salvador 92725ad46f kernel.bbclass: When linux/version.h exists, copy it
Old Linux kernel versions rely on linux/version.h for modules; this
needs to be published for external modules to use. Copy it when
available.

(From OE-Core rev: 78226efe72c8221206594c70fa1d8742d4097af1)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
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
Martin Jansa cc73622d52 kernel.bbclass: fix do_unpack function when S ends with slash
* slash at the end causes os.symlink(kernsrc, s) to use s as
  directory name and fails with:

ERROR: Error executing a python function in /OE/build/owpb/webos-ports/meta-smartphone/meta-samsung/recipes-kernel/linux/linux-samsung-tuna_git.bb:

The stack trace of python calls that resulted in this exception/failure was:
File: 'base_do_unpack', lineno: 26, function: <module>
     0022:        subprocess.call(d.expand("mv /OE/build/owpb/webos-ports/tmp-glibc/work/maguro-webos-linux-gnueabi/linux-samsung-tuna/3_3.0.72+gitrAUTOINC+f8ed73f94a-r12/git/ /OE/build/owpb/webos-ports/tmp-glibc/sysroots/maguro/usr/src/kernel"), shell=True)
     0023:        os.symlink(kernsrc, s)
     0024:
     0025:
 *** 0026:base_do_unpack(d)
     0027:
File: 'base_do_unpack', lineno: 23, function: base_do_unpack
     0019:        bb.utils.mkdirhier(kernsrc)
     0020:        bb.utils.remove(kernsrc, recurse=True)
     0021:        import subprocess
     0022:        subprocess.call(d.expand("mv /OE/build/owpb/webos-ports/tmp-glibc/work/maguro-webos-linux-gnueabi/linux-samsung-tuna/3_3.0.72+gitrAUTOINC+f8ed73f94a-r12/git/ /OE/build/owpb/webos-ports/tmp-glibc/sysroots/maguro/usr/src/kernel"), shell=True)
 *** 0023:        os.symlink(kernsrc, s)
     0024:
     0025:
     0026:base_do_unpack(d)
     0027:
Exception: OSError: [Errno 2] No such file or directory

ERROR: Function failed: base_do_unpack
ERROR: Logfile of failure stored in: /OE/build/owpb/webos-ports/tmp-glibc/work/maguro-webos-linux-gnueabi/linux-samsung-tuna/3_3.0.72+gitrAUTOINC+f8ed73f94a-r12/temp/log.do_unpack.17042
ERROR: Task 0 (/OE/build/owpb/webos-ports/meta-smartphone/meta-samsung/recipes-kernel/linux/linux-samsung-tuna_git.bb, do_unpack) failed with exit code '1'

(From OE-Core rev: dba30c2395792b553b69ce0b44cc75ff2dbdb317)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-07 14:30:21 +00:00
Richard Purdie 1dd37a2a99 kernel: Fix non linux-yocto builds
After the recent kernel changes, non linux-yocto builds stopped working
properly for two reasons:

a) ${S} was being reset to ${WORKDIR}/git for example and STAGING_KERNEL_DIR
   did not contain the source

b) Most builds were using ${B} == ${S}

This patch adds a fixup to the unpack function to handle the case where
${S} != ${STAGING_KERNEL_DIR} and also set up the infrastrcture so that
B != S for kernel builds from now on. The kernel build system is one of the
best for supporting this and there is no good reason not to take advantage
of it.

(From OE-Core rev: 106dab2fd0321e6b4e77b40111e59a3a31d329d4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:55 +00:00
Richard Purdie 63695c6353 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.

(From OE-Core rev: 7deb1f670c188c24744b7888a2d2f73c2a8ddff7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:53 +00:00
Bruce Ashfield d1aced444f 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.

(From OE-Core rev: 4b981e4fd5a4744d0d83053219274296e7785e77)

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
Khem Raj 48b35406c9 kernel.bbclass: Remove bashism
Fixes build on systems using dash for default shell e.g.

errors like

run.do_strip.25842: [[: not found
| readelf: Error: Unable to read in 0x37 bytes of section headers
| readelf: Error: Not an ELF file - it has the wrong magic bytes at the start

Change-Id: I29cac15be44a02d75a3d6889b6ae9b2e19bf46af
(From OE-Core rev: 6956ffdc6e9879e32360b6ee3a3d286618807485)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-19 18:08:00 +00:00
He Zhe 4c222d3a67 kernel.bbclass: Create modules directory even if there is no modules installed
During kernel_do_install it needs to make symbol link at
${D}/lib/modules/${KERNEL_VERSION}/build, but there will not be
${D}/lib/modules/${KERNEL_VERSION} if there is no modules installed for current
image, which will result in a build failure.
Add "mkdir -p ${D}/lib/modules/${KERNEL_VERSION}" here to avoid this failure
and the need of similar changes in other scripts that also expect it to exist.

(From OE-Core rev: f2f72f8ff623d24fffbb1b0ad40bc08f05ff31dd)

Signed-off-by: He Zhe <zhe.he@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:16 +01:00
Nitin A Kamble 3224472c68 kernel.bbclass: enable a link for external module building
Even though the kernel-dev package provides the required support for
building external kernel modules on the target, some commonly used scripts
and utilities fail as they are not finding the kernel module build support
files at the desired location.

Create the /lib/modules/<kernel-version>/build link on target pointing to
the sources provided by the kernel-dev package, to fix the issue.

Fixes Bug:
[YOCTO #2968]

(From OE-Core rev: aafa4bc896eb944aa4fc406807dd7e02f4b9b7ba)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-06 15:15:51 +01:00
Alejandro Hernandez ff89dfb570 kernel: Added bc-native as DEPENDS
The makefile checks for bc during for compilation

[YOCTO #6781]

(From OE-Core rev: c067e52cffe002de3b39aa1bced308dd532859c1)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-06 15:15:50 +01:00
Carlos Rafael Giani 5ceb02d694 kernel.bbclass: use one package split for all firmware filename extensions
(From OE-Core rev: dd5313228879487ca2b11fc5d38fb821a2a810a5)

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-22 13:04:23 +01:00
Carlos Rafael Giani 3a7769329e kernel.bbclass: handle .dsp firmware
A few firmware files use this filename extension, like korg/k1212.dsp .
Create respective packages.

(From OE-Core rev: 4a4877c2e7cdcb8a1d0a54add600c0cd4e92e647)

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-10 15:38:54 +01:00
Robert Yang eb34d6650b sanity.bbclass/kernel.bbclass: minor fixes
Fixed:
- Remove an unused line
- Remove unneeded code after d.getVar(), we don't need the "or ''" after
  d.getVar() unless we need a string.
- typo: PREMIRROS -> PREMIRRORS.

(From OE-Core rev: 7849e50107a27b0ff2aaac47480ac1a0a79533dc)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23 23:01:57 +01:00
Yang Shi 35318696ad kernel: Prevent from installing so files into source dir
vdso build could generate so files, avoid installing such so files into kernel
source dir, otherwise the below package QA error might be hit:

ERROR: QA Issue: File '/usr/src/kernel/arch/x86/vdso/vdso64.so' from
linux-yocto was already stripped, this will prevent future
debugging! [already-stripped]

(From OE-Core rev: daff14bf44c59542c8b8f1a455dcc59586be7e59)

Signed-off-by: Yang Shi <yang.shi@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23 09:26:10 +01:00
Bruce Ashfield 4033ca87f5 kernel: don't copy .so.dbg files into kernel source install
In 3.16+ x86-64 kernel builds produce a vdso64.so.dbg file. If this file is
copied into the kernel source install multiple QA failures are triggered.
Specifically, this file triggers a debug package split that results in
files installed but not shipped, and invalid .debug file errors.

By ensuring that .so files are not copied, we avoid this incorrect split
with no impact on future build phases.

(From OE-Core rev: f1f6d153de9dc675b4bf4020799b2365b1b62ec7)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 15:33:57 +01:00
Robert Yang 7e6eeeefdd kernel.bbclass: update KERNEL_IMAGE_MAXSIZE
* Make KERNEL_IMAGE_MAXSIZE and IMAGE_ROOTFS_SIZE have the same algorithm:
  - Use Kbytes as the unit since we use this in other codes.
  - Use "du" rather than "ls" to figure out the size since we use this in
    image.py.

[YOCTO #2610]

(From OE-Core rev: 7384d2831c713ac5999aca83c312154dc15cec56)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-10 17:38:32 +01:00
Drew Moseley 61ab649849 classes/kernel: Use full path for symlink in update-alternatives.
Use a fully qualified path for the <path> parameter in calls
to update-alternatives.  The chkconfig-alternatives version
requires a full path and without it, the symlink is not
properly created.

(From OE-Core rev: 78ee4d8b1782445caecce8331e68efe83fc32044)

Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-29 09:04:22 +01:00
Ming Liu 3adc47fcab kernel: don't populate source symbolic link
/usr/src/kernel/source deployed by kernel-dev package is symbolically
linking to a build-time kernel source folder, which make no sense when
cross-compiling.

Fixed by not populating it at install stage.

(From OE-Core rev: edb85a9589be54a1e9c980aa669a380222a76cf4)

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-25 17:19:20 +01:00
Paul Eggleton 9ce1f7d522 classes/kernel: move module postinst commands to kernel-base
Since kernel-base is the package that contains the files that depmod
needs to run, we should be running depmod from the kernel-base
postinstall rather than kernel-image.

Fixes [YOCTO #5392].

(From OE-Core rev: f7d2cb383281ec8dfa90950ba04d87dd29ffc676)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-22 12:12:20 +00:00
Otavio Salvador 937a12ddb8 kernel.bbclass, base.bbclass: Fix support for old kernel configuration
This solves a regression introduced by OE-Core:9b75f6a (kernel:
use oldnoconfig before yes '' | make oldconfig).

The original oe_runmake explicitly calls 'die' command in case of
failure so the fallback code never runs. The fallback code needs
to handle the oe_runmake return code to call the backward
compatible callback so we introduced a new command called
oe_runmake_call which is used by oe_runmake.

This does not change the functional behaviour of oe_runmake so it
avoids any change except for the code which does need to handle
the oe_runmake exit code.

(From OE-Core rev: 51707282fc2c5a74588b2d79b2229513a883924f)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-13 11:41:22 +00:00
Alexandre Belloni 2bdc00fe74 kernel: use oldnoconfig before yes '' | make oldconfig
When using a defconfig, using yes '' | make oldconfig may not result in
the correct configuration being set. For example:

 $ ARCH=mips make qi_lb60_defconfig
 #
 # configuration written to .config
 #
 $ grep USB_ETH .config
 CONFIG_USB_ETH=y
 # CONFIG_USB_ETH_RNDIS is not set
 # CONFIG_USB_ETH_EEM is not set

 $ cp arch/mips/configs/qi_lb60_defconfig .config
 $ yes '' | make ARCH=mips oldconfig
[...]
 $ grep USB_ETH .config
 CONFIG_USB_ETH=m
 # CONFIG_USB_ETH_RNDIS is not set
 # CONFIG_USB_ETH_EEM is not set

Using make olddefconfig solves that but we'll use the oldnoconfig alias
for backward compatibility with older kernels.

 $ cp arch/mips/configs/qi_lb60_defconfig .config
 $ make ARCH=mips oldnoconfig
 scripts/kconfig/conf --olddefconfig Kconfig
 #
 # configuration written to .config
 #
 $ grep USB_ETH .config
 CONFIG_USB_ETH=y
 # CONFIG_USB_ETH_RNDIS is not set
 # CONFIG_USB_ETH_EEM is not set

(From OE-Core rev: 9b75f6a5786ff7b2e6219d78b38f0032f100c660)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:56:56 +00:00
Bruce Ashfield b6bfcaa312 kernel: stop using -exec rm for deleting files
Removing files from the source tree via find, exec and rm is not the
most efficient operation, due to (among other things) the many forked
processes.

If we use -delete, it saves a significant amount of time. But -delete
does not work with -prune (since it forces -depth). To maintain the
lib, tools and scripts source files, we can hide them temporarily,
skip their hidden directories and then finally restore them.

Time for install before this change:

 real    2m48.563s
 user    0m35.220s
 sys     0m33.036s

Time for install after this change:

 real    1m21.301s
 user    0m33.160s
 sys     0m28.388s

We could further speed this up by using inline perl to delete the files,
but that complexity is avoided for now.

(From OE-Core rev: 01932d6bbc71e86fd903097b5339e91f76846388)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:56:56 +00:00
Nathan Rossi 0031db1aca kernel.bbclass: Fix empty modules directory QA issue
If a kernel is built without any external modules (aka no CONFIG_*=m),
then during a modules_install of the kernel an empty directory is
created at /lib/modules/${KERNEL_VERIONS}/kernel. This is behaviour of
the kernel infrastructure, the directory would normally be populated
with the modules that were built.

However because of the expectations of kernel-modules-split, no packages
are created when there are no modules and an empty directory lingers.
This raises QA issues as warning or errors (depending on the distro).

The following patch changes the kernel_do_install task to check if the
directory is empty and if so removes it.

(From OE-Core rev: 63d3070b7e1207164891b154a5b9017731e75872)

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-02 11:22:08 +00:00
Koen Kooi 2fa4364a7d kernel.bbclass: add support for LZ4 initramfs files
(From OE-Core rev: 4cf53999459f3984f541ad5e666057a6727a066c)

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14 17:03:53 +00:00
Paul Eggleton b1b0c31515 classes/module_strip: remove
This class has been empty since 2010, so we shouldn't need it anymore. A
check of common layers suggests there shouldn't be any references to it
outside of OE-Core.

(From OE-Core rev: 3c4557df95e3c60ef938c53f00bb1d7f765fe0ef)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-12 23:09:15 +00:00
Richard Purdie 3f5e982107 Revert "kernel: restore scripts in the sysroot"
This reverts commit 6a6735cb98.

The module class already ensures the scripts are rebuilt correctly. Running
this at sstate installation time is problematic since it can require the
cross compiler. Adding such a dependency would cause issues of its own.

(From OE-Core rev: b2c948d56241ff7cdea2e9e68b740f305c72f5ca)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-29 09:52:58 +00:00
Mike Crowe 6e8a4eff5f kernel.bbclass: Stop bundle_initramfs thwarting sstate cache and fix race
The new do_bundle_initramfs task introduced in
609d5a9ab9e58bb1c2bcc2145399fbc8b701b85a defeats using the sstate
cache. The kernel is resurrected from the sstate cache but ends up being
built again since do_bundle_initramfs depends on do_compile.

The task is no longer nostamp to avoid causing unnecessary rebuilds. The
sstate checksum stamps should know when to rebuild.

The task now runs before do_deploy and part of the work has been moved to
do_deploy where it now writes to ${DEPLOYDIR} rather than
${DEPLOY_DIR_IMAGE} so that the files end up in sstate.

The task can also race against do_install since both call into the kernel
build system. This is fixed by making do_bundle_initramfs run after
do_install (which therefore also fixes the problem that
3baa63b4d588c3262254528b406ede265dd117bf was addressing.)

(From OE-Core rev: 55989cb509340bd265d0ce0d8bfe849681be4616)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-24 12:25:35 +00:00
Mike Crowe 33db10a172 Revert "kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux"
This reverts commit 3baa63b4d588c3262254528b406ede265dd117bf. It broke
builds that aren't using kernel-yocto.

(From OE-Core rev: 81831db1c32afa3346f3ed9f4325ad280e5bb005)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-24 12:25:35 +00:00
Ming Liu ae70c20ce8 kernel.bbclass: move bundle_initramfs after kernel_link_vmlinux
${KERNEL_OUTPUT} is being renamed/restored in bundle_initramfs task, so we
must ensure bundle_initramfs run after kernel_link_vmlinux where the link
of vmlinux is created as the bootable image.

(From OE-Core rev: 3baa63b4d588c3262254528b406ede265dd117bf)

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-20 14:03:29 +00:00
Phil Blundell 66fd6c4e92 kernel.bbclass: Use lzma not lzmash for decompressing
If kernel_do_compile() encounters a .lzma image for the initramfs, it
attempts to decompress it using the little-known "lzmash" utility.  This
may not be present, which will cause the build to fail.

Fortunately, it appears that the more mainstream "lzma" tool is
compatible so we can use that one instead.

(From OE-Core rev: f7a04cbdee67675ff6a8787709f3a312dc25bfec)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-20 14:03:28 +00:00
Bruce Ashfield d7ccfc7605 kernel.bbclass: fix hardlink test
The commit [kernel.bbclass: test for hardlinks before installing] doesn't
work on all build machines without a space between the ! and the test for
hardlink equivalance. The build continues, while the test fails and no
copy is made into the sysroot. Eventually tasks like build_hdimg will fail
with the missing kernel with the root cause being less than obvious.

(From OE-Core rev: 0704648e9dfd2897f6f54773a0e7d2762117970c)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-16 10:04:26 +00:00
Bruce Ashfield db7f8d4114 kernel.bbclass: test for hardlinks before installing
commit df564c4 [kernel: Use hardlinks for do_populate_sysroot for speed]
does indeed speed up the build, but it also means that the KERNEL_OUPUT
and KERNEL_IMAGETYPE may be hardlinks.

If they are hardlinks, install complains that they are actually the same
file and stops the build. We can easily test and avoid the copy if the
file is already in place.

[YOCTO #5527]

(From OE-Core rev: 6a3b3e501c66733216ac43d3f020cfdb512dd640)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-15 15:27:08 +00:00
Richard Purdie df564c4ea8 kernel: Use hardlinks for do_populate_sysroot for speed
The kernel tree is large and doesn't need to be copied. Override
the default sysroot handling function to use a hardlink copying
function in python.

This commit also drops the copying of the /lib directory which
just contains the kernel modules. We never use those in the sysroot
so there is little point in carrying those around.

For linux-yocto this takes the do_populate_sysroot time 24s -> 14s.

(From OE-Core rev: 13259459e200a237ca486cbe1123a0b0a4d1eebf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-12 10:34:09 +00:00
Richard Purdie 5e73287ad8 kernel: Use hardlinks during do_install for speed
Whilst the comment says we can't do this, its incorrect, install operates
on WORKDIR and its hard for different parts of WORKDIR to be on different
filesystems. Hardlinking instead of copying is therefore a nice performance
gain.

Also, completely skip the Documentation directory (adding a dummy Makefile
to keep make happy) and tweak the other cp commands to link since if we
don't we'd get "this is the same file" type errors from cp for some kernel
versions.

For do_install on linux-yocto, this takes it from 227s -> 84s.

(From OE-Core rev: 0727e510f8533216518563b1533e804a1dc44402)

(From OE-Core rev: f6e98af6b9f6729bb61f17e3b4203c3c79829205)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-12 10:34:08 +00:00
Xufeng Zhang a530781a44 kernel.bbclass: Delay rm_work to run after do_bundle_initramfs
Since kernel will build twice when we are trying to bundle kernel
and initramfs together after commit 609d5a9ab("kernel.bbclass,
image.bbclass: Implement kernel INITRAMFS dependency and bundling"),
thus, the second building for kernel would fail if rm_work is done
previously.

To fix this problem, we need to make do_bundle_initramfs task run
before do_rm_work task.

[YOCTO #5416]

(From OE-Core rev: 8308e22a44a2dea7d1bbfb429b9df9c63714a649)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-05 22:04:27 +00:00
Bruce Ashfield 6a6735cb98 kernel: restore scripts in the sysroot
When building against the sysroot, out of tree modules can require modpost
and other utilities normally found in the kernel's scripts directory. For
the kernel source in the staging dir, these scripts have been removed to
avoid mixing archiectures when packaging kernel-dev (among other things).

Rather than further complicate the kernel's install rule, or its packaging,
we can restore the scripts by building them in the kernel staging directory
after the sstate is installed, making them available to packages that need them.

(From OE-Core rev: 5bcd65807aa634060f98928db6011856934dabe4)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14 16:55:27 +01:00
Nobuhiro Iwamatsu 029b0fef50 kernel.bbclass: unset LDFLAGS when run devshell in kernel recipe
When user runs devshell in kernel recipe and compiles kernel,
this will fail by unrecognized option of LD.

----
$ make
...
arm-poky-linux-gnueabi-ld: unrecognized option '-Wl,-O1'
arm-poky-linux-gnueabi-ld: use the --help option for usage information
----

This set to empty LDFLAGS when user runs the devshell, and solve this problem.

(From OE-Core rev: e36ac3ab3a7fe02c7eeb3998ff33c001ab795841)

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14 16:55:23 +01:00
Jason Wessel 072c4e123f kernel.bbclass: Allow INITRAMFS_TASK to trigger copy initramfs code
Activating the INITRAMFS_TASK can cause circular dependencies, but
that is up to the end user to resolve in recipes.  The INITRAMFS_TASK
should also trigger immediate linking of the cpio task in the first
compile pass.  This was a subtle regression introduced by: 609d5a9ab
(kernel.bbclass, image.bbclass: Implement kernel INITRAMFS dependency
and bundling).

This patch restores the previous behavior and only affects the
INITRAMFS_TASK which is not set by any of the default build profiles
in oe-core.

Reviewed-by: Andrea Adami <andrea.adami@gmail.com>
(From OE-Core rev: 36faac868e086e9c23537b107cdd973d7fd980bd)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-30 22:11:58 +01:00
Jason Wessel 0fa12e4466 kernel.bbclass, image.bbclass: Implement kernel INITRAMFS dependency and bundling
This patch aims to fix the following two cases for the INITRAMFS generation.
  1) Allow an image recipe to specify a paired INITRAMFS recipe such
     as core-image-minimal-initramfs.  This allows building a base
     image which always generates the needed initramfs image in one step
  2) Allow building a single binary which contains a kernel and
     the initramfs.

A key requirement of the initramfs is to be able to add kernel
modules.  The current implementation of the INITRAMFS_IMAGE variable
has a circular dependency when using kernel modules in the initramfs
image.bb file that is caused by kernel.bbclass trying to build the
initramfs before the kernel's do_install rule.

The solution for this problem is to have the kernel's
do_bundle_initramfs_image task depend on the do_rootfs from the
INITRAMFS_IMAGE and not some intermediate point.  The image.bbclass
will also sets up dependencies to make the initramfs creation task run
last.

The code to bundle the kernel and initramfs together has been added.
At a high level, all it is doing is invoking a second compilation of
the kernel but changing the value of CONFIG_INITRAMFS_SOURCE to point
to the generated initramfs from the image recipe.

[YOCTO #4072]

(From OE-Core rev: 609d5a9ab9e58bb1c2bcc2145399fbc8b701b85a)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-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>
2013-09-06 23:04:47 +01:00
Darren Hart 7590f6926d kernel.bbclass: Correct post(inst|rm) package association
Fixes [YOCTO #4991]

The kernel image is installed as part of the kernel-image package, but
the symlink creation/removal via alternatives is being done in
pkg_post(inst|rm)_kernel-base.

Move the postinst alternatives logic into the kernel-image functions.

(From OE-Core rev: 35f538b117e3387354d2dab1f22c3de28ab1322b)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-13 23:06:02 +01:00
Javier Viguera 9b6fd47010 kernel.bbclass: fix typo
(From OE-Core rev: 8e8ea9294078526a4bb3ade54482cf4d2213b497)

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06 12:39:59 +01:00
Yi Zhao dfd0985065 kernel.bbclass: Fix link for modules-${MACHINE}.tgz
The modules-${MACHINE}.tgz should link to ${MODULE_TARBALL_BASE_NAME}.
But now it links to an invalid file ${MODULE_TARBALL_BASE_NAME}.bin.
Remove the extra .bin suffix.

[YOCTO #4595]

(From OE-Core rev: ef9fad8fff1c413bc0eab15625f051d4e2d0a201)

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 16:48:28 +01:00
Martin Jansa e2aa060920 kernel: Remove unnecessary cd and rm, fix MODULE_TARBALL_SYMLINK_NAME creation
* DEPLOYDIR is used as target for every other file deployed by do_deploy,
  this was just unnecessary switching CWD to create relative symlink and I
  have no idea why rm -f was used together with ln -sf.

(From OE-Core rev: 8375782a295c6294ea4ab889c309bebf873f3489)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 14:14:45 +01:00
Mike Crowe 600f4e38ad kernel.bbclass: Add dependency on binutils
Compiling the Linux kernel requires binutils; kernel.bbclass uses
INHIBIT_DEFAULT_DEPS so it had better depend on binutils explicitly.

(The lack of this dependency isn't always a problem because binutils
is required to build gcc-cross but if gcc-cross is reconstructed from
the sstate cache then gcc-cross's dependency on binutils-cross is
ignored due to being in the safe dependency list in
setscene_depvalid.)

(From OE-Core rev: 37beb7bdab78de5253a894f35afafa34c13a00f5)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Acked-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24 14:14:40 +01:00
Tom Zanussi 3bae24306a kernel.bbclass: make FILES package-specific
Fix QA warnings seen when using 'traditional' kernel recipes e.g.:

WARNING: QA Issue: .../recipes-kernel/linux/linux_3.0.18.bb: Variable
FILES is set as not being package specific, please fix this.

(From OE-Core rev: 799c16ed317aed7638e264ee2f92e4b722f1b011)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-10 10:15:51 +01:00
Richard Purdie b5845de167 kernel.bbclass: Ensure we have correct version information in deploy data
Currently the names used for the kernel in deploy will contain "AUTOINC"
instead of the final incremental numbering. This fixes the problem by
ensuring data is obtained from the PR service and using the PKG* variables
instead of PE/PV/PR directly.

[YOCTO #4293]

(From OE-Core rev: 1392f959cb8cd50b5a4492899e54f3ed68ef56d7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-15 15:57:29 +01:00
Khem Raj 48f827e7d7 kernel.bbclass: Optionally create lib dir during deploy
when we have multilib and a 64bit machine and initramfs then image/lib
directory will not be created and it will end up with errors like

| DEBUG: Executing python function sstate_task_prefunc
| DEBUG: Python function sstate_task_prefunc finished
| DEBUG: Executing shell function do_deploy
| tar: lib: Cannot stat: No such file or directory
| tar: Exiting with failure status due to previous errors

So in order to overcome this shortcoming lets mkdir -p the
lib directory so the modules can be happily installed.

(From OE-Core rev: 3f501204f375cc40a14597a25cb09faaba9ff802)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-12 17:00:44 +01:00
Michel Thebeau cd2f003b51 kernel.bbclass: do_strip: allow recipes to strip the kernel
Allow recipes to specify sections to be stripped from the kernel output
using KERNEL_IMAGE_STRIP_EXTRA_SECTIONS.  For example:

KERNEL_IMAGE_STRIP_EXTRA_SECTIONS = ".comment .unwanted"

The kernel output is stripped in place.

Since the toolchain does not give indication when the specified sections
are absent, we read the sections first and make this report by issuing a
warning to the developer.

The toolchain by default strips the image with the -s option (even
when -s is not specified):
-s --strip-all       Remove all symbol and relocation information

For example, these sections are always removed:
.debug_aranges
.debug_info
.debug_abbrev
.debug_line
.debug_frame
.debug_str
.debug_loc
.debug_ranges
.symtab
.strtab

In addition to these, the sections listed in
KERNEL_IMAGE_STRIP_EXTRA_SECTIONS will also be removed.

Only stripping of vmlinux (elf) is supported at this time.  A warning
will be given if the image type is not vmlinux.

Stripping the image could also be done in the kernel, but that would
only work for linux-yocto based kernels, so it's not the route we
decided to go.

[YOCTO 3515]

(From OE-Core rev: 5f6d33b05b4e7883f2728ca812cb5386d1e36989)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Michel Thebeau <michel.thebeau@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-11 09:03:21 +01:00
Michel Thebeau e57284abca kernel.bbclass: do_sizecheck: update path to build image and do not delete
do_sizecheck has a few issues especially with vmlinux image type.

It breaks because KERNEL_OUTPUT is a path relative to ${B}.  When
do_sizecheck runs it does not find the file (because the working
directory is elsewhere) and does not fail.

Also, the image file referenced by KERNEL_OUTPUT may be a link.

Finally, when do_sizecheck deletes the oversized kernel image it leaves
the previously run do_compile task with inaccurate status.

So, do the following:
 - specify that the working directory should be ${B}
 - use ls -L to reference to the real file, and ensure that the link
   file is created
 - keep the oversized image file so the status of do_compile is valid

[YOCTO #3514]

(From OE-Core rev: f0b19ddce3c92c5d06976cf73d4c4c480e053dff)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Michel Thebeau <michel.thebeau@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-08 22:26:24 +01:00
Chase Maupin 188a52171d kernel bbclass: return to original directory in do_deploy
* During the base kernel_do_deploy function the directory is
  changed to DEPLOYDIR in order to do some cleanup and symlinking.
  However, the directory is not changed back to the original
  starting directory ${S} at the end.  For append functions this
  means that the starting directory is not ${S} as expected but
  instead ${DEPLOYDIR}.

  For functions like the do_deploy_append in
  recipes-kernel/linux/linux-dtb.inc there is an assumption that
  you are still in the source directory and not the DEPLOYDIR.
  Without this change the .dtb files are not copied because the
  check for the existence of ${DTS_FILE} which is a relative
  path from the ${S} directory fails.  This means that the .dtb
  files are not copied into the deploy directory and subsequently
  the deploy/images directory.

  In the log.do_deploy file you will see lines like:

    Warning: arch/arm/boot/dts/xxxxx.dts is not available!

(From OE-Core rev: fd5d80ab1a405cb4ef94f2cde25f8c251da490f0)

Signed-off-by: Chase Maupin <Chase.Maupin@ti.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-18 13:18:23 +00:00
Martin Jansa 2b8f2e770e kernel: extract functions for kernel modules to separate bbclass
* this way we can reuse the same functionality also for external modules
  including module_autoload_foo and module_conf_foo functionality
* MODULE_PACKAGES variable was removed (splited modules are now returned
  by do_split_packages
* KERNEL_MODULES_META_PACKAGE is used to append all splitted packages
  to RDEPENDS. In kernel.bbclass it's old "kernel-modules" in
  module.bbclass it defaults to ${PN} for upgrade path from
  single PN with all modules to PN depending on all new kernel-module-*

(From OE-Core rev: 51928b6b5ca0a46a9dcd754483a19af58b95fa18)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-05 13:14:50 +00:00
Wolfgang Denk 8264863ea0 Add KERNEL_EXTRA_ARGS parameter
With recent kernel versions, some ARM configurations need may fail to
build with errors like this:

	multiple load addresses: 0x80008000 0x80008000
	This is incompatible with uImages
	Specify LOADADDR on the commandline to build an uImage

We cannot pass this information in EXTRA_OEMAKE, as
"meta/classes/kernel.bbclass" explicitly ignores all EXTRA_OEMAKE
settings.  So add KERNEL_EXTRA_ARGS parameter so affected boards
can add for example

	KERNEL_EXTRA_ARGS = "LOADADDR=0x80008000"

to their configuration.  We make this general enough so other needed
command line options can be passed as well when compiling the kernel.

(From OE-Core rev: e3cdd0aafb9081cd7f1f98490087c1157a3d7403)

Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-01 14:57:52 +00:00
Mark Hatle 86d6ec51f0 module.bbclass: Create a new depmodwrapper to assist cross-installs
Previously the build path to STAGING_KERNEL_DIR was being embedded into the
package post install scripts.  We avoid this behavior by generating a special
depmodwrapper script.  This script contains that hard-coded path, ensuring
that re-use of the sstate-cache (and/or packages) will always run through the
wrapper generated by the current build with a checksum that includes
STAGING_KERNEL_DIR.

[ YOCTO #3962 ]

(From OE-Core rev: b18c61bae4d7161c087a004bba3c696006f7a2f6)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-01 14:44:40 +00:00
Mark Hatle 54aae18917 kernel.bbclass: Add missing modules.order and modules.builtins
When running depmod, from kmod, warnings about missing modules.order
and modules.builtins occur.  Looking back it is not clear why these
files were being ignored, other then nobody knew what to do with them.

Add the files into the kernel-base package, if they exist, ensuring
they will always get installed if at least one module is installed.

[ YOCTO #3963 ]

(From OE-Core rev: bff4bda1fe86ddd218a192a14605924205a5300b)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
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>
2013-03-01 13:03:28 +00:00
Richard Purdie 4cae28e309 package.bbclass: Add PACKAGESPLITFUNCS variable
Prepending to populate_packages is rather ugly and means its hard to trace
errors and also profiling informaiton is summed together in one function.

This patch starts to split out the prepends to become separate functions
to avoid these issues. This is generally a neater way to write functions
than prepending to where there can sometimes be variable scope issues
and we've been bitten by whitespace issues in the past.

(From OE-Core rev: 4f9963d1d82ee896fe9491d6a8b32be42cd06f14)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:13:00 +00:00
Richard Purdie 88badcf7eb kernel.bbclass: Improve populate_packages_prepend
Small performance tweaks for populate_packages_prepend:

* Compile the regexps once at the start
* Don't keep importing a module which is already imported
* No need to check PKG is set, we'd have failed long before now if it wasn't
* Don't export PATH, bitbake takes care of this at the task level

(From OE-Core rev: e9d43d7b4d2cfb22b21f3814c2401a699c78b025)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:13:00 +00:00
Mark Asselstine dbfa6f9563 kernel: avoid copying unnecessary files during do_install
kernel_do_install() populates $kerneldir with files needed to build
external modules. To accomplish this there are several copy commands
to get source from the kernel source tree and build trees after which
a 'clean' is performed. Since we are copying from the build tree we
get about 1G of .o and .cmd files copied over only to have them
removed when we clean. This adds additional IO overhead as well as
overhead caused by pseudo. By avoiding copying these files in the
first place we get multiple gains:
  * avoid initial copy
  * avoid file deletes during clean
  * reduce pseudo overhead

Additionally we are making use of cpio vs cp which tends to be
significantly faster at performing copies.

With these changes I observe a 15-30% decrease in the time to complete
the do_install() operation on the kernel.

[YOCTO #3517]

(From OE-Core rev: c753f9d59f4d0a5af4ea5deb6e2b9609e05314e2)

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01 15:54:00 +00:00
Khem Raj a3ca06c3b4 kernel.bbclass, module-base.bbclass: Use CC to form KERNEL_CC
kernel compiler is not special and we currently have it so
we want to pass -march and -mtune options as CFLAGS to kernel
build so that compiler picks the right subarch flags when
compiling assembly files in particular. Otherwise defaults
are chosen which may not be right in many case e.g. when
compiling kernel for collie machine we should use arch=armv4
but it uses toolchain/as defaults which is armv5te

in some case e.g. thumb1 we know that kernel can not be compiled
in thumb1 mode so we can provide that information e.g. -marm
option through KERNEL_HOST_CC_ARCH variable as we do now

(From OE-Core rev: c49f967384ccbfe131bbb33ee518014f3fc4b38f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-20 12:58:56 +00:00
Laurentiu Palcu 71537bb721 kernel.bbclass: remove references to update-modules
Since update-modules is now obsolete, remove it from the bbclass.

[YOCTO #3598]

(From OE-Core rev: 323146c7fdf1c47241f3fd5adab2cb3c6d24b56c)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18 13:28:08 +00:00
Martin Jansa 200743b89e kernel.bbclass: don't depend on DATETIME
* http://cgit.openembedded.org/openembedded-core/commit/?id=67e77cd948c69798695d5d5f34163ef89339b35a
  moved DATETIME dependency from MODULE_TARBALL_BASE_NAME to MODULE_IMAGE_BASE_NAME
  but without copying that vardepsexclude

(From OE-Core rev: 9a93866067253746a889bfe444b6036cf85944b4)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-17 20:16:46 +00:00
Robert P. J. Day f1b530fb2f kernel.bbclass: Define MODULE_IMAGE_BASE_NAME for layer convenience.
Define the additional variable MODULE_IMAGE_BASE_NAME since some
layers (like meta-ti) would find it handy for multi-kernel
definitions in that they wouldn't have to define their own
variable representing exactly the same thing.

(From OE-Core rev: 67e77cd948c69798695d5d5f34163ef89339b35a)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-10 23:43:14 +00:00
Marco Cavallini 09ec2a4865 kernel.bbclass: kernel_do_install fails with kernel <2.6.30
* kernels <2.6.30 don't have $kerneldir/tools directory
 * so we got this error:
 * sed: can't read ...SNIP...linux/2.6.30-r0/image/usr/src/kernel/tools/perf/Makefile: No such file or directory
 * ERROR: Function failed: do_install

(From OE-Core rev: 4dd39a23dfe069ad34a925e00407b4dde978cb01)

Signed-off-by: Marco Cavallini <m.cavallini@koansoftware.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-10 23:43:09 +00:00
Martin Jansa 5ffe7a216c kernel.bbclass: include PE in KERNEL_IMAGE_BASE_NAME
* without this you it's harder to see which kernel is newer version
  e.g. after branch change LOCALCOUNT in SRCPV is reset to 0, so it needs PE bump for upgrade path
  but then it's clear why gitr1+HASH has newer DATETIME then gitrN+HASH, so include PE in name
* it will sort alphabetically wrong in deploy dir for a while until old images are removed

(From OE-Core rev: 3b5fe6d2cd58b5db70c3d319ffc66b1cbff1f43a)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-07 11:09:38 +00:00
Phil Blundell 3d154ae119 kernel.bbclass: Allow modules*.tar.gz generation to be inhibited
The modules.tar.gz archive is sometimes of no value and it can take
a noticeable time to build if many modules were enabled in the kernel
configuration.  The extraneous file also contributes to deploy/ clutter
and is a waste of disk space.

Allow it to be suppressed by setting MODULE_TARBALL_DEPLOY="0".

(From OE-Core rev: 262bfde1c5c51cc902b50bf0dda543434f12010c)

Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-19 17:54:51 +00:00
Martin Jansa 79f31adabf kernel.bbclass: use the same versioning schema for modules.tgz and provide link to latest
* so it will work look KERNEL_IMAGE
* also we were recreating modules.tgz with every kernel build, but
  overwritting the same output file

(From OE-Core rev: 73f242a61f913a0b0cd88265cd9ff6bcf3924623)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-19 17:54:51 +00:00
Holger Hans Peter Freyther b5591d0b49 kernel.bbclass: Do not chdir to /boot before running update-alternatives
The symlink from uImage-3... to uImage is not created at image creation
time and not properly update on kernel upgrades. This is fixed by removing
the chdir. The other users of update-alternative do not change the directory
before calling it.

(From OE-Core rev: c77ca9ee901468c93570b5264b226f7d17a41c16)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-22 14:59:30 +01:00
Martin Jansa caba9cbfce kernel.bbclass: add kernel-modules to PACKAGES
* kernel-modules is always added to PACKAGES later in python code and
  needed to be defined as PACKAGES_DYNAMIC
* add it to PACKAGES directly and set
  ALLOW_EMPTY_kernel-modules
  FILES_kernel-modules
  DESCRIPTION_kernel-modules
  outside populate_packages_prepend like for other packages and set only
  RDEPENDS_kernel-modules from python code

(From OE-Core rev: 0884bdbbf39f2b3a8a342918812f29ddcd3b1e6f)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-19 23:06:26 +01:00
Martin Jansa 33b31640bf PACKAGES_DYNAMIC: use regexp not glob
* bitbake uses PACKAGES_DYNAMIC as regexp
  ^ could make matching faster (and it will be more clear that we're expecting regexp not glob)
  * made all those last '-' optional, use .* (or nothing)

(From OE-Core rev: 2f3ebdfa5f42dae51063b043cc4b0fbe20b40064)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-19 18:02:26 +01:00
Bruce Ashfield 4211de44e0 kernel.bbclass: remove explicit version.h target
The compilation routine for the kernel has an explicit call to
build version.h, which works fine for most kernels, but the
location of it has recently changes.

commit d183e6f5 [UAPI: Move linux/version.h]
commit 10b63956 [UAPI: Plumb the UAPI Kbuilds into the user
                 header installation and checking]

moves the file to include/generated/linux/version.h and then to
include/generated/uapi/linux/version.h.

As a result kernel builds of 3.7 or bisection builds of intermediate
kernel commits will fail with:

  make[2]: *** No rule to make target `include/linux/version.h'.  Stop.

Making the explicit version.h build conditional on the version, or
via a file test would fix the problem, but it introduces some complexity
to the build.

Even without an explicit call to build version.h, it is always produced
by the kernel build, so it can simply be removed.

This extra make line was originally so that the kernel version could be
determined, so that then different instructions could be executed depending
on whether it was a 2.4 or 2.6 kernel. Since we no longer support 2.4, this
code is no longer needed.

[YOCTO: #3293]

(From OE-Core rev: 4cb20fa89e571ffbc448c579a758db0b9074acf4)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-19 17:26:14 +01:00
Phil Blundell 8f85691860 kernel.bbclass, module.bbclass: Make update-modules optional
The update-modules mechanism is something of a historical relic and it isn't
entirely clear that it has a great deal of value nowadays.  Also, it causes a
problem when building a read-only rootfs since update-modules itself refuses
to configure offline.

Allow DISTROs to circumvent this whole thing by declaring (via DISTRO_FEATURES)
that they don't wish to use update-modules.  This is backfilled for existing
distributions and will have to be marked as CONSIDERED by those who actually
don't want it.

(From OE-Core rev: 14bf8ed115453077b4d4042b4b70ed6b3bca2a9f)

Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-18 12:13:33 +01:00
Richard Purdie 5fdbda6922 classes: Update to use corrected bb.utils.explode_dep_versions2 API
The bb.utils.explode_dep_versions function has issues where dependency information
can be lost. The API doesn't support maintaining the correct information so this
changes to use a new function which correctly handles the data.

This patch also fixes various points in the code to ensure that we do not have any
duplicates in things that use explode_dep_versions.

A new sanity test to test the contents of the R* variables is also added.

[Some changes from Mark Hatle <mark.hatle@windriver.com>]

(From OE-Core rev: 16a892431d0c0d03f8b561b92909cf2f11af4918)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-02 11:40:53 +01:00
Liang Li 9a1705ef80 kernel.bbclass: fix INC directory for SLANG
In the kernel's tools/perf/Makefile CFLAGS was previously hard coded to
contain "-I/usr/include/slang" to work with hosts that have
"/usr/include/slang/slang.h" as well as hosts that have
"/usr/include/slang.h". This path can cause compile warnings like:

  cc1: warning: '/usr/include/slang' doesn't exists.

  or

  cc1: warning: include location "/usr/include/slang" is unsafe for
  cross-compilation [-Wpoison-system-directories]

Then in some cases warnings become errors if WERROR is enabled hence
build errors.

In coordination with a kernel fix, we can fix this error for all
kernels by modifying the perf Makefile within the staged kernel
source.

(From OE-Core rev: 4e0daf05ed04e9fb4343032c6290a379f53b89f3)

Signed-off-by: Liang Li <liang.li@windriver.com>
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>
2012-08-25 14:47:00 +01:00
Martin Jansa 2b6268b5f5 kernel.bbclass: Preserve generated headers only if they exist
* I have 2.6.37 kernel without this directory and do_install now fails
  after 813256bf7bb6e26d542d5f769e2802564116ebe5

(From OE-Core rev: 9a83afe0794e96590aee374555efea91b3085b91)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-20 16:53:17 +01:00
Khem Raj 0a0ffcf18b kernel.bbclass: Preserve generated headers
asm/unistd.h includes asm/unistd_64.h on x86_64
and asm/unistd_32.h on i386 but these files are
generated files in 3.4 and when we do 'make clean' they get
deleted and it shows up as an error when building
external modules. May be its a 3.4 kernel bug may be not
but make clean should have left the tree in
a shape to build modules but it does not.

Probably we should run make modules_prepare after having
run make clean.

(From OE-Core rev: 813256bf7bb6e26d542d5f769e2802564116ebe5)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-19 10:45:55 +01:00
Bruce Ashfield b6bbf40996 kernel.bbclass: remove default module_autoload and module_conf values
kernel.bbclass is a common class for many different kernel versions,
and as such the default module_autoload and module_conf values that
it contains are not relevant, or out of date for most builds.

Individual kernel recipes or distros can better specify these
values to meet their needs.

(From OE-Core rev: a134efa7743edc3b7ca8abb651add6d2045c3b44)

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>
2012-08-15 14:26:42 +01:00
Richard Purdie ef98412865 kernel.bbclass: Revert ${base_libdir} change
The base_libdir change in 5b8a4798ea
breaks the kernel build for 64 bit machines. Revert this part of the
change.

(From OE-Core rev: 351bdc59f8af915ae203af7799eedc0ce42785f2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-07 11:17:36 +01:00
Javier Martinez Canillas 5b8a4798ea kernel.bbclass: use ${base_libdir} and ${sysconfdir} instead of /lib and /etc
It is considered good practice to use the build system provided
variables instead of directly specify hardcoded paths.

(From OE-Core rev: c859717f522098e7c68df578d59011f68122dc2c)

Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-06 15:18:51 +01:00
Leon Woestenberg b915fa43ec kernel.bbclass: Copy bounds.h only if it exists, needed for 2.6.x.
Linux 2.6.x kernels did not (all) have the bounds.h file, so copy
only iff exists.

(From OE-Core rev: 02ac0d1b65389e1779d5f95047f761d7a82ef7a4)

Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-31 08:02:09 +01:00
Koen Kooi dcadeda69e kernel bbclass: Recreate uImage only when KEEPUIMAGE != "yes"
The intent of the uImage code in this class includes the following

1) be able to specify custom load addresses without needing to patch the kernel
2) add better information to the uImage description field

The current state is a NOP anyway, the kernel will always build a uImage when you tell it to 'make uImage'.

weakly Set KEEPUIMAGE to 'yes' in default-distrovars.inc which preserve the
current OE-Core behavior. Machines which are being ported from oe.dev and need to
regenerate uImage can set this to be empty

(From OE-Core rev: 72a7049526ee107005bd39c7bdd814ed71345829)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-26 14:40:47 +01:00
Denis Carikli 9247550642 kernel.bbclass: fix external module building
Without that fix we have the following while compiling compat-wireless.
  include/linux/mmzone.h:18:30: fatal error: generated/bounds.h: No such file or directory

Note that the compat-wireless recipe will be added in another commit.

make -C $kerneldir _mrproper_scripts deleted this file along with
other things so we resurrect it with this patch.

(From OE-Core rev: 2d114fd0cdf7486f18e53f2bf41c4f559e4b4a8d)

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-26 14:40:45 +01:00
Richard Purdie bfd279de32 Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Khem Raj 0a925c9dcf kernel.bbclass: Dont package kxgettext.o
kxgettext.o is generated when building ppc kernels
so we end up with packaging errors like

> ERROR: QA Issue: Architecture did not match (20 to 62) on
> /work/virtex5-poky-linux/linux-xilinx-2.6.38-r00/packages-split/kernel-dev/usr/src/kernel/scripts/kconfig/kxgettext.o

(From OE-Core rev: 77278bd23617834c7f90b3b24a9945ec081dbb38)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:54:02 +01:00
Bruce Ashfield 0c9195b683 kernel.bbclass: add non-santized kernel provides
If the kernel version string uses characters or symbols that
need to be santized for the package name, we can end up with a
mismatch between module requirements and what the kernel
provides.

The kernel version is pulled from utsrelease.h, which contains
the exact string that was passed to the kernel build, not
one that is santized, this can result in:

 echo "CONFIG_LOCALVERSION="\"MYVER+snapshot_standard\" >> ${B}/.config

 <build>

 % rpm -qp kernel-module-uvesafb-3.4-r0.qemux86.rpm --requires
update-modules
kernel-3.4.3-MYVER+snapshot_standard
 % rpm -qp kernel-3.4.3-myver+snapshot-standard-3.4-r0.qemux86.rpm --provides
kernel-3.4.3-myver+snapshot-standard = 3.4-r0

At rootfs assembly time, we'll have a dependency issue with the kernel
providing the santizied string and the modules requiring the utsrelease.h
string.

To not break existing use cases, we can add a second provides to the
kernel packaging with the unsantized version string, and allowing the
kernel module packaging to be unchanged.

   RPROVIDES_kernel-base += "kernel-${KERNEL_VERSION}"

 % rpm -qp kernel-3.4.3-myver+snapshot-standard-3.4-r0.qemux86.rpm --provides
kernel-3.4.3-MYVER+snapshot_standard
kernel-3.4.3-myver+snapshot-standard = 3.4-r0

(From OE-Core rev: 7be043178f5b9d16d9a06696bc0b96689f202a8d)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 16:59:00 +01:00
Darren Hart 68a8caa738 kernel: Add kernel headers to kernel-dev package
[YOCTO #1614]

Add the kernel headers to the kernel-dev package. This packages what was
already built and kept in sysroots for building modules with bitbake.
Making this available on the target requires removing some additional
host binaries.

Move the location to /usr/src/kernel

Before use on the target, the user will need to:

    # cd /usr/src/kernel
    # make scripts

This renders the kernel-misc recipe empty, so remove it.

As we use /usr/src/kernel in several places (and I missed one in the
previous version), add a KERNEL_SRC_DIR variable and use that throughout
the class to avoid update errors in the future.

Now that we package the kernel headers, drop the
kernel_package_preprocess function which removed them from PKGD.

All *-sdk image recipes include dev-pkgs, so the kernel-dev package will
be installed by default on all such images.

(From OE-Core rev: 6125ea40d4483965f793bd847b3ce14b668a5b1e)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Bruce Ashfield <bruce.ashfield@windriver.com>
CC: Tom Zanussi <tom.zanussi@intel.com>
CC: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-04 17:40:33 +01:00
Liang Li 6b9c19140c recipes-kernel: make perf a standalone package
perf has been coupled to the kernel packages via kernel.bbclass.
While maintaining the build of perf out of the kernel source tree
is desired the package coupling has proved to be awkward in
several situations such as:

  - when a kernel recipe doesn't want to build/provide perf
  - when licensing of dependencies would prohibit perf and hence
    the kernel from being built.

To solve some of these problems, this recipe is the extraction of
the linux-tools.inc provided perf compilation into a standalone
perf recipe that builds out of the kernel source, but is otherwise
independent.

No new functionality is provided above what the linux-tools.inc
variant provided, but the separate recipe provides baseline for
adding new functionality.

(From OE-Core rev: ab883d0c1a05bd99e97e5d71bc7bed05cb1ae8c8)

Signed-off-by: Liang Li <liang.li@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-21 13:03:04 +01:00
Bruce Ashfield a5b568eb37 kernel: save $kerndir/tools and $kerndir/lib from pruning
The kernel source tree in the sysroot has all unecessary source
code removed. The existing use case is to support module building
out of the sysroot, but as more toolsa are moved into the kernel
tree itself there are new use cases for the kernel sysroot source.

To avoid putting dependencies on the kernel, and to be able to
individually build and package these tools out of the source tree,
we can save $kerndir/tools and $kernddir/lib from being removed.
This enables tools like perf to be built our of the kernel source
in the sysroot, without significantly increasing the amount of
source in the sysroot.

(From OE-Core rev: e6cadd9074b18798f2df7c3f89dc35a98c29b6e5)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-21 13:03:03 +01:00
Martin Jansa 262e5ac4bc kernel.bbclass: pass KERNEL_VERSION to depmod calls in postinst
* without this, kernel upgrades where KERNEL_VERSION is changed
  e.g. 3.4.2 -> 3.4.3 generate .dep for running 3.4.2 and after reboot user ends
  up without any module loaded to make it worse after reboot nothing is upgraded
  to trigger another kernel(-module) postinst to generate .dep for now running 3.4.3

(From OE-Core rev: 4bd5c17f55bc96ce6bbaccf6559aa4ea123ff4cb)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-21 13:03:02 +01:00