recipes-kernel: Check if CONFIG_MODULES is set

Message ID 20220728144936.726266-1-Quirin.Gylstorff@siemens.com
State Accepted, archived
Headers show
Series recipes-kernel: Check if CONFIG_MODULES is set | expand

Commit Message

Quirin Gylstorff July 28, 2022, 6:49 a.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

This fixes an error during the kernel build with sbuild if
Modules.symvers doesn't exist as find returns 1 if a name
could not be found.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 meta/recipes-kernel/linux/files/debian/isar/install.tmpl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Anton Mikanovich Aug. 3, 2022, 11:05 p.m. UTC | #1
28.07.2022 17:49, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>
> This fixes an error during the kernel build with sbuild if
> Modules.symvers doesn't exist as find returns 1 if a name
> could not be found.
>
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Applied to next, thanks.

Patch

diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
index c6b5059..909b01b 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
@@ -173,7 +173,10 @@  kernel_headers() {
     (cd ${S}; find arch/${ARCH} -name module.lds -o -name Kbuild.platforms -o -name Platform) >>${src_hdr_files}
     (cd ${S}; find $(find arch/${ARCH} -name include -o -name scripts -type d) -type f) >>${src_hdr_files}
 
-    (cd ${O}; find arch/${ARCH}/include Module.symvers include scripts -type f) >>${obj_hdr_files}
+    if [ -n "${CONFIG_MODULES}" ]; then
+        echo Module.symvers >> ${obj_hdr_files}
+    fi
+    (cd ${O}; find arch/${ARCH}/include include scripts -type f) >>${obj_hdr_files}
     if [ -n "${CONFIG_STACK_VALIDATION}" ]; then
         (cd ${O}; find tools/objtool -type f -executable) >>${obj_hdr_files}
     fi