summaryrefslogtreecommitdiffstats
path: root/meta/classes/module.bbclass
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2013-01-30 15:05:49 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-01 15:54:30 +0000
commit966aa9ec62968b83504155fbf5f3b978d0b1f6cc (patch)
treeb51bc6175fdeaa17f5629daa2ae042ea94e30223 /meta/classes/module.bbclass
parent497ec60bf8d4008df5d487e352c29db1aeacef5a (diff)
downloadpoky-966aa9ec62968b83504155fbf5f3b978d0b1f6cc.tar.gz
module.bbclass: Allow for modules to be packaged seperate from ${PN}
This patch will allow recipes that provide kernel modules to package the module or modules in specific packages. That list is contained in MODULE_PACKAGES, this defaults to to preserve the current behavior. The package can also define MODULE_FILES to specify files. [YOCTO #3803] (From OE-Core rev: c1ff0467bf03a3342846f0d9dde74e34b740798f) (From OE-Core rev: 977aee43868499ab87a098f3798e90d6978836b9) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/module.bbclass')
-rw-r--r--meta/classes/module.bbclass19
1 files changed, 15 insertions, 4 deletions
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index c933d3226d..e2174a16fd 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -1,4 +1,3 @@
1RDEPENDS_${PN} += "kernel-image"
2DEPENDS += "virtual/kernel" 1DEPENDS += "virtual/kernel"
3 2
4inherit module-base 3inherit module-base
@@ -25,7 +24,7 @@ module_do_install() {
25 modules_install 24 modules_install
26} 25}
27 26
28pkg_postinst_${PN}_append () { 27module_pkg_postinst () {
29if [ -z "$D" ]; then 28if [ -z "$D" ]; then
30 depmod -a ${KERNEL_VERSION} 29 depmod -a ${KERNEL_VERSION}
31else 30else
@@ -33,7 +32,7 @@ else
33fi 32fi
34} 33}
35 34
36pkg_postrm_${PN}_append () { 35module_pkg_postrm () {
37if [ -z "$D" ]; then 36if [ -z "$D" ]; then
38 depmod -a ${KERNEL_VERSION} 37 depmod -a ${KERNEL_VERSION}
39else 38else
@@ -43,4 +42,16 @@ fi
43 42
44EXPORT_FUNCTIONS do_compile do_install 43EXPORT_FUNCTIONS do_compile do_install
45 44
46FILES_${PN} = "/etc /lib/modules" 45MODULE_PACKAGES ?= "${PN}"
46
47python __anonymous() {
48 for package in d.getVar("MODULE_PACKAGES", True).split():
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