summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorStefan Wiehler <stefan.wiehler@missinglinkelectronics.com>2017-05-05 17:01:06 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-30 10:15:19 +0100
commit909b50bb6cb6e3a13ac89753ab0f235fdf862524 (patch)
tree32706e6715ce35c62213e060d024a0668b9ba676 /meta/classes
parent41dcb7d3bd666798e3a862d3a09e716eb0492f26 (diff)
downloadpoky-909b50bb6cb6e3a13ac89753ab0f235fdf862524.tar.gz
module.bbclass: Add devshell support
Adds development shell support for out-of-tree kernel modules by reproducing the build environment of the compile task. (From OE-Core rev: 08e366a386caab547e0dbcad2d4ee08f44814262) Signed-off-by: Stefan Wiehler <stefan.wiehler@missinglinkelectronics.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/module.bbclass20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index 802476bc7a..391776db22 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -18,6 +18,26 @@ python __anonymous () {
18 d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols)) 18 d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols))
19} 19}
20 20
21python do_devshell_prepend () {
22 os.environ['CFLAGS'] = ''
23 os.environ['CPPFLAGS'] = ''
24 os.environ['CXXFLAGS'] = ''
25 os.environ['LDFLAGS'] = ''
26
27 os.environ['KERNEL_PATH'] = d.getVar('STAGING_KERNEL_DIR')
28 os.environ['KERNEL_SRC'] = d.getVar('STAGING_KERNEL_DIR')
29 os.environ['KERNEL_VERSION'] = d.getVar('KERNEL_VERSION')
30 os.environ['CC'] = d.getVar('KERNEL_CC')
31 os.environ['LD'] = d.getVar('KERNEL_LD')
32 os.environ['AR'] = d.getVar('KERNEL_AR')
33 os.environ['O'] = d.getVar('STAGING_KERNEL_BUILDDIR')
34 kbuild_extra_symbols = d.getVar('KBUILD_EXTRA_SYMBOLS')
35 if kbuild_extra_symbols:
36 os.environ['KBUILD_EXTRA_SYMBOLS'] = kbuild_extra_symbols
37 else:
38 os.environ['KBUILD_EXTRA_SYMBOLS'] = ''
39}
40
21module_do_compile() { 41module_do_compile() {
22 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS 42 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
23 oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \ 43 oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \