lttng-modules: allow building without tracepoints enabled in kernel
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
@@ -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
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 -deleteRoss
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
Quoted 3 lines · Paul Eggleton
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