From: Saul Wold <sgw@linux.intel.com>
To: openembedded-core@lists.openembedded.org, dvhart@linux.intel.com
Subject: [PATCH] module.bbclass: Allow for modules to be packaged seperate from ${PN}
Date: Wed, 30 Jan 2013 15:05:49 -0800 [thread overview]
Message-ID: <1359587149-27928-1-git-send-email-sgw@linux.intel.com> (raw)
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]
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
meta/classes/module.bbclass | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index c933d32..e2174a1 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -1,4 +1,3 @@
-RDEPENDS_${PN} += "kernel-image"
DEPENDS += "virtual/kernel"
inherit module-base
@@ -25,7 +24,7 @@ module_do_install() {
modules_install
}
-pkg_postinst_${PN}_append () {
+module_pkg_postinst () {
if [ -z "$D" ]; then
depmod -a ${KERNEL_VERSION}
else
@@ -33,7 +32,7 @@ else
fi
}
-pkg_postrm_${PN}_append () {
+module_pkg_postrm () {
if [ -z "$D" ]; then
depmod -a ${KERNEL_VERSION}
else
@@ -43,4 +42,16 @@ fi
EXPORT_FUNCTIONS do_compile do_install
-FILES_${PN} = "/etc /lib/modules"
+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 + " ")
+}
+
--
1.8.0.2
next reply other threads:[~2013-01-30 23:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 23:05 Saul Wold [this message]
2013-01-31 0:03 ` [PATCH] module.bbclass: Allow for modules to be packaged seperate from ${PN} Darren Hart
2013-01-31 0:19 ` Saul Wold
2013-01-31 0:30 ` Darren Hart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359587149-27928-1-git-send-email-sgw@linux.intel.com \
--to=sgw@linux.intel.com \
--cc=dvhart@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.