diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2013-03-02 18:06:56 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-05 13:14:50 +0000 |
commit | 2b8f2e770e074ee6735440c2e44eb56397857858 (patch) | |
tree | 00817af99869f35b9f54cef67546cd987b9ac185 /meta/classes/module.bbclass | |
parent | 93ec7b4d1550e07caec86e2998d0f94a01c7e785 (diff) | |
download | poky-2b8f2e770e074ee6735440c2e44eb56397857858.tar.gz |
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>
Diffstat (limited to 'meta/classes/module.bbclass')
-rw-r--r-- | meta/classes/module.bbclass | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass index 2c1888c8d2..ad6f7af1bb 100644 --- a/meta/classes/module.bbclass +++ b/meta/classes/module.bbclass | |||
@@ -1,6 +1,6 @@ | |||
1 | DEPENDS += "virtual/kernel" | 1 | DEPENDS += "virtual/kernel" |
2 | 2 | ||
3 | inherit module-base | 3 | inherit module-base kernel-module-split |
4 | 4 | ||
5 | addtask make_scripts after do_patch before do_compile | 5 | addtask make_scripts after do_patch before do_compile |
6 | do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock" | 6 | do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock" |
@@ -24,34 +24,9 @@ module_do_install() { | |||
24 | modules_install | 24 | modules_install |
25 | } | 25 | } |
26 | 26 | ||
27 | module_pkg_postinst () { | ||
28 | if [ -z "$D" ]; then | ||
29 | depmod -a ${KERNEL_VERSION} | ||
30 | else | ||
31 | depmodwrapper -a -b $D ${KERNEL_VERSION} | ||
32 | fi | ||
33 | } | ||
34 | |||
35 | module_pkg_postrm () { | ||
36 | if [ -z "$D" ]; then | ||
37 | depmod -a ${KERNEL_VERSION} | ||
38 | else | ||
39 | depmodwrapper -a -b $D ${KERNEL_VERSION} | ||
40 | fi | ||
41 | } | ||
42 | |||
43 | EXPORT_FUNCTIONS do_compile do_install | 27 | EXPORT_FUNCTIONS do_compile do_install |
44 | 28 | ||
45 | MODULE_PACKAGES ?= "${PN}" | 29 | # add all splitted modules to PN RDEPENDS, PN can be empty now |
46 | 30 | KERNEL_MODULES_META_PACKAGE = "${PN}" | |
47 | python __anonymous() { | 31 | FILES_${PN} = "" |
48 | for package in d.getVar("MODULE_PACKAGES", True).split(): | 32 | ALLOW_EMPTY_${PN} = "1" |
49 | d.appendVar("RDEPENDS_%s" % package, " kernel-image") | ||
50 | files = d.getVar("MODULE_FILES_%s" % package, True) or "/etc /lib/modules" | ||
51 | d.appendVar("FILES_%s" % package, " " + files) | ||
52 | d.appendVar('pkg_postinst_%s' % package, " " + d.getVar('module_pkg_postinst', True)) | ||
53 | d.appendVar('pkg_postrm_%s' % package, " " + d.getVar('module_pkg_postrm', True)) | ||
54 | if not package in d.getVar("PACKAGES", True): | ||
55 | d.prependVar("PACKAGES", package + " ") | ||
56 | } | ||
57 | |||