Commit Graph

260 Commits

Author SHA1 Message Date
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
Richard Purdie 0d9e893711 Revert "meta: replace os.popen with subprocess.Popen"
This reverts commit e83d8e58a6b107eea87df0ec233a1bc932b2c6e as the conversion
is not correct. Its replacing readlines() calls which generate an array with
what are effectively strings. There are split("\n") calls missing in many
cases so this needs to be reverted until it gets fixed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 14:21:29 +01:00
Robert Yang 5996b2b58e meta: replace os.popen with subprocess.Popen
Replace os.popen with subprocess.Popen since the older function would
fail (more or less) silently if the executed program cannot be found

There are both bb.process.run() and bb.process.Popen() which wraps the
subprocess module, use it for simplifying the code.

Note: We don't need the "2>/dev/null" or "2>&1" since bb.process.run()
can handle it, it will raise exception when error occurs, we should
handle the exception ourselves if we want to ignore the error.

More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements

[YOCTO #2454]

(From OE-Core rev: e83d8e58a6b107eea87df0ec233a1bc932b2c6ea)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 12:04:45 +01:00
Robert Yang e40995e569 meta: replace os.system with subprocess.call
Replace os.system with subprocess.call since the older function would
fail (more or less) silently if the executed program cannot be found

More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements

[YOCTO #2454]

(From OE-Core rev: a07d03cc6f67c88feb9813ae7deb6e4a93552dfe)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-30 12:04:45 +01:00
Christopher Larson 6c0c7bb0dc kernel.bbclass: add deploy link to KERNEL_IMAGETYPE
It's common to provide a non-machine-suffixed link in DEPLOY_DIR_IMAGE, so
let's be consistent and do so here as well.

(From OE-Core rev: c1c8d2f3cffc540380c0a5fcdda48d64cbec333a)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-17 21:13:08 +01:00
Khem Raj f22cf1bedf image.bbclass,kernel.bbclass: Use kmod-native instead of module-init-tools-cross
(From OE-Core rev: 74fcf61224dc3e12e753c5de793591677275dffd)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-07 16:42:47 +01:00
Christopher Larson 0de1832166 kernel.bbclass: move kernel-vmlinux up in PACKAGES
If KERNEL_IMAGETYPE is vmlinux, the expectation is most likely that there will
be no kernel image package, but we still want a vmlinux package for debugging,
so move kernel-vmlinux in front of kernel-image in PACKAGES.

(From OE-Core rev: b62a44a9bf7b268296aeed64469390aa7efc2e73)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-03 15:48:10 +01:00
Andreas Oberritter 931910c51c {kernel, module}.bbclass: don't run depmod for module packages during do_rootfs
* depmod already gets executed by pkg_postinst_kernel-image.

* If you build a module using module.bbclass, pkg_postinst returns 1 in
  do_rootfs, causing pkg_postinst to run again on first boot. To improve
  this situation, I copied pkg_postinst from kernel.bbclass to module.bbclass.
  This was rejected by Koen, because he doesn't like the code from
  kernel.bblcass, which uses ${STAGING_DIR_KERNEL}. Richard then suggested
  that calling depmod during do_rootfs wasn't necessary at all, because
  it already gets done by kernel-image.

(From OE-Core rev: c7809c03080925b5e9171df5c9175c7c6420b376)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-26 10:05:15 +01:00
Martin Jansa d7a6e09dc4 kernel.bbclass: unify white spaces
* indentation was with spaces and tabs, unify to use tabs instead of
  spaces, for shell code and populate_packages_preppend,
  because "python populate_packages" expects tabs (or 8 spaces)
* and use 4 spaces for anonymous python

(From OE-Core rev: 24472a794e1787ebcd700dde66018a31069aa50b)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-26 10:05:15 +01:00
Martin Jansa 03d978b1ac kernel.bbclass: merge uboot_mkimage improvements from meta-oe
* allows to detect ENTRYPOINT from kernel binary marked with UBOOT_ENTRYSYMBOL
  used e.g. by ben-nanonote

(From OE-Core rev: 9ce6bd1d58b4418d3a53be417c18a0e57314462a)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-26 10:05:15 +01:00
Saul Wold c65dc38417 kernel: Fix packaging issue
Remove /etc since it is empty, when creating a machine that does not
deliver any module config files, the /etc is empty and is then warned
about not being shipped, so we remove it.

This occurs in the routerstationpro with the following warning:
WARNING: For recipe linux-yocto, the following files/directories were installed but not shipped in any package:
WARNING:   /etc

(From OE-Core rev: 963742f5a9bce2dfedd58350af754d256e2211cb)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-26 10:05:12 +01:00
Martin Jansa cafb94f571 kernel.bbclass: touch .scmversion also in ${S}
(From OE-Core rev: e3bf54731973a444edf69ad8876d019aa404db75)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-26 23:08:19 +01:00
Martin Jansa 0dd02a5e65 kernel.bbclass: don't create /etc/modutils/*
* update-modules was updated to read /etc/modules-load.d/*.conf

(From OE-Core rev: 60f144d336b5c344e7004d3cbf4d0c3fc9e1a1f2)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-23 17:47:42 +00:00
Martin Jansa c73e50a91e kernel.bbclass: fix extra + in kernelrelease
* see http://lists.linuxtogo.org/pipermail/openembedded-core/2011-December/014308.html

(From OE-Core rev: 56fe5300ab5ab072c20acd03d7fc26e9cae4e652)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-23 17:47:42 +00:00
Martin Jansa 39439da555 kernel.bbclass: use better number for KERNEL_PRIORITY
* there is no upgrade from 2.6.X to 3.X.Y
  last part of PV is used as kernel priority for u-a, but X is usually
  higher then Y in 3.x.x so use all 3 parts in one bigger number
* and make it weak assignment if this scheme doesn't work for some
  recipe
* if there are just 2 numbers in PV then last one is repeated twice
  (see linux-openmoko_3.2 example) but that should work fine too

  OE qemux86-64@ ~/oe-core $ grep ^KERNEL_PRIO linux-yocto_*
  linux-yocto_2.6.37.e:KERNEL_PRIORITY="20637"
  linux-yocto_3.0.e:KERNEL_PRIORITY="30024"
  linux-yocto_3.2.e:KERNEL_PRIORITY="30211"
  OE qemux86-64@ ~/oe-core $ grep ^PV linux-yocto_*
  linux-yocto_2.6.37.e:PV="2.6.37+git1+aeea99683c7283f1f3320bf2ee7085ee252d4e7e_1+af2bfbe5f757361b5b027a24d67a93bfdfaaf33c"
  linux-yocto_3.0.e:PV="3.0.24+git2+a4ac64fe873f08ef718e2849b88914725dc99c1c_2+aac580659dc0ce083f250fb05abf82e58d7f4531"
  linux-yocto_3.2.e:PV="3.2.11+git2+514847185c78c07f52e02750fbe0a03ca3a31d8f_2+4ca7e2c5d42e755e1b4c3e1478128f047a8ed2a8"

  OE qemux86-64@ ~/shr-core $ grep ^KERNEL_PRIO linux-openmoko_*
  linux-openmoko_2.6.39.e:KERNEL_PRIORITY="20639"
  linux-openmoko_3.2.e:KERNEL_PRIORITY="30202"
  linux-openmoko_git.e:KERNEL_PRIORITY="30299"
  OE qemux86-64@ ~/shr-core $ grep ^PV linux-openmoko_*
  linux-openmoko_2.6.39.e:PV="2.6.39"
  linux-openmoko_3.2.e:PV="3.2"
  linux-openmoko_git.e:PV="3.2.99+3.3.0-rc0+gitr1+7089727d63b17615fb0a652374d79cb7df0835ad"

(From OE-Core rev: 00999468341efdca1e884594dbfe25a73149e675)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-23 17:47:41 +00:00
Martin Jansa 42fbaceb44 kernel.bbclass: use symlinks for modutils files
(From OE-Core rev: d5d1508f25299ab215799d85f2ac4b31de69abf6)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-23 17:47:41 +00:00
Martin Jansa c6db496be6 kernel.bbclass: populate /etc/modules-load.d/ with module_autoload entries too
* /etc/modules-load.d/foo.conf is used by systemd like /etc/modutils/foo was with sysvinit

(From OE-Core rev: 1487af02b92278dec2eb539377cc29bb1b404153)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-23 17:47:41 +00:00
Darren Hart 31a03ed08d kernel.bbclass: Remove warnings for modutils and modprobe.d
Fixes [Yocto #2036]

The source and build directories are unused, remove them.

The modutils and modprobe.d directories may be used if modules are built that
are either autoloaded or have modprobe.d entries. This isn't known at install
time, so check after the package split if these directories are empty and
remove them if they are.

(From OE-Core rev: 6068f3229397baf561b1e84a22b570a803d95c49)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-08 11:55:39 -08:00
Richard Purdie 06f2f8ce0a meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:

sed \
 -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \
 -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \
 -i `grep -ril getVar *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:22:56 -08:00
Andrea Adami f9b683cb14 kernel.bbclass: fix pkg_postinst and pkg_postrm
* Symptom: kernel symlink in /boot is not created.
* Rename in order to create the expected files:
* /var/lib/opkg/info/kernel-3.1.4.postinst
* /var/lib/opkg/info/kernel-3.1.4.postrm

(From OE-Core rev: e9cc42bd7c866380d956233bdf8e719b25fdf0a7)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-24 10:05:46 +00:00
Richard Purdie cf00885669 kernel.bbclass: Allow do_compile_kernelmodules to use PARALLEL_MAKE
Without this we don't take advantage of any configured multiple CPU
cores which seems a shame.

(From OE-Core rev: 10b354c6ce7bac3b4cce5e6a649d4fd3ceca235b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-13 12:28:11 +00:00
Richard Purdie 0a434ac101 getVar/setVar cleanups
Complete the bb.data.getVar/setVar replacements with accesses
directly to the data store object.

(From OE-Core rev: 2864ff6a4b3c3f9b3bbb6d2597243cc5d3715939)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27 10:25:34 +00:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:

sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`

(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:19 +00:00
Richard Purdie c96e4990fe classes: Remove various bashisms
(From OE-Core rev: a057adfbb72454e28294f00075a69e0e7c699bec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:18 +00:00
Dmitry Eremin-Solenikov f977512857 kernel.bbclass: remove unshipped files in do_install
Drop two unsed files (modules.order and modules.builtin) in do_install
to stop the "unshipped files" warning.

(From OE-Core rev: 73a1101044465d74bb5bb1a449f757d5c50ff67e)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-28 17:35:46 +01:00
Dmitry Eremin-Solenikov 9bef7e5d60 kernel.bbclass: handle .cis firmware
.cis firmware files are used by kernel to patch incorrect CIS fir PCMCIA
cards. Create respective packages.

(From OE-Core rev: 843093658c528d7e5297dd5fb7c90e1a64540ba5)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-28 17:35:46 +01:00
Dmitry Eremin-Solenikov b9c9225635 kernel.bbclass: blacklist 'perf-dbg' as well for the modules metapackage
(From OE-Core rev: 98c38d942376c0cf0b90f6fa077c22544039bf02)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-28 17:35:46 +01:00
Mike Crowe 744f58fbfd kernel.bbclass: Find the kernel consistently.
Use KERNEL_OUTPUT variable to find the generated kernel image rather than
duplicating the existing path. This also means it can be overridden simply.

(From OE-Core rev: de5b502330ded38c0efe2c4e30967ef12dbad72a)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-29 13:48:07 +01:00
Mike Crowe 5633ac73b3 kernel.bbclass: support kernel image type of vmlinux.gz
Add support for a gzipped vmlinux kernel by specifying:

  KERNEL_IMAGETYPE = "vmlinux.gz"

(From OE-Core rev: cb17b6c2a72f260c61b0ec46887c2a04ac5b3f80)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-29 13:48:02 +01:00
Paul Eggleton 472f050077 image.bbclass, kernel.bbclass: remove non-standard -n option from cp command
-n is not a POSIX option and does not work on some systems (e.g. Debian
Lenny); in any case it is not strictly necessary here, so remove it.

(From OE-Core rev: 13e14763f14b5b84051ecb158404dcef937cc4e0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-23 18:32:39 -07:00
Otavio Salvador 628d09cdff kernel.bbclass: save kernel image name into $kerneldir
Save the kernel image name into sysroot so it can be used during image
build if need. This is used by O.S. Systems products and probably
useful to others.

(From OE-Core rev: 19a587cb98a20f0e659483541fc8cec874f6afa9)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-23 18:23:34 -07:00
Paul Eggleton 333d571b36 image.bbclass, kernel.bbclass: create warning file about deleting deploydir files
New users sometimes delete files in tmp/deploy/images assuming they will
be re-created just by re-running the build, and then are confused when
this doesn't work. To discourage people from doing this, create a file
called README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt in
tmp/deploy/images containing an explanation of what needs to be done to
re-create files there.

Fixes [YOCTO #1315] and [YOCTO #1346].

(From OE-Core rev: 4316c5e9eec67d71f4699102a63a5f968bd8d1d9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-19 09:29:18 -07:00
Darren Hart 978cdd5cb5 kernel: restore crtsavres.o to enable building external modules on powerpc
Fixes [YOCTO #1276]

As of Linux kernel version 3.0.1, and much earlier, the make clean target
removes arch/powerpc/lib/crtsavres.o. As this object is present in
KBUILD_LDFLAGS_MODULE, it is required to build external modules, and should
therefor not be removed by make clean.

While I do not advocate fixing buggy kernels in the generic kernel classes,
we should probably account for this one in kernel.bbclass as it affects
such a long list of kernel versions.

(From OE-Core rev: 2e83e6755441cb14bd907d306974338c15173189)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Bruce Ashfield <bruce.ashfield@windriver.com>
CC: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-17 15:56:07 +01:00
Nitin A Kamble e8f456613a kernel,module-base.bbclass: Improve KERNEL_LD & KERNEL_AR variables
KERNEL_LD was using ${LD} in it's definition, which is not correct for
different ABIs such as x32 or i386 on x86_64 machine. This brings it
into sync with the corresponding gcc settings, likewise the same with
the KERNEL_AR variable.

[RP: Updated commit message]
(From OE-Core rev: 9c525241c564a458db8ecd9ba325edeb13ec1c58)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-05 17:16:03 +01:00
Noor, Ahsan 5d87fb8b7b kernel.bbcalss: Added do_savedefconfig task.
* Added do_savedefconfig task to kernel.bbclass.

(From OE-Core rev: 5bbc3533710d82da0b35c70410b1a9019ab70336)

Signed-off-by: Noor, Ahsan <noor_ahsan@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-04 15:04:34 +01:00
Noor, Ahsan b77f1f327b kernel,cml1.bbclass: Move menuconfig to cml1
* The menuconfig target exists in places other than the kernel that use kernel style config.

(From OE-Core rev: 1ceaf45f634d11b65aab0f591a86865df49c8c90)

Signed-off-by: Noor, Ahsan <noor_ahsan@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-04 15:04:32 +01:00
Bruce Ashfield d5b665bb18 kernel: copy defconfig to {B} vs {S}
For kernel's that use a split source/object build the copy
of defconfig to {S} in the base kernel class is problematic.
The previous solution for this was to override the do_configure
of the base kernel class in a subclass. While this is still
a viable/valid option, it does mean that changes to the base
do_configure will be missed.

The solution to this is to copy a defconfig to {B} which is
typically the same as {S}, so most kernel recipes won't see or
care about this change.

With this change in place, linux-yocto.bbclass can drop its
override of do_configure.

Tested with linux-yocto and oe linux recipes.

(From OE-Core rev: 4f03d922ce32f602a5a407cf422d82a0d036e4a0)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-22 11:51:03 +01:00
Paul Eggleton e375da8e74 kernel.bbclass: minor whitespace fixes
(From OE-Core rev: 7c84b6f2cfaa12d631e34d29625436b4353c8c35)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-19 17:34:17 +01:00
Andrea Adami ffaf73eb9e kernel.bbclass: remove unintended change of INITRAMFS_TASK
* during an unfortunate round of tests right before commiting the patch
* do_configure[depends] became  kernel_do_configure[depends]
* Nonsense!
* As documented in commit 4dfef62dfe54a3b2c557a6df81d155adc1e03ccb
* of OpenEmbedded git server, this must be in do_configure[depends]
* to do the magic.

(From OE-Core rev: df31400ef89c14b45860feb906d4355d5f7de0c7)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-14 15:07:50 +01:00
Nitin A Kamble e36356796f kernel.bbclass: fix the broken lines
(From OE-Core rev: adf2fbf82da7f85bb06e3b01e84a1a45814aaa51)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-13 12:15:45 +01:00
Phil Blundell 88c6c7abbf kernel.bbclass, task-base: remove references to obsolete bluez-dtl1-workaround
(From OE-Core rev: a78b644a8aebd078b9cc51bf7d102feef8191d95)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-12 15:21:26 +01:00
Andrea Adami f8bf4e2b16 kernel.bbclass: handle embedding of initramfs images
* "All 2.6 Linux kernels contain a gzipped "cpio" format archive, which is
* extracted into rootfs when the kernel boots up."
* (http://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt)
*
* In some cases it can be useful to take advantage of this ability and embed your
* customized rootfs ("the move to early userspace is necessary because finding
* and mounting the real root device is complex").
*
* Therefore, some code was added and since 2009 OpenEmbedded metadata
* provides a convenient way to include your initramfs by setting
* INITRAMFS_IMAGE = "your_initramfs_image.bb"
* and specifying the chosen output format in the initramfs image recipe, e.g.
* IMAGE_FSTYPES = "cpio.gz cpio.lzma"
*
*
* Patch was imported from the OpenEmbedded git server
* (git://git.openembedded.org/openembedded)
*
* Add satndalone task "builtin_initramfs".
* commit  72761e468bb3e905459f2b81ce1bc4d80419481f
* (From OE-Core rev: 19bda7f2c2dac6363468a49295c38f2095c67c98)

Signed-off-by:Paul Sokolovsky <pmiscml@gmail.com>
*
* 'Remove usage of non-standard variables (DEPLOY_TO) and random renaming
* of output.'
* commit 456ba7ffd159821e86ad7ad4b66ec7d5790bd054
* Richard Purdie <rpurdie@rpsys.net>
*
* 'Fis typo in do_builtin_initramfs.'
* commit 37f2fe4b801df832e93553a08eff24fec736c7d4
* Signed-off-by:Paul Sokolovsky <pmiscml@gmail.com>
*
* 'comment initramfs stuff till rootfs locking works properly (initramfs
* should be optional as well)'
* commit 2818d8b7be1a0d9a59ad3528091d47517d59328b
* Signed-off-by: Koen Kooi <koen@openembedded.org>
*
* 'get initramfs stuff working
* commit 1642b3e8fc81c666713951fdd4e7ff9a50d1c5a8
* Signed-off-by: Thomas Kunze <thommycheck@gmx.de>
*
* 'Fix INITRAMFS logic to stop breaking builds for people not using it'
* commit dcf3049eb9eedf0838af59969b3f70a43298d3d7
* Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
*
* '-change initramfs-logic'
* commit 3e3f297457138e96e2b652658675796853eb0293
* Signed-off-by: Thomas Kunze <thommycheck@gmx.de>
*
* 'move initramfs stuff to configure so we can do postprocessing
* on it with do_configure_append'
* commit fc03e2be0b4470748a8b7707cea7293303adc424
* Signed-off-by: Koen Kooi <koen@openembedded.org>
*
* 'copy gz, lzo, lzma initramfs cpio images.'
* commit 572abc3fdd1076ca35d8c15d269cc9d862101805
* Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
*
* 'move the kernel size check to linux-kexecboot.inc.'
* commit 45f82a941c77e9d747814fa1e337ba803475d327
* Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
*
* Finally, two refinements as discussed on openembedded-core
* mailing list:
* - replace "if image != '' and image is not None:" with "if image"
* - add cpio.xz support

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-12 15:08:20 +01:00
Anders Darander 586ccf2a3f image|kernel.bblass|module-init-tools: do not use depmod-2.6
Change to only depend on virtual/*/depmod.
Change all calls to only use depmod.
Do not install depmod as depmod-2.6
Bump PR in module-init-tools-cross.

(From OE-Core rev: 351e352c2e44a3d8103594ca7e1d8404979a220c)

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01 23:34:17 +01:00
Anders Darander 33ca841082 Remove support for building 2.4 kernels
(From OE-Core rev: 06285501667a025893b56f66eae082f88ef08427)

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01 23:34:17 +01:00
Richard Purdie b3a4864de6 kernel.bbclass: Ensure kernel/* internal sysroot working directory don't get packaged
This removes a couple of megabytes of QA warnings!

(From OE-Core rev: 69c2f6f7a9133cc8d64560fefa42e5852322f716)

Signed-off-by: Richard  Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01 23:27:26 +01:00
Darren Hart 64497638e7 kernel: move menuconfig task after configure
Fixes [YOCTO 1136]

linux-yocto adds some configure steps that are necessary to prepare the source
tree after the do_patch task. This causes a "-c menuconfig" to fail in a clean
build tree. Typical use of menuconfig should be to modify the config provided
by the recipe being built. It therefor makes sense for the menuconfig task to
come after the configure task. This also happens to fix the issue seen with the
linux-yocto kernel recipe.

(From OE-Core rev: 829dd1d7ca99ec6228d2705cdece4727232797d3)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-30 20:56:34 +01:00
Richard Purdie 42df3f81a1 kernel.bbclass: Stop do_install poking directly into the sysroot and evading sstate
do_install was putting files directly into the sysroot which means sstate
had no knowledge of them. This meant they didn't get cleaned along with the
other files from the task amongst other issues.

This patch puts them in ${D} where they were supposted to be.

Tested-by: Tom Rini <tom_rini@mentor.com>
(From OE-Core rev: 983197c10104bbbcb6cfd6e923a3bf11152b3001)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-23 21:08:01 +01:00
Tom Rini 2b8a68001a kernel.bbclass: Stage System.map with KERNEL_VERSION suffix
Without this, images will fail now that kernel-abiversion is back.

(From OE-Core rev: 3dbe49b13e7513e449f13515591d02a7d2f560ae)

Signed-off-by: Tom Rini <tom_rini@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-23 13:45:56 +01:00
Koen Kooi bff293c0dc kernel.bbclass: restore kernel-abiversion file
This fixes external module recipes that need $KERNEL_VERSION. It got removed by

    commit a9d41062e24a6b99661b3a5256f369b557433607
    Author: Darren Hart <dvhart@linux.intel.com>
    Date:   Tue Mar 8 17:09:10 2011 -0800

        kernel/bbclass: rework kernel and module classes to allow for building out-of-tree modules

seemingly as an oversight.

(From OE-Core rev: 6978774595f892e6a819ee64c932d475c67a6a0f)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-23 13:34:33 +01:00
Mark Hatle d9fc516d73 kernel.bbclass: Add support for perf-dbg package
The perf component is built with the kernel, so ensure that it gets the
debug information associated with it.

Also bump the PR in the linux-yocto-* to ensure they get rebuilt.

(From OE-Core rev: 17f76de8ab8b7c9e62c1149017a3fa78866d9300)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-23 12:07:37 +01:00
Andreas Oberritter 4f5209ce31 kernel.bbclass: pass KERNEL_VERSION through legitimize_package_name
- KERNEL_VERSION may contain characters unsuitable for package
  names, e.g. underscores. Use legitimize_package_name to replace
  those characters.

(From OE-Core rev: 8c6bf9f6775fc5aaa8bc2c77924c95a00f1c1890)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-20 17:30:49 +01:00
Darren Hart fc934af7c8 logging: update existing oe* logging users to the bb* interface
The new bash logging class provides bbnote, bbwarn, bbfatal, and bbdebug
replacements (as well as bbplain and bberror) for the oe* equivalents. Use the
new bb* API in preparation to delete the oe* logging API.

This patch was automatically generated by a sed script. The result has been
visually inspected and used to build core-image-sato for qemux86.

(From OE-Core rev: a1f09fce5caba389d0484b169f0cde85d64514fa)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-04 00:54:37 +01:00
Darren Hart 029635eb78 kernel: Remove debug statements
A stray echo and du command from my development of the following patch remain in
kernel.bbclass. Remove them.

commit 3b49416fc7
Author: Darren Hart <dvhart@linux.intel.com>
Date:   Tue Mar 8 17:09:10 2011 -0800
kernel/bbclass: rework kernel and module classes to allow for building
out-of-tree modules

(From OE-Core rev: f28bd758bd9a4c59375874853609893546835346)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Tom Zanussi <tom.zanussi@intel.com>
Cc: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-19 18:05:54 +01:00
Darren Hart ae440cd1b8 kernel: Copy over bzImage to sysroots during install
Fixes [Yocto #987]

The following commit introduced a build failure:

Commit 3b49416fc7
Author: Darren Hart <dvhart@linux.intel.com>
Date:   Tue Mar 8 17:09:10 2011 -0800
kernel/bbclass: rework kernel and module classes to allow for building
out-of-tree modules

Resulting in:
| install: cannot stat
`/usr/local/test/intel-bsp/build/tmp/sysroots/n450/kernel/bzImage': No such
file or directory
| ERROR: Function 'build_boot_bin' failed (see
/usr/local/test/intel-bsp/build/tmp/work/core2-poky-linux/poky-image-minimal-live-1.0-r0/temp/log.do_bootimg.1106
for further information)

The bzImage file was not being copied to sysroot, correct that.

(From OE-Core rev: 65cb39826370d3e35229bcc5fe0c8da8b2ab409b)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Tom Zanussi <tom.zanussi@intel.com>
Cc: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-19 18:05:53 +01:00
Richard Purdie b5e03a1a17 base/kernel/image.bbclass: Clean up do_deploy ordering to ensure it just happens before a build completes
(From OE-Core rev: a3b80688465ba5ba7e6d514f9a40ee224a9d3a28)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-29 14:01:49 +01:00
Koen Kooi c106bb61f5 kernel.bbclass: blacklist 'kernel-misc' from kernel-modules
When 'kernel-misc' is empty do_rootfs will fail when including 'kernel-modules'

The proper fix would be to have a whitelist for the 'kernel-modules' meta-pkg

(From OE-Core rev: bb72bd56101698b7fe166dd02fdca07d06a6eb8b)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Tested-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-24 12:33:37 +00:00
Darren Hart 3b49416fc7 kernel/bbclass: rework kernel and module classes to allow for building out-of-tree modules
The existing infrastructure uses an external build tree which references the
kernel source in the work dir. If run with rm work, building external modules
will fail.

This patch places a configured source tree in sysroots. Striking a balance
between minimal size and minimal maintenance is difficult. A fully configured
tree is about 500MB after a clean. This version leans on the side of caution and
removes only the obviously unecessary parts of the source tree to conserve
space, resulting in about 170MB. The arch directories would be some additional
pruning we could do. Given examples from the devel package from distributions, I
suspect this size could be reduced to 75MB or so, but at the cost of a much more
complex recipe which is likely to require a great deal more maintenance to keep
current with kernel releases.

Care is also taken to clean the hostprogs in scripts, and the modules are
responsible for building them as needed. Although it is unclear to me if this is
really necessary, especially considering that modules put these bits back as
soon as they compile. If we are not generating an sstate package, I suspect we
can ignore these.

Please try this with your modules and let me know how it does. I tried to take
non linux-yocto kernel recipes into account, but I have only tested with
linux-yocto and the hello-mod recipe so far.

(From OE-Core rev: a9d41062e24a6b99661b3a5256f369b557433607)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Koen Kooi <koen@dominion.thruhere.net>
Acked-by: Gary Thomas <gary@mlbassoc.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-23 15:43:46 +00:00
Koen Kooi 509364eb63 kernel bbclass: split do_compile into do_compile and do_compile_modules
This allows recipes to insert a custom task in between building *Image and modules

>From OE .dev revision 615876fe218dc3feb4a3df9e6546a7b1a6376800

(From OE-Core rev: a2cc999d663407d17f41e1b0344361944993fa86)

Signed-off-by: Koen Kooi <koen@openembedded.org>
Acked-by: Graeme Gregory <dp@xora.org.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-15 13:20:43 +00:00
Bruce Ashfield 23ecbad5cd kernel: remove explicit bash call in do_menuconfig
Fixes [BUGID #598]

The explicit addition of "bash" before "make menuconfig"
is clearing variables that are required for pseudo. The
end result is that menuconfig often fails silently with:

ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded: ignored.

Removing bash from the menuconfig SHELLCMDS variable fixes
the psudo problem.

(From OE-Core rev: b909f12a92c86fd2fe9348eeec455e2c9ef71f1a)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-03 16:57:43 +00:00
Joshua Lock 6d261a50ba Ensure Bash is used when spawning terminals
We rely on Bashisms when spawning a terminal so ensure that bash is used
when using devshell and menuconfig.

Fixes [BUGID #119]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-02-24 15:54:09 +00:00
Saul Wold e95ab29d3b kernel.bbclass: add approproate X Environment variables to allow xterm to start
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-02-14 05:33:19 -08:00
Darren Hart ba163a4378 kernel.bbclass: use defconfig if it exists
It is common enough to want to apply a defconfig if the inheriting
recipe provides it. If the file exists in the $WORKDIR, copy it
over to ${S}/.config provided the target does not already exist.

This allows for recipes derived from kernel.bbclass to manage the
.config on their own, such as linux.inc.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2011-02-09 22:44:52 +00:00
Richard Purdie 2d9cc7ec31 kernel.bbclass: Add fix from OE.dev for tmpnam() usage
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-01 12:27:20 +00:00
Dongxiao Xu bc9d2fbfd4 staging: Use relative path in sysroot-destdir for target recipes
Original we used absolute path in sysroot-destdir for both native and
target recipes. This commit changes target recipes to use relative path
which is same as the image directory.

[sgw: merged with libtool sysroot work]
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-01-21 11:18:37 +00:00
Richard Purdie 34bf835168 kernel.bbclass: Remove a binary generated by recent kernel versions
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 17:30:44 +00:00
Koen Kooi 041adc9712 kernel bbclass: add 'perf' to kernel-modules blacklist
This makes 'kernel-modules' installable again when perf isn't enabled in the kernel config

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 15:55:25 +00:00
Richard Purdie 14762f71b9 kernel.bbclass: Ensure TOOLCHAIN_OPTIONS is passed to KERNEL_CC and KERNEL_LD
This fixes various incorrect sysroot usages observed by people with sstate.
Thanks to Kevin Tian for figuring out where the problem was and Gary Thomas
for confirming the fix.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-30 10:16:35 +00:00
Richard Purdie 2e94e9a4fe kernel.bbclass: Use KERNEL_IMAGE_BASE_NAME variable instead of the expanded equivalent. Fixes sstate rebuild issue
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-20 21:13:26 +00:00
Kevin Tian cc8ea76d06 kernel.bbclass: Set vardepsexclusive for KERNEL_IMAGE_BASE_NAME
Exclude the DATETIME variable from the KERNEL_IMAGE_BASE_NAME variable.

This avoids the last road block linux-yocto for sstate.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2010-12-16 15:37:40 +00:00
Kevin Tian c9df637486 kernel.bbclass: Rename do_deploy so the function can be overridden in recipes
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2010-12-16 15:36:15 +00:00
Bruce Ashfield 422a017e62 kernel: prefer the kernel produced uImage
The custom uImage produced by the kernel classes by default
does not universally boot and working with existing uboot
configurations and setups.

This changes the preference to the uImage constructed by
the kbuild processes and falls back to the other techniques
if uImage is requested by the kernel does not produce one.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2010-11-10 21:22:27 +08:00
Joshua Lock 8be5593777 kernel.bbclass/linux-wrs: move definition of perf package to kernel class
By defining the perf package in the shared kernel class bitbake will be able to
find the package provider even when the preferred kernel doesn't build perf,
preventing dependency resolution failures.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-09-08 16:42:52 +01:00
Joshua Lock 369920107e deploy.bbclass: use new style staging for deploy tasks
All tasks which implement a do_deploy should inherit this class to have the
changes in the deploy task staged.

Update recipes which include a do_deploy function to inherit this class and
to use DEPLOYDIR rather than DEPLOY_DIR_IMAGE.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-08-19 20:06:25 +01:00
Joshua Lock 67239d4251 kernel.bbclass: Fix adding module dependencies to RDEPENDS
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-08-17 22:49:39 +01:00
Richard Purdie 69ac39b90e kernel.bbclass: do_deploy should use ${B}, not ${S} (which is what ${B} defaults to)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-11 11:14:43 +01:00
Richard Purdie 650319cd74 kernel.bbclass: Exclude scripts/dtc object files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-10 15:29:43 +01:00
Richard Purdie d3630f8174 kernel/package.bbclass: Handle kernel module stripping centrally
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-10 14:47:41 +01:00
Richard Purdie 708db1ef52 kernel.bbclass: Clean up kernel packaging output
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-10 12:02:04 +01:00
Richard Purdie b83179c87e kernel.bbclass: Simplify shell syntax so pysh can cope with it
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-04 11:43:12 +01:00
Bruce Ashfield d39ae18df2 qemu/mips: arrange for vmlinux to be bootable
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2010-07-19 11:59:51 -04:00
Scott Garman 698dab0109 kernel.bbclass: Remove additional binaries from staging
* Remove additonal binaries known to cause "strip command failed"
  errors during do_package on cross platforms.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
2010-06-23 18:43:45 +01:00
Richard Purdie 61a730184b kernel.bbclass: Drop code which is duplicated later in the function, fixing older kernel builds
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-06-09 14:27:13 +01:00
Richard Purdie 6bf1f8c76e kernel.bbclass: Simplify the current external module code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-05-24 11:14:56 +01:00
Scott Garman ae9174ef53 kernel.bbclass: Stop staging binaries within scripts/
* Preserves scripts/ directory but excludes binaries known to cause
  "strip command failed" errors during do_package on cross platforms

Signed-off-by: Scott Garman <sgarman@zenlinux.com>
2010-05-24 10:34:40 +01:00
Joshua Lock 5bec733fb1 kernel.bbclass: tidy up staging of headers
The changes merged from upstream used the ASMDIR variable even when it might
not have been set. These changes may be incorrect but at the very least I can
now build a QEMU image (including v86d) with the 2.6.33 kernel now.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-20 16:09:39 +01:00
Joshua Lock 769cf0b6b0 kernel.bbclass: Package Kernel firmware
Merged change from OE.dev to create packages of the kernel firmware

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-20 14:16:26 +01:00
Joshua Lock e30c5a29d2 kernel.bbclass: match x86 header installation to other architectures
The header installation for x86 was slightly different as to that employed
for other architectures, change them to match for consistency.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-20 12:58:25 +01:00
Joshua Lock 5e07bc9128 kernel.bbclass: fix installing of kernels 2.6.34 and above
Changes merged from upstream to cope with changes to directory structures in
recent kernels when building for x86

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-05-19 12:20:08 +01:00
Richard Purdie 29ae46a866 kernel.bbclass: Use B, not S in KERNEL_VERSION
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-18 11:41:44 +00:00
Richard Purdie 51497a7436 kernel.bbclass: Sync with OE.dev
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-14 15:55:03 +00:00
Richard Purdie affbcf3202 kernel.bbclass: Merge do_stage into do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-19 13:22:48 +00:00
Richard Purdie 5f22458409 debian/kernel/gconf/gtk-icon-cache: PKGDESK/PKG fixes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-16 10:52:35 +00:00
Richard Purdie c54117458a classes: Remove and sanitise import statements
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:28 +00:00
Samuel Ortiz 7994045755 kernel.bbclass: We dont want to tar lib/ if we dont have any modules 2008-10-29 03:00:56 +01:00
Richard Purdie 7a9da6a049 kernel.bbclass: Sync with OE and get recent kernel i386 -> x86 fixes
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4585 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-06-05 10:49:22 +00:00
Richard Purdie 30f83b301c kernel.bbclass: Use INHIBIT_DEFAULT_DEPS to drop virtual/libc dependency since the kernel doesn't need it
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4209 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-04-08 15:31:57 +00:00
Marcin Juszkiewicz e06e7e8cbf kernel.bbclass: use u-boot-mkimage-native for uImage kernels (from linux.inc)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4116 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-03-25 15:48:26 +00:00
Richard Purdie e8efeb30d1 kernel.bbclass: Add staging hooks
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4100 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-03-20 11:39:26 +00:00
Marcin Juszkiewicz 82eaabce95 kernel.bbclass: added deploy task from linux.inc recipe
- creation of modules.tgz
- uImage mangling with uboot-mkimage
- symlinking built kernel


git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3676 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-02-06 15:27:26 +00:00
Marcin Juszkiewicz f1d8a0fe94 kernel.bbclass: indent sizecheck function like rest of file
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3675 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-02-06 15:25:23 +00:00
Richard Purdie d1a302add6 kernel.bbclass: Cleanup various repetition, add include/video to staged files list
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3455 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-01-10 23:35:12 +00:00