diff options
-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 | |||