diff options
author | Saul Wold <sgw@linux.intel.com> | 2013-01-30 15:05:49 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-01 15:54:30 +0000 |
commit | 966aa9ec62968b83504155fbf5f3b978d0b1f6cc (patch) | |
tree | b51bc6175fdeaa17f5629daa2ae042ea94e30223 /meta/classes | |
parent | 497ec60bf8d4008df5d487e352c29db1aeacef5a (diff) | |
download | poky-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')
-rw-r--r-- | meta/classes/module.bbclass | 19 |
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 @@ | |||
1 | RDEPENDS_${PN} += "kernel-image" | ||
2 | DEPENDS += "virtual/kernel" | 1 | DEPENDS += "virtual/kernel" |
3 | 2 | ||
4 | inherit module-base | 3 | inherit module-base |
@@ -25,7 +24,7 @@ module_do_install() { | |||
25 | modules_install | 24 | modules_install |
26 | } | 25 | } |
27 | 26 | ||
28 | pkg_postinst_${PN}_append () { | 27 | module_pkg_postinst () { |
29 | if [ -z "$D" ]; then | 28 | if [ -z "$D" ]; then |
30 | depmod -a ${KERNEL_VERSION} | 29 | depmod -a ${KERNEL_VERSION} |
31 | else | 30 | else |
@@ -33,7 +32,7 @@ else | |||
33 | fi | 32 | fi |
34 | } | 33 | } |
35 | 34 | ||
36 | pkg_postrm_${PN}_append () { | 35 | module_pkg_postrm () { |
37 | if [ -z "$D" ]; then | 36 | if [ -z "$D" ]; then |
38 | depmod -a ${KERNEL_VERSION} | 37 | depmod -a ${KERNEL_VERSION} |
39 | else | 38 | else |
@@ -43,4 +42,16 @@ fi | |||
43 | 42 | ||
44 | EXPORT_FUNCTIONS do_compile do_install | 43 | EXPORT_FUNCTIONS do_compile do_install |
45 | 44 | ||
46 | FILES_${PN} = "/etc /lib/modules" | 45 | MODULE_PACKAGES ?= "${PN}" |
46 | |||
47 | python __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 | |||