summaryrefslogtreecommitdiffstats
path: root/meta/classes/module.bbclass
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2011-03-08 17:09:10 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-03-23 15:43:46 +0000
commit3b49416fc7a7ee9bfe722f2e6089aa18df41dc58 (patch)
treeab6ce4d67323d76943ab1d234377921e2b06989f /meta/classes/module.bbclass
parentab44c22a3840060a65faff871404ca4fac555c2f (diff)
downloadpoky-3b49416fc7a7ee9bfe722f2e6089aa18df41dc58.tar.gz
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>
Diffstat (limited to 'meta/classes/module.bbclass')
-rw-r--r--meta/classes/module.bbclass9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index bbceaf7219..572df0d295 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -3,14 +3,19 @@ DEPENDS += "virtual/kernel"
3 3
4inherit module-base 4inherit module-base
5 5
6# Ensure the hostprogs are available for module compilation 6#
7module_do_compile_prepend() { 7# Ensure the hostprogs are available for module compilation. Modules that
8# inherit this recipe and override do_compile() should be sure to call
9# do_make_scripts() or ensure the scripts are built independently.
10#
11do_make_scripts() {
8 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS 12 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
9 oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \ 13 oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
10 -C ${STAGING_KERNEL_DIR} scripts 14 -C ${STAGING_KERNEL_DIR} scripts
11} 15}
12 16
13module_do_compile() { 17module_do_compile() {
18 do_make_scripts
14 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS 19 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
15 oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \ 20 oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \
16 KERNEL_SRC=${STAGING_KERNEL_DIR} \ 21 KERNEL_SRC=${STAGING_KERNEL_DIR} \