summaryrefslogtreecommitdiff
path: root/meta/classes/module.bbclass
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2013-03-02 18:06:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-04 10:08:02 +0000
commit51928b6b5ca0a46a9dcd754483a19af58b95fa18 (patch)
tree8af3aa03461da1cab773d0c7d2bde1d4552922cf /meta/classes/module.bbclass
parent889a36dffb65e73e8fea125c0923803679adf2ae (diff)
downloadopenembedded-core-51928b6b5ca0a46a9dcd754483a19af58b95fa18.tar.gz
openembedded-core-51928b6b5ca0a46a9dcd754483a19af58b95fa18.tar.bz2
openembedded-core-51928b6b5ca0a46a9dcd754483a19af58b95fa18.zip
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-* 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.bbclass35
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 @@
DEPENDS += "virtual/kernel"
-inherit module-base
+inherit module-base kernel-module-split
addtask make_scripts after do_patch before do_compile
do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
@@ -24,34 +24,9 @@ module_do_install() {
modules_install
}
-module_pkg_postinst () {
-if [ -z "$D" ]; then
- depmod -a ${KERNEL_VERSION}
-else
- depmodwrapper -a -b $D ${KERNEL_VERSION}
-fi
-}
-
-module_pkg_postrm () {
-if [ -z "$D" ]; then
- depmod -a ${KERNEL_VERSION}
-else
- depmodwrapper -a -b $D ${KERNEL_VERSION}
-fi
-}
-
EXPORT_FUNCTIONS do_compile do_install
-MODULE_PACKAGES ?= "${PN}"
-
-python __anonymous() {
- for package in d.getVar("MODULE_PACKAGES", True).split():
- d.appendVar("RDEPENDS_%s" % package, " kernel-image")
- files = d.getVar("MODULE_FILES_%s" % package, True) or "/etc /lib/modules"
- d.appendVar("FILES_%s" % package, " " + files)
- d.appendVar('pkg_postinst_%s' % package, " " + d.getVar('module_pkg_postinst', True))
- d.appendVar('pkg_postrm_%s' % package, " " + d.getVar('module_pkg_postrm', True))
- if not package in d.getVar("PACKAGES", True):
- d.prependVar("PACKAGES", package + " ")
-}
-
+# add all splitted modules to PN RDEPENDS, PN can be empty now
+KERNEL_MODULES_META_PACKAGE = "${PN}"
+FILES_${PN} = ""
+ALLOW_EMPTY_${PN} = "1"