Skip to contentSkip to conversation

lttng-modules: do not search in non-existing folder during install

PATCH New Anibal Limon 1 participant 1 message Dec 8, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lttng-modules: do not search in non-existing folder during install

From: Andrey Zhizhikin <[email protected]>

When CONFIG_TRACEPOINTS is not enabled in kernel config - module compilation is skipped, which causes the ${D}/${nonarch_base_libdir} not to be created.

This fails later in do_install:append() due to the fact that find command in executed for non-existing folder.

Check for folder existence before find command in executed.

(cherry picked from commit de0aa1700ed4e6f04b0a233eb1f6d2ac598e7ed8)
---
 meta/recipes-kernel/lttng/lttng-modules_2.11.6.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-kernel/lttng/lttng-modules_2.11.6.bb +3 -1
index 3fdc8094e9..3145f0298c 100644
@@ -39,7 +39,9 @@ EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'"
 
 do_install_append() {
 	# Delete empty directories to avoid QA failures if no modules were built
-	find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \;
+	if [ -d ${D}/${nonarch_base_libdir} ]; then
+		find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \;
+	fi
 }
 
 python do_package_prepend() {
Signature · 1 line
2.34.1