diff options
Diffstat (limited to 'meta/classes/module.bbclass')
-rw-r--r-- | meta/classes/module.bbclass | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass new file mode 100644 index 0000000000..8a13f1f858 --- /dev/null +++ b/meta/classes/module.bbclass | |||
@@ -0,0 +1,51 @@ | |||
1 | RDEPENDS += "kernel (${KERNEL_VERSION})" | ||
2 | DEPENDS += "virtual/kernel" | ||
3 | |||
4 | inherit module-base | ||
5 | |||
6 | python populate_packages_prepend() { | ||
7 | v = bb.data.getVar("PARALLEL_INSTALL_MODULES", d, 1) or "0" | ||
8 | if v == "1": | ||
9 | kv = bb.data.getVar("KERNEL_VERSION", d, 1) | ||
10 | packages = bb.data.getVar("PACKAGES", d, 1) | ||
11 | for p in packages.split(): | ||
12 | pkg = bb.data.getVar("PKG_%s" % p, d, 1) or p | ||
13 | newpkg = "%s-%s" % (pkg, kv) | ||
14 | bb.data.setVar("PKG_%s" % p, newpkg, d) | ||
15 | rprovides = bb.data.getVar("RPROVIDES_%s" % p, d, 1) | ||
16 | if rprovides: | ||
17 | rprovides = "%s %s" % (rprovides, pkg) | ||
18 | else: | ||
19 | rprovides = pkg | ||
20 | bb.data.setVar("RPROVIDES_%s" % p, rprovides, d) | ||
21 | } | ||
22 | |||
23 | module_do_compile() { | ||
24 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS | ||
25 | oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \ | ||
26 | KERNEL_SRC=${STAGING_KERNEL_DIR} \ | ||
27 | KERNEL_VERSION=${KERNEL_VERSION} \ | ||
28 | CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ | ||
29 | ${MAKE_TARGETS} | ||
30 | } | ||
31 | |||
32 | module_do_install() { | ||
33 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS | ||
34 | oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" CC="${KERNEL_CC}" LD="${KERNEL_LD}" modules_install | ||
35 | } | ||
36 | |||
37 | pkg_postinst_append () { | ||
38 | if [ -n "$D" ]; then | ||
39 | exit 1 | ||
40 | fi | ||
41 | depmod -A | ||
42 | update-modules || true | ||
43 | } | ||
44 | |||
45 | pkg_postrm_append () { | ||
46 | update-modules || true | ||
47 | } | ||
48 | |||
49 | EXPORT_FUNCTIONS do_compile do_install | ||
50 | |||
51 | FILES_${PN} = "/etc /lib/modules" | ||