Patchwork lttng-modules: allow building without tracepoints enabled in kernel

login
register
mail settings
Submitter Paul Eggleton
Date July 1, 2013, 2:21 p.m.
Message ID <1372688477-27863-1-git-send-email-paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/52739/
State Accepted
Commit fba5c25ba82649b106560183291f3ed60a4bffa7
Headers show

Comments

Paul Eggleton - July 1, 2013, 2:21 p.m.
Avoid a QA failure and instead produce a sensible warning message if no
modules were built.

Fixes [YOCTO #4791].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/recipes-kernel/lttng/lttng-modules_2.1.1.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)
Ross Burton - July 1, 2013, 2:44 p.m.
On 1 July 2013 15:21, Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> +       find ${D}/lib -depth -type d -empty -exec rmdir {} \;

A slightly cleaner form of this:

$ find ${D}/lib -type d -empty -delete

Ross
Paul Eggleton - July 1, 2013, 2:55 p.m.
On Monday 01 July 2013 15:44:10 Burton, Ross wrote:
> On 1 July 2013 15:21, Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> > +       find ${D}/lib -depth -type d -empty -exec rmdir {} \;
> 
> A slightly cleaner form of this:
> 
> $ find ${D}/lib -type d -empty -delete

Right, I did check the find manpage but it only mentioned that -delete deletes 
files. Testing here I see that it does work though. I'll wait for further 
reviews before sending a v2.

Cheers,
Paul
Ross Burton - July 1, 2013, 3:39 p.m.
On 1 July 2013 15:55, Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> Right, I did check the find manpage but it only mentioned that -delete deletes
> files. Testing here I see that it does work though. I'll wait for further
> reviews before sending a v2.

Actually, http://pubs.opengroup.org/onlinepubs/009696699/utilities/find.html
doesn't mention -delete, so it's possible/likely this is a GNUism.  I
retract my comment.

Ross

Patch

diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.1.1.bb b/meta/recipes-kernel/lttng/lttng-modules_2.1.1.bb
index 700c4c5..0bbaa81 100644
--- a/meta/recipes-kernel/lttng/lttng-modules_2.1.1.bb
+++ b/meta/recipes-kernel/lttng/lttng-modules_2.1.1.bb
@@ -22,3 +22,14 @@  export KERNEL_SRC="${STAGING_KERNEL_DIR}"
 
 
 S = "${WORKDIR}/git"
+
+do_install_append() {
+	# Delete empty directories to avoid QA failures if no modules were built
+	find ${D}/lib -depth -type d -empty -exec rmdir {} \;
+}
+
+python do_package_prepend() {
+    if not os.path.exists(os.path.join(d.getVar('D', True), 'lib/modules')):
+        bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN', True))
+}
+