Hi Quentin,

On Thu, Apr 11, 2024 at 10:16 AM, Quentin Schulz wrote:
rm --dir --force
"${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel"

instead?

-f, --force
ignore nonexistent files and arguments, never prompt

-d, --dir
remove empty directories

Cheers,
Quentin

rm --dir --force does not work if the directory exists:

rm: cannot remove '/yocto/source/build-cm4/tmp/work/raspberrypi4_64-poky-linux/linux-yocto/6.6.25+git-r0/image/lib/modules/6.6.25-hcu/kernel': Directory not empty

Best regards
Heiko