Skip to contentSkip to conversation

lttng-modules: allow building without tracepoints enabled in kernel

PATCH In review Paul Eggleton 2 participants 4 messages Jul 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lttng-modules: allow building without tracepoints enabled in kernel

Avoid a QA failure and instead produce a sensible warning message if no modules were built.

Fixes [YOCTO #4791].

---
 meta/recipes-kernel/lttng/lttng-modules_2.1.1.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta/recipes-kernel/lttng/lttng-modules_2.1.1.bb +11 -0
index 700c4c5..0bbaa81 100644
@@ -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))
+}
+
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 1 line · Paul Eggleton

+ find ${D}/lib -depth -type d -empty -exec rmdir {} \;

A slightly cleaner form of this:

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

Ross

#2 lore raw
Quoted 6 lines · Ross
Quoted 1 line · Paul Eggleton

+ 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

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre