From: Heiko Date: Mon, 15 Apr 2024 05:34:22 +0000 (+0200) Subject: kernel.bbclass: check, if directory exists before removing empty module directory X-Git-Tag: uninative-4.5~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ef767d84d56b25498e45db83bb8f9d9caebeaf9;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git kernel.bbclass: check, if directory exists before removing empty module directory If the kernel folder does not exist, find will result in an error. This can occur if the kernel has no modules but, for example, custom modules are created. Add check before deleting. Signed-off-by: Heiko Thole Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index b084d6d69dc..c0a2056fec5 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -463,7 +463,7 @@ kernel_do_install() { rm -f "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build" rm -f "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source" # Remove empty module directories to prevent QA issues - find "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" -type d -empty -delete + [ -d "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" ] && find "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" -type d -empty -delete else bbnote "no modules to install" fi