diff mbox series

[isar-cip-core,4/4] kas-cip: Add patch for linux-cip with CONFIG_MODULES=n

Message ID 20220729083931.419731-5-Quirin.Gylstorff@siemens.com (mailing list archive)
State Handled Elsewhere
Headers show
Series Add support for ISAR with sbuild | expand

Commit Message

Quirin Gylstorff July 29, 2022, 8:39 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>
---
 ...ernel-Check-if-CONFIG_MODULES-is-set.patch | 33 +++++++++++++++++++
 kas-cip.yml                                   |  4 +++
 2 files changed, 37 insertions(+)
 create mode 100644 isar-patches/0001-recipes-kernel-Check-if-CONFIG_MODULES-is-set.patch

Comments

Jan Kiszka July 29, 2022, 9 a.m. UTC | #1
On 29.07.22 10:39, 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>
> ---
>  ...ernel-Check-if-CONFIG_MODULES-is-set.patch | 33 +++++++++++++++++++
>  kas-cip.yml                                   |  4 +++
>  2 files changed, 37 insertions(+)
>  create mode 100644 isar-patches/0001-recipes-kernel-Check-if-CONFIG_MODULES-is-set.patch
> 
> diff --git a/isar-patches/0001-recipes-kernel-Check-if-CONFIG_MODULES-is-set.patch b/isar-patches/0001-recipes-kernel-Check-if-CONFIG_MODULES-is-set.patch
> new file mode 100644
> index 0000000..d07c36d
> --- /dev/null
> +++ b/isar-patches/0001-recipes-kernel-Check-if-CONFIG_MODULES-is-set.patch
> @@ -0,0 +1,33 @@
> +From 6ad8f9bb92d3722ff5eb60f09e5ef75ba5febcbd Mon Sep 17 00:00:00 2001
> +From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> +Date: Thu, 28 Jul 2022 16:24:16 +0200
> +Subject: [PATCH] recipes-kernel: Check if CONFIG_MODULES is set
> +
> +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(-)
> +
> +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
> +-- 
> +2.35.1
> +
> diff --git a/kas-cip.yml b/kas-cip.yml
> index a39820f..5a43cd1 100644
> --- a/kas-cip.yml
> +++ b/kas-cip.yml
> @@ -25,6 +25,10 @@ repos:
>      refspec: 64c755053d1252d183757b294cf9849fced64799
>      layers:
>        meta:
> +    patches:
> +      fix-hihope-kernel-build:
> +        repo: cip-core
> +        path: isar-patches/0001-recipes-kernel-Check-if-CONFIG_MODULES-is-set.patch
>  
>  bblayers_conf_header:
>    standard: |

Does the patch depend on the Isar update? Then maybe merge it with patch 1.

Jan
diff mbox series

Patch

diff --git a/isar-patches/0001-recipes-kernel-Check-if-CONFIG_MODULES-is-set.patch b/isar-patches/0001-recipes-kernel-Check-if-CONFIG_MODULES-is-set.patch
new file mode 100644
index 0000000..d07c36d
--- /dev/null
+++ b/isar-patches/0001-recipes-kernel-Check-if-CONFIG_MODULES-is-set.patch
@@ -0,0 +1,33 @@ 
+From 6ad8f9bb92d3722ff5eb60f09e5ef75ba5febcbd Mon Sep 17 00:00:00 2001
+From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
+Date: Thu, 28 Jul 2022 16:24:16 +0200
+Subject: [PATCH] recipes-kernel: Check if CONFIG_MODULES is set
+
+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(-)
+
+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
+-- 
+2.35.1
+
diff --git a/kas-cip.yml b/kas-cip.yml
index a39820f..5a43cd1 100644
--- a/kas-cip.yml
+++ b/kas-cip.yml
@@ -25,6 +25,10 @@  repos:
     refspec: 64c755053d1252d183757b294cf9849fced64799
     layers:
       meta:
+    patches:
+      fix-hihope-kernel-build:
+        repo: cip-core
+        path: isar-patches/0001-recipes-kernel-Check-if-CONFIG_MODULES-is-set.patch
 
 bblayers_conf_header:
   standard: |