summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko <heiko.thole@entwicklung.eq-3.de>2024-04-15 07:34:22 +0200
committerSteve Sakoman <steve@sakoman.com>2024-06-19 08:34:58 -0700
commitd6ae637763b10ba26118d5594f1140e2ef819886 (patch)
tree1861dcf9b124974b7602d11c755c5d9f4bb9b10f
parentc27fdaedbdc2a5f0b4d4858d1c200760dfdca1ca (diff)
downloadpoky-d6ae637763b10ba26118d5594f1140e2ef819886.tar.gz
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. (From OE-Core rev: 63856721cab409ae0598cfbff4fcf55c90bfd7e7) Signed-off-by: Heiko Thole <heiko.thole@entwicklung.eq-3.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7ef767d84d56b25498e45db83bb8f9d9caebeaf9) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/classes-recipe/kernel.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index b084d6d69d..c0a2056fec 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -463,7 +463,7 @@ kernel_do_install() {
463 rm -f "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build" 463 rm -f "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
464 rm -f "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source" 464 rm -f "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
465 # Remove empty module directories to prevent QA issues 465 # Remove empty module directories to prevent QA issues
466 find "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" -type d -empty -delete 466 [ -d "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" ] && find "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" -type d -empty -delete
467 else 467 else
468 bbnote "no modules to install" 468 bbnote "no modules to install"
469 fi 469 fi