Openembedded Core Discussions
 help / color / mirror / Atom feed
* [kirkstone][PATCH] kernel.bbclass: check, if directory exists before removing empty module directory
@ 2024-04-11  8:05 Heiko Thole
  2024-04-11  8:05 ` [PATCH] " Heiko Thole
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Heiko Thole @ 2024-04-11  8:05 UTC (permalink / raw)
  To: openembedded-core; +Cc: Heiko Thole

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>
---
 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index dbd89057f3..988a489396 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -452,7 +452,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
--
2.41.0

eQ-3 Entwicklung GmbH, Maiburger Str. 36, 26789 Leer
Geschäftsführer: Prof. Heinz-G. Redeker
Registergericht: Amtsgericht Aurich, HRB 110388
eQ-3 AG, Maiburger Str. 29, 26789 Leer
Vorstand: Prof. Heinz-G. Redeker (Vorsitzender), Helga Redeker
Vorsitzende des Aufsichtsrats: Irmgard Keplin
Registergericht: Amtsgericht Aurich, HRB 200335


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-04-12 12:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-11  8:05 [kirkstone][PATCH] kernel.bbclass: check, if directory exists before removing empty module directory Heiko Thole
2024-04-11  8:05 ` [PATCH] " Heiko Thole
2024-04-11  8:16 ` [OE-core] [kirkstone][PATCH] " Quentin Schulz
2024-04-11  8:32   ` Heiko
2024-04-11 13:26 ` [OE-core] " Steve Sakoman
2024-04-11 13:40   ` Heiko
2024-04-12  9:03     ` [OE-core] " Matthias Schiffer
2024-04-12  9:52       ` Heiko
2024-04-12 12:18         ` [OE-core] " Steve Sakoman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox