[PATCH] linux-custom: Fix logic for find command in `install_kbuild()`

4 views
Skip to first unread message

Stefan Koch

unread,
Nov 17, 2025, 10:49:50 AMNov 17
to isar-...@googlegroups.com, stefa...@siemens.com, jan.k...@siemens.com, christi...@siemens.com, cedric.h...@siemens.com, adriaan...@siemens.com, felix.mo...@siemens.com, quirin.g...@siemens.com, ub...@ilbers.de
Previously, two paths in `install_kbuild()` were combined with AND,
which always returned an empty file list.
This change switches to OR logic, providing the files excluded
by the corresponding find call in `kernel_headers()`.

Signed-off-by: Stefan Koch <stefa...@siemens.com>
---
meta/recipes-kernel/linux/files/debian/isar/install.tmpl | 2 +-
1 file changed, 1 insertion(+), 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 a1b00d39..6fa94508 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
@@ -252,7 +252,7 @@ install_kbuild() {

mkdir -p ${destdir}

- (cd ${S}; find . -path './scripts/*' -a -path './tools/*' -a \( -name 'Makefile*' -o -name 'Kconfig*' -o -name '*.pl' \)) >>${src_kbuild_files}
+ (cd ${S}; find . \( -path './scripts/*' -o -path './tools/*' \) -a \( -name 'Makefile*' -o -name 'Kconfig*' -o -name '*.pl' \)) >>${src_kbuild_files}
(cd ${S}; find scripts -type f -o -type l) >>${src_kbuild_files}

(cd ${O}; find scripts -type f) >>${obj_kbuild_files}
--
2.39.5

Jan Kiszka

unread,
Nov 17, 2025, 10:56:33 AMNov 17
to Stefan Koch, isar-...@googlegroups.com, christi...@siemens.com, cedric.h...@siemens.com, adriaan...@siemens.com, felix.mo...@siemens.com, quirin.g...@siemens.com, ub...@ilbers.de
On 17.11.25 16:49, Stefan Koch wrote:
> Previously, two paths in `install_kbuild()` were combined with AND,
> which always returned an empty file list.
> This change switches to OR logic, providing the files excluded
> by the corresponding find call in `kernel_headers()`.
>

So, what was the result of this issue? Was kbuild broken, or when
exactly was it?

Jan

> Signed-off-by: Stefan Koch <stefa...@siemens.com>
> ---
> meta/recipes-kernel/linux/files/debian/isar/install.tmpl | 2 +-
> 1 file changed, 1 insertion(+), 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 a1b00d39..6fa94508 100644
> --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> @@ -252,7 +252,7 @@ install_kbuild() {
>
> mkdir -p ${destdir}
>
> - (cd ${S}; find . -path './scripts/*' -a -path './tools/*' -a \( -name 'Makefile*' -o -name 'Kconfig*' -o -name '*.pl' \)) >>${src_kbuild_files}
> + (cd ${S}; find . \( -path './scripts/*' -o -path './tools/*' \) -a \( -name 'Makefile*' -o -name 'Kconfig*' -o -name '*.pl' \)) >>${src_kbuild_files}
> (cd ${S}; find scripts -type f -o -type l) >>${src_kbuild_files}
>
> (cd ${O}; find scripts -type f) >>${obj_kbuild_files}

--
Siemens AG, Foundational Technologies
Linux Expert Center

Koch, Stefan

unread,
Nov 17, 2025, 11:18:02 AMNov 17
to isar-...@googlegroups.com, Kiszka, Jan, quirin.g...@siemens.com, Storm, Christian, Schmidt, Adriaan, cedric.h...@siemens.com, ub...@ilbers.de, MOESSBAUER, Felix
On Mon, 2025-11-17 at 16:56 +0100, Jan Kiszka wrote:
> On 17.11.25 16:49, Stefan Koch wrote:
> > Previously, two paths in `install_kbuild()` were combined with AND,
> > which always returned an empty file list.
> > This change switches to OR logic, providing the files excluded
> > by the corresponding find call in `kernel_headers()`.
> >
>
> So, what was the result of this issue? Was kbuild broken, or when
> exactly was it?
This is only a minor issue. Kbuild was working anyway, I don't noticed
any failure case because of that.

related line from kernel_headers():
(cd ${S}; find . -not -path './scripts/*' -a -not -path './tools/*' -a
\( -name 'Makefile*' -o -name 'Kconfig*' -o -name '*.pl' \))
>>${src_hdr_files}

*patched* line from install_kbuild():
(cd ${S}; find . \( -path './scripts/*' -o -path './tools/*' \) -a \( -
name 'Makefile*' -o -name 'Kconfig*' -o -name '*.pl' \))
>>${src_kbuild_files}

The subset excluded by one line should be included by the other line.

The *unpatched* line.
(cd ${S}; find . -path './scripts/*' -a -path './tools/*' -a \( -name
'Makefile*' -o -name 'Kconfig*' -o -name '*.pl' \))
>>${src_kbuild_files}

combines two paths in an AND operation, which will never be true.
So the line is useless.

The patch fixes only this logical issue with both subsets.

This was not a big blocker at all, because the next line in
install_kbuild():
(cd ${S}; find scripts -type f -o -type l) >>${src_kbuild_files}

also adds the scripts subdir. Only the tools subdir was missing here,
but that seems to be working in most cases, even without it.

>
> Jan
>
> > Signed-off-by: Stefan Koch <stefa...@siemens.com>
> > ---
> >  meta/recipes-kernel/linux/files/debian/isar/install.tmpl | 2 +-
> >  1 file changed, 1 insertion(+), 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 a1b00d39..6fa94508 100644
> > --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > @@ -252,7 +252,7 @@ install_kbuild() {
> >  
> >      mkdir -p ${destdir}
> >  
> > -    (cd ${S}; find . -path './scripts/*' -a -path './tools/*' -a
> > \( -name 'Makefile*' -o -name 'Kconfig*' -o -name '*.pl' \))
> > >>${src_kbuild_files}
> > +    (cd ${S}; find . \( -path './scripts/*' -o -path './tools/*'
> > \) -a \( -name 'Makefile*' -o -name 'Kconfig*' -o -name '*.pl' \))
> > >>${src_kbuild_files}
> >      (cd ${S}; find scripts -type f -o -type l)
> > >>${src_kbuild_files}
> >  
> >      (cd ${O}; find scripts -type f) >>${obj_kbuild_files}
>

Best regards
--
Stefan Koch
Siemens AG
www.siemens.com

Zhihang Wei

unread,
Nov 26, 2025, 4:45:08 AMNov 26
to Stefan Koch, isar-...@googlegroups.com, jan.k...@siemens.com, christi...@siemens.com, cedric.h...@siemens.com, adriaan...@siemens.com, felix.mo...@siemens.com, quirin.g...@siemens.com, ub...@ilbers.de
Applied to next, thanks.
Reply all
Reply to author
Forward
0 new messages