]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
kernel.bbclass: check, if directory exists before removing empty module directory
authorHeiko <heiko.thole@entwicklung.eq-3.de>
Mon, 15 Apr 2024 05:34:22 +0000 (07:34 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 25 Apr 2024 12:39:17 +0000 (13:39 +0100)
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 <heiko.thole@entwicklung.eq-3.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/kernel.bbclass

index b084d6d69dc15116f5c78e543b13b2672c9331e6..c0a2056fec5e9c0faa4f03f66f97cd6e7210448f 100644 (file)
@@ -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