From: Heiko <[email protected]>

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 <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
Signed-off-by: Richard Purdie <[email protected]>
(cherry picked from commit 7ef767d84d56b25498e45db83bb8f9d9caebeaf9)
Signed-off-by: Steve Sakoman <[email protected]>
---
 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.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#199168): 
https://lists.openembedded.org/g/openembedded-core/message/199168
Mute This Topic: https://lists.openembedded.org/mt/105999472/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to