]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
kernel.bbclass: remove empty module directories to prevent QA issues
authorOvidiu Panait <ovidiu.panait@windriver.com>
Mon, 5 Dec 2022 14:56:49 +0000 (16:56 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Dec 2022 23:04:58 +0000 (23:04 +0000)
Currently, allyesconfig test runs for x86_64 fail with:
ERROR: linux-yocto-5.19.17+gitAUTOINC+0cba9aa404_aaf4490d18-r0 do_package:
QA Issue: linux-yocto: Files/directories were installed but not shipped in any
package:
  /lib/modules/5.19.17/kernel/drivers/nvdimm

With CONFIG_NVDIMM_TEST_BUILD=m, an empty nvdimm directory is created during
modules_install, which triggers the QA issue.

Extend kernel_do_install() to also remove inner empty directories that might
get created by modules_install.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 7120b09a33af4c9a18063c0f2e51fb598697e39c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes-recipe/kernel.bbclass

index 3f6b40907f45e80dce5ec576e587aa11ac2a7340..553e17bb4ead9224b1f3dcf0204c77f09580f109 100644 (file)
@@ -450,8 +450,8 @@ kernel_do_install() {
                oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
                rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
                rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
-               # If the kernel/ directory is empty remove it to prevent QA issues
-               rmdir --ignore-fail-on-non-empty "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel"
+               # Remove empty module directories to prevent QA issues
+               find "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" -type d -empty -delete
        else
                bbnote "no modules to install"
        fi