diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-10-21 21:05:30 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-21 12:37:53 +0000 |
commit | 86893e4ea5896199a6f02f8475f4f17aa1124c37 (patch) | |
tree | 8991c2825bdf69b41c8b30ff00db68663566209e /meta/classes/linux-kernel-base.bbclass | |
parent | 1ff64a7e848dcdd540e1c60acec1d0ad80a642bb (diff) | |
download | poky-86893e4ea5896199a6f02f8475f4f17aa1124c37.tar.gz |
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>
Diffstat (limited to 'meta/classes/linux-kernel-base.bbclass')
-rw-r--r-- | meta/classes/linux-kernel-base.bbclass | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/classes/linux-kernel-base.bbclass b/meta/classes/linux-kernel-base.bbclass index 4f2b0a4a98..89ce71605c 100644 --- a/meta/classes/linux-kernel-base.bbclass +++ b/meta/classes/linux-kernel-base.bbclass | |||
@@ -1,5 +1,5 @@ | |||
1 | # parse kernel ABI version out of <linux/version.h> | 1 | # parse kernel ABI version out of <linux/version.h> |
2 | def get_kernelversion(p): | 2 | def get_kernelversion_headers(p): |
3 | import re | 3 | import re |
4 | 4 | ||
5 | fn = p + '/include/linux/utsrelease.h' | 5 | fn = p + '/include/linux/utsrelease.h' |
@@ -9,7 +9,6 @@ def get_kernelversion(p): | |||
9 | if not os.path.isfile(fn): | 9 | if not os.path.isfile(fn): |
10 | fn = p + '/include/linux/version.h' | 10 | fn = p + '/include/linux/version.h' |
11 | 11 | ||
12 | import re | ||
13 | try: | 12 | try: |
14 | f = open(fn, 'r') | 13 | f = open(fn, 'r') |
15 | except IOError: | 14 | except IOError: |
@@ -24,6 +23,16 @@ def get_kernelversion(p): | |||
24 | return m.group(1) | 23 | return m.group(1) |
25 | return None | 24 | return None |
26 | 25 | ||
26 | |||
27 | def get_kernelversion_file(p): | ||
28 | fn = p + '/kernel-abiversion' | ||
29 | |||
30 | try: | ||
31 | with open(fn, 'r') as f: | ||
32 | return f.readlines()[0].strip() | ||
33 | except IOError: | ||
34 | return None | ||
35 | |||
27 | def linux_module_packages(s, d): | 36 | def linux_module_packages(s, d): |
28 | suffix = "" | 37 | suffix = "" |
29 | return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split())) | 38 | return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split())) |