public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
@ 2024-08-10 21:58 'Cedric Hombourger' via isar-users
  2024-08-11  8:10 ` 'Jan Kiszka' via isar-users
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: 'Cedric Hombourger' via isar-users @ 2024-08-10 21:58 UTC (permalink / raw)
  To: isar-users; +Cc: Cedric Hombourger

Some vendor kernels come with additional directories to be included in the
linux-headers package in order to support building of their out-of-tree
drivers. HEADERS_INSTALL_EXTRA may be set to a list of directories relative
to ${S} in any kernel recipes that includes linux-custom.inc

Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
---
 RECIPE-API-CHANGELOG.md                              | 12 ++++++++++++
 .../linux/files/debian/isar/install.tmpl             |  6 ++++++
 meta/recipes-kernel/linux/linux-custom.inc           | 12 ++++++++++++
 3 files changed, 30 insertions(+)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 65cd98b3..21c558d2 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -634,3 +634,15 @@ into kernel kbuild package.
 
 When downloading from debian snapshot mirrors, rate limits might apply.
 To limit the amount of parallel fetching to n kB / s, you can set `ISAR_APT_DL_LIMIT="<n>`.
+
+### Custom directories in vendor kernels
+
+Some vendor kernels come with additional directories to be included in the
+linux-headers package in order to support building of their out-of-tree
+drivers. `HEADERS_INSTALL_EXTRA` may be set to a list of directories relative
+to ${S} in any kernel recipes that includes `linux-custom.inc`. A l4t kernel
+recipe would use the following setting:
+
+```
+HEADERS_INSTALL_EXTRA += "nvidia"
+```
diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
index 00011517..0a7bdd66 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
@@ -193,6 +193,12 @@ 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}
 
+    if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
+        for d in ${HEADERS_INSTALL_EXTRA}; do
+            (cd ${S}; find ${d} -type f) >>${src_hdr_files}
+        done
+    fi
+
     if [ -n "${CONFIG_MODULES}" ]; then
         echo Module.symvers >> ${obj_hdr_files}
     fi
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 6aa70fd3..7e312b75 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -48,6 +48,8 @@ LINUX_VERSION_EXTENSION ?= ""
 
 KERNEL_DEFCONFIG ??= ""
 
+HEADERS_INSTALL_EXTRA ??= ""
+
 # Add our template meta-data to the sources
 FILESPATH:append := ":${FILE_DIRNAME}/files"
 SRC_URI += "file://debian"
@@ -84,6 +86,7 @@ TEMPLATE_VARS += "                \
     KAFLAGS                       \
     DISTRIBUTOR                   \
     KERNEL_EXTRA_BUILDARGS        \
+    HEADERS_INSTALL_EXTRA         \
 "
 
 inherit dpkg
@@ -224,6 +227,15 @@ do_prepare_build:prepend() {
 
 	# produce a changelog for our kernel build
 	deb_add_changelog
+
+	# make sure user-specified directories do exist in ${S}
+	if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
+		for d in ${HEADERS_INSTALL_EXTRA}; do
+			[ -d ${S}/${d} ] || {
+				bbfatal "HEADERS_INSTALL_EXTRA: '${d}' not found in \${S}!"
+			}
+		done
+	fi
 }
 
 # build directory for our "full" kernel build
-- 
2.39.2

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240810215838.2098472-1-cedric.hombourger%40siemens.com.

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

* Re: [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
  2024-08-10 21:58 [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA 'Cedric Hombourger' via isar-users
@ 2024-08-11  8:10 ` 'Jan Kiszka' via isar-users
  2024-08-11  8:35   ` 'cedric.hombourger@siemens.com' via isar-users
  2024-08-12 11:41   ` 'MOESSBAUER, Felix' via isar-users
  2024-08-27 15:48 ` Uladzimir Bely
  2024-08-27 16:58 ` Uladzimir Bely
  2 siblings, 2 replies; 11+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2024-08-11  8:10 UTC (permalink / raw)
  To: Cedric Hombourger, isar-users

On 10.08.24 23:58, 'Cedric Hombourger' via isar-users wrote:
> Some vendor kernels come with additional directories to be included in the
> linux-headers package in order to support building of their out-of-tree
> drivers. HEADERS_INSTALL_EXTRA may be set to a list of directories relative
> to ${S} in any kernel recipes that includes linux-custom.inc
> 

Does this affect more than the legacy Nvidia Jetpack 5 kernel? I worked
with a lot of vendor kernels but didn't have the need elsewhere so far.

Note that we also didn't merge (or even propose?) the ccache
optimization for that horrible and now (JP6) removed kernel overlay of
Nvidia. And for the header topic, we resolve it in the downstream recipe
- a 3-liner by now.

Jan

> Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
> ---
>  RECIPE-API-CHANGELOG.md                              | 12 ++++++++++++
>  .../linux/files/debian/isar/install.tmpl             |  6 ++++++
>  meta/recipes-kernel/linux/linux-custom.inc           | 12 ++++++++++++
>  3 files changed, 30 insertions(+)
> 
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index 65cd98b3..21c558d2 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -634,3 +634,15 @@ into kernel kbuild package.
>  
>  When downloading from debian snapshot mirrors, rate limits might apply.
>  To limit the amount of parallel fetching to n kB / s, you can set `ISAR_APT_DL_LIMIT="<n>`.
> +
> +### Custom directories in vendor kernels
> +
> +Some vendor kernels come with additional directories to be included in the
> +linux-headers package in order to support building of their out-of-tree
> +drivers. `HEADERS_INSTALL_EXTRA` may be set to a list of directories relative
> +to ${S} in any kernel recipes that includes `linux-custom.inc`. A l4t kernel
> +recipe would use the following setting:
> +
> +```
> +HEADERS_INSTALL_EXTRA += "nvidia"
> +```
> diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> index 00011517..0a7bdd66 100644
> --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> @@ -193,6 +193,12 @@ 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}
>  
> +    if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> +        for d in ${HEADERS_INSTALL_EXTRA}; do
> +            (cd ${S}; find ${d} -type f) >>${src_hdr_files}
> +        done
> +    fi
> +
>      if [ -n "${CONFIG_MODULES}" ]; then
>          echo Module.symvers >> ${obj_hdr_files}
>      fi
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
> index 6aa70fd3..7e312b75 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -48,6 +48,8 @@ LINUX_VERSION_EXTENSION ?= ""
>  
>  KERNEL_DEFCONFIG ??= ""
>  
> +HEADERS_INSTALL_EXTRA ??= ""
> +
>  # Add our template meta-data to the sources
>  FILESPATH:append := ":${FILE_DIRNAME}/files"
>  SRC_URI += "file://debian"
> @@ -84,6 +86,7 @@ TEMPLATE_VARS += "                \
>      KAFLAGS                       \
>      DISTRIBUTOR                   \
>      KERNEL_EXTRA_BUILDARGS        \
> +    HEADERS_INSTALL_EXTRA         \
>  "
>  
>  inherit dpkg
> @@ -224,6 +227,15 @@ do_prepare_build:prepend() {
>  
>  	# produce a changelog for our kernel build
>  	deb_add_changelog
> +
> +	# make sure user-specified directories do exist in ${S}
> +	if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> +		for d in ${HEADERS_INSTALL_EXTRA}; do
> +			[ -d ${S}/${d} ] || {
> +				bbfatal "HEADERS_INSTALL_EXTRA: '${d}' not found in \${S}!"
> +			}
> +		done
> +	fi
>  }
>  
>  # build directory for our "full" kernel build

-- 
Siemens AG, Technology
Linux Expert Center

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/4cdee6b8-519e-446b-b884-0f8a872d7b23%40siemens.com.

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

* Re: [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
  2024-08-11  8:10 ` 'Jan Kiszka' via isar-users
@ 2024-08-11  8:35   ` 'cedric.hombourger@siemens.com' via isar-users
  2024-08-11  9:04     ` 'Jan Kiszka' via isar-users
  2024-08-12 11:41   ` 'MOESSBAUER, Felix' via isar-users
  1 sibling, 1 reply; 11+ messages in thread
From: 'cedric.hombourger@siemens.com' via isar-users @ 2024-08-11  8:35 UTC (permalink / raw)
  To: isar-users, Kiszka, Jan

On Sun, 2024-08-11 at 10:10 +0200, Jan Kiszka wrote:
> On 10.08.24 23:58, 'Cedric Hombourger' via isar-users wrote:
> > Some vendor kernels come with additional directories to be included
> > in the
> > linux-headers package in order to support building of their out-of-
> > tree
> > drivers. HEADERS_INSTALL_EXTRA may be set to a list of directories
> > relative
> > to ${S} in any kernel recipes that includes linux-custom.inc
> > 
> 
> Does this affect more than the legacy Nvidia Jetpack 5 kernel? I
> worked
> with a lot of vendor kernels but didn't have the need elsewhere so
> far.

Same story with QCOM kernel. While for Nvidia, Claudius had chosen to
ship a copy of Isar's install.tmpl, for QCOM I had patched debian/rules
to ship additional files into linux-headers. Neither approaches are IMO
satisfactory.

Are there concerns about adding a new user-visible variable in linux-
custom? Or was the question about this being proposed to address a
single corner-case or multiple vendor kernels?

> 
> Note that we also didn't merge (or even propose?) the ccache
> optimization for that horrible and now (JP6) removed kernel overlay
> of
> Nvidia. And for the header topic, we resolve it in the downstream
> recipe
> - a 3-liner by now.
> 
> Jan
> 
> > Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
> > ---
> >  RECIPE-API-CHANGELOG.md                              | 12
> > ++++++++++++
> >  .../linux/files/debian/isar/install.tmpl             |  6 ++++++
> >  meta/recipes-kernel/linux/linux-custom.inc           | 12
> > ++++++++++++
> >  3 files changed, 30 insertions(+)
> > 
> > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> > index 65cd98b3..21c558d2 100644
> > --- a/RECIPE-API-CHANGELOG.md
> > +++ b/RECIPE-API-CHANGELOG.md
> > @@ -634,3 +634,15 @@ into kernel kbuild package.
> >  
> >  When downloading from debian snapshot mirrors, rate limits might
> > apply.
> >  To limit the amount of parallel fetching to n kB / s, you can set
> > `ISAR_APT_DL_LIMIT="<n>`.
> > +
> > +### Custom directories in vendor kernels
> > +
> > +Some vendor kernels come with additional directories to be
> > included in the
> > +linux-headers package in order to support building of their out-
> > of-tree
> > +drivers. `HEADERS_INSTALL_EXTRA` may be set to a list of
> > directories relative
> > +to ${S} in any kernel recipes that includes `linux-custom.inc`. A
> > l4t kernel
> > +recipe would use the following setting:
> > +
> > +```
> > +HEADERS_INSTALL_EXTRA += "nvidia"
> > +```
> > diff --git a/meta/recipes-
> > kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-
> > kernel/linux/files/debian/isar/install.tmpl
> > index 00011517..0a7bdd66 100644
> > --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > @@ -193,6 +193,12 @@ 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}
> >  
> > +    if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> > +        for d in ${HEADERS_INSTALL_EXTRA}; do
> > +            (cd ${S}; find ${d} -type f) >>${src_hdr_files}
> > +        done
> > +    fi
> > +
> >      if [ -n "${CONFIG_MODULES}" ]; then
> >          echo Module.symvers >> ${obj_hdr_files}
> >      fi
> > diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> > b/meta/recipes-kernel/linux/linux-custom.inc
> > index 6aa70fd3..7e312b75 100644
> > --- a/meta/recipes-kernel/linux/linux-custom.inc
> > +++ b/meta/recipes-kernel/linux/linux-custom.inc
> > @@ -48,6 +48,8 @@ LINUX_VERSION_EXTENSION ?= ""
> >  
> >  KERNEL_DEFCONFIG ??= ""
> >  
> > +HEADERS_INSTALL_EXTRA ??= ""
> > +
> >  # Add our template meta-data to the sources
> >  FILESPATH:append := ":${FILE_DIRNAME}/files"
> >  SRC_URI += "file://debian"
> > @@ -84,6 +86,7 @@ TEMPLATE_VARS += "                \
> >      KAFLAGS                       \
> >      DISTRIBUTOR                   \
> >      KERNEL_EXTRA_BUILDARGS        \
> > +    HEADERS_INSTALL_EXTRA         \
> >  "
> >  
> >  inherit dpkg
> > @@ -224,6 +227,15 @@ do_prepare_build:prepend() {
> >  
> >         # produce a changelog for our kernel build
> >         deb_add_changelog
> > +
> > +       # make sure user-specified directories do exist in ${S}
> > +       if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> > +               for d in ${HEADERS_INSTALL_EXTRA}; do
> > +                       [ -d ${S}/${d} ] || {
> > +                               bbfatal "HEADERS_INSTALL_EXTRA:
> > '${d}' not found in \${S}!"
> > +                       }
> > +               done
> > +       fi
> >  }
> >  
> >  # build directory for our "full" kernel build
> 

-- 
Cedric Hombourger
Siemens AG
www.siemens.com

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/4d56c471d9766dddba82cdd0d0ec7942c189d098.camel%40siemens.com.

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

* Re: [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
  2024-08-11  8:35   ` 'cedric.hombourger@siemens.com' via isar-users
@ 2024-08-11  9:04     ` 'Jan Kiszka' via isar-users
  0 siblings, 0 replies; 11+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2024-08-11  9:04 UTC (permalink / raw)
  To: Hombourger, Cedric (DI CTO FDS CES LX), isar-users

On 11.08.24 10:35, Hombourger, Cedric (DI CTO FDS CES LX) wrote:
> On Sun, 2024-08-11 at 10:10 +0200, Jan Kiszka wrote:
>> On 10.08.24 23:58, 'Cedric Hombourger' via isar-users wrote:
>>> Some vendor kernels come with additional directories to be included
>>> in the
>>> linux-headers package in order to support building of their out-of-
>>> tree
>>> drivers. HEADERS_INSTALL_EXTRA may be set to a list of directories
>>> relative
>>> to ${S} in any kernel recipes that includes linux-custom.inc
>>>
>>
>> Does this affect more than the legacy Nvidia Jetpack 5 kernel? I
>> worked
>> with a lot of vendor kernels but didn't have the need elsewhere so
>> far.
> 
> Same story with QCOM kernel. While for Nvidia, Claudius had chosen to
> ship a copy of Isar's install.tmpl, for QCOM I had patched debian/rules
> to ship additional files into linux-headers. Neither approaches are IMO
> satisfactory.
> 
> Are there concerns about adding a new user-visible variable in linux-
> custom? Or was the question about this being proposed to address a
> single corner-case or multiple vendor kernels?

The latter, because the Nvidia case is in phase-out now. If Qualcomm
needs longer to understand their mistakes, we apparently need this.

Is ccache fine with the QCOM kernel?

Jan

> 
>>
>> Note that we also didn't merge (or even propose?) the ccache
>> optimization for that horrible and now (JP6) removed kernel overlay
>> of
>> Nvidia. And for the header topic, we resolve it in the downstream
>> recipe
>> - a 3-liner by now.
>>
>> Jan
>>
>>> Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
>>> ---
>>>  RECIPE-API-CHANGELOG.md                              | 12
>>> ++++++++++++
>>>  .../linux/files/debian/isar/install.tmpl             |  6 ++++++
>>>  meta/recipes-kernel/linux/linux-custom.inc           | 12
>>> ++++++++++++
>>>  3 files changed, 30 insertions(+)
>>>
>>> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
>>> index 65cd98b3..21c558d2 100644
>>> --- a/RECIPE-API-CHANGELOG.md
>>> +++ b/RECIPE-API-CHANGELOG.md
>>> @@ -634,3 +634,15 @@ into kernel kbuild package.
>>>  
>>>  When downloading from debian snapshot mirrors, rate limits might
>>> apply.
>>>  To limit the amount of parallel fetching to n kB / s, you can set
>>> `ISAR_APT_DL_LIMIT="<n>`.
>>> +
>>> +### Custom directories in vendor kernels
>>> +
>>> +Some vendor kernels come with additional directories to be
>>> included in the
>>> +linux-headers package in order to support building of their out-
>>> of-tree
>>> +drivers. `HEADERS_INSTALL_EXTRA` may be set to a list of
>>> directories relative
>>> +to ${S} in any kernel recipes that includes `linux-custom.inc`. A
>>> l4t kernel
>>> +recipe would use the following setting:
>>> +
>>> +```
>>> +HEADERS_INSTALL_EXTRA += "nvidia"
>>> +```
>>> diff --git a/meta/recipes-
>>> kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-
>>> kernel/linux/files/debian/isar/install.tmpl
>>> index 00011517..0a7bdd66 100644
>>> --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
>>> +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
>>> @@ -193,6 +193,12 @@ 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}
>>>  
>>> +    if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
>>> +        for d in ${HEADERS_INSTALL_EXTRA}; do
>>> +            (cd ${S}; find ${d} -type f) >>${src_hdr_files}
>>> +        done
>>> +    fi
>>> +
>>>      if [ -n "${CONFIG_MODULES}" ]; then
>>>          echo Module.symvers >> ${obj_hdr_files}
>>>      fi
>>> diff --git a/meta/recipes-kernel/linux/linux-custom.inc
>>> b/meta/recipes-kernel/linux/linux-custom.inc
>>> index 6aa70fd3..7e312b75 100644
>>> --- a/meta/recipes-kernel/linux/linux-custom.inc
>>> +++ b/meta/recipes-kernel/linux/linux-custom.inc
>>> @@ -48,6 +48,8 @@ LINUX_VERSION_EXTENSION ?= ""
>>>  
>>>  KERNEL_DEFCONFIG ??= ""
>>>  
>>> +HEADERS_INSTALL_EXTRA ??= ""
>>> +
>>>  # Add our template meta-data to the sources
>>>  FILESPATH:append := ":${FILE_DIRNAME}/files"
>>>  SRC_URI += "file://debian"
>>> @@ -84,6 +86,7 @@ TEMPLATE_VARS += "                \
>>>      KAFLAGS                       \
>>>      DISTRIBUTOR                   \
>>>      KERNEL_EXTRA_BUILDARGS        \
>>> +    HEADERS_INSTALL_EXTRA         \
>>>  "
>>>  
>>>  inherit dpkg
>>> @@ -224,6 +227,15 @@ do_prepare_build:prepend() {
>>>  
>>>         # produce a changelog for our kernel build
>>>         deb_add_changelog
>>> +
>>> +       # make sure user-specified directories do exist in ${S}
>>> +       if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
>>> +               for d in ${HEADERS_INSTALL_EXTRA}; do
>>> +                       [ -d ${S}/${d} ] || {
>>> +                               bbfatal "HEADERS_INSTALL_EXTRA:
>>> '${d}' not found in \${S}!"
>>> +                       }
>>> +               done
>>> +       fi
>>>  }
>>>  
>>>  # build directory for our "full" kernel build
>>
> 

-- 
Siemens AG, Technology
Linux Expert Center

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/6dbcd42d-fc6c-4c49-a418-87c92dea7176%40siemens.com.

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

* Re: [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
  2024-08-11  8:10 ` 'Jan Kiszka' via isar-users
  2024-08-11  8:35   ` 'cedric.hombourger@siemens.com' via isar-users
@ 2024-08-12 11:41   ` 'MOESSBAUER, Felix' via isar-users
  2024-08-12 11:57     ` 'cedric.hombourger@siemens.com' via isar-users
  1 sibling, 1 reply; 11+ messages in thread
From: 'MOESSBAUER, Felix' via isar-users @ 2024-08-12 11:41 UTC (permalink / raw)
  To: isar-users, Kiszka, Jan, cedric.hombourger

On Sun, 2024-08-11 at 10:10 +0200, 'Jan Kiszka' via isar-users wrote:
> On 10.08.24 23:58, 'Cedric Hombourger' via isar-users wrote:
> > Some vendor kernels come with additional directories to be included
> > in the
> > linux-headers package in order to support building of their out-of-
> > tree
> > drivers. HEADERS_INSTALL_EXTRA may be set to a list of directories
> > relative
> > to ${S} in any kernel recipes that includes linux-custom.inc
> > 
> 
> Does this affect more than the legacy Nvidia Jetpack 5 kernel? I
> worked
> with a lot of vendor kernels but didn't have the need elsewhere so
> far.
> 
> Note that we also didn't merge (or even propose?) the ccache
> optimization for that horrible and now (JP6) removed kernel overlay
> of

I proposed this patch in [1], but due to a lack of downstream consumers
(except for JP5) and the questionable issue it is solving, it was never
merged.

[1] https://groups.google.com/g/isar-users/c/dQqxKdA7d-4/m/xuFhLj7HEgAJ

Felix

> Nvidia. And for the header topic, we resolve it in the downstream
> recipe
> - a 3-liner by now.
> 
> Jan
> 
> > Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
> > ---
> >  RECIPE-API-CHANGELOG.md                              | 12
> > ++++++++++++
> >  .../linux/files/debian/isar/install.tmpl             |  6 ++++++
> >  meta/recipes-kernel/linux/linux-custom.inc           | 12
> > ++++++++++++
> >  3 files changed, 30 insertions(+)
> > 
> > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> > index 65cd98b3..21c558d2 100644
> > --- a/RECIPE-API-CHANGELOG.md
> > +++ b/RECIPE-API-CHANGELOG.md
> > @@ -634,3 +634,15 @@ into kernel kbuild package.
> >  
> >  When downloading from debian snapshot mirrors, rate limits might
> > apply.
> >  To limit the amount of parallel fetching to n kB / s, you can set
> > `ISAR_APT_DL_LIMIT="<n>`.
> > +
> > +### Custom directories in vendor kernels
> > +
> > +Some vendor kernels come with additional directories to be
> > included in the
> > +linux-headers package in order to support building of their out-
> > of-tree
> > +drivers. `HEADERS_INSTALL_EXTRA` may be set to a list of
> > directories relative
> > +to ${S} in any kernel recipes that includes `linux-custom.inc`. A
> > l4t kernel
> > +recipe would use the following setting:
> > +
> > +```
> > +HEADERS_INSTALL_EXTRA += "nvidia"
> > +```
> > diff --git a/meta/recipes-
> > kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-
> > kernel/linux/files/debian/isar/install.tmpl
> > index 00011517..0a7bdd66 100644
> > --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > @@ -193,6 +193,12 @@ 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}
> >  
> > +    if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> > +        for d in ${HEADERS_INSTALL_EXTRA}; do
> > +            (cd ${S}; find ${d} -type f) >>${src_hdr_files}
> > +        done
> > +    fi
> > +
> >      if [ -n "${CONFIG_MODULES}" ]; then
> >          echo Module.symvers >> ${obj_hdr_files}
> >      fi
> > diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> > b/meta/recipes-kernel/linux/linux-custom.inc
> > index 6aa70fd3..7e312b75 100644
> > --- a/meta/recipes-kernel/linux/linux-custom.inc
> > +++ b/meta/recipes-kernel/linux/linux-custom.inc
> > @@ -48,6 +48,8 @@ LINUX_VERSION_EXTENSION ?= ""
> >  
> >  KERNEL_DEFCONFIG ??= ""
> >  
> > +HEADERS_INSTALL_EXTRA ??= ""
> > +
> >  # Add our template meta-data to the sources
> >  FILESPATH:append := ":${FILE_DIRNAME}/files"
> >  SRC_URI += "file://debian"
> > @@ -84,6 +86,7 @@ TEMPLATE_VARS += "                \
> >      KAFLAGS                       \
> >      DISTRIBUTOR                   \
> >      KERNEL_EXTRA_BUILDARGS        \
> > +    HEADERS_INSTALL_EXTRA         \
> >  "
> >  
> >  inherit dpkg
> > @@ -224,6 +227,15 @@ do_prepare_build:prepend() {
> >  
> >         # produce a changelog for our kernel build
> >         deb_add_changelog
> > +
> > +       # make sure user-specified directories do exist in ${S}
> > +       if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> > +               for d in ${HEADERS_INSTALL_EXTRA}; do
> > +                       [ -d ${S}/${d} ] || {
> > +                               bbfatal "HEADERS_INSTALL_EXTRA:
> > '${d}' not found in \${S}!"
> > +                       }
> > +               done
> > +       fi
> >  }
> >  
> >  # build directory for our "full" kernel build
> 
> -- 
> Siemens AG, Technology
> Linux Expert Center
> 

-- 
Siemens AG, Technology
Linux Expert Center


-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/0c3d663a4f2541fe5d94c2cafb954583eb2a57d8.camel%40siemens.com.

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

* Re: [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
  2024-08-12 11:41   ` 'MOESSBAUER, Felix' via isar-users
@ 2024-08-12 11:57     ` 'cedric.hombourger@siemens.com' via isar-users
  2024-08-12 12:14       ` 'Jan Kiszka' via isar-users
  0 siblings, 1 reply; 11+ messages in thread
From: 'cedric.hombourger@siemens.com' via isar-users @ 2024-08-12 11:57 UTC (permalink / raw)
  To: isar-users, Kiszka, Jan, MOESSBAUER, Felix

On Mon, 2024-08-12 at 11:41 +0000, Moessbauer, Felix (T CED OES-DE)
wrote:
> On Sun, 2024-08-11 at 10:10 +0200, 'Jan Kiszka' via isar-users wrote:
> > On 10.08.24 23:58, 'Cedric Hombourger' via isar-users wrote:
> > > Some vendor kernels come with additional directories to be
> > > included
> > > in the
> > > linux-headers package in order to support building of their out-
> > > of-
> > > tree
> > > drivers. HEADERS_INSTALL_EXTRA may be set to a list of
> > > directories
> > > relative
> > > to ${S} in any kernel recipes that includes linux-custom.inc
> > >
> >
> > Does this affect more than the legacy Nvidia Jetpack 5 kernel? I
> > worked
> > with a lot of vendor kernels but didn't have the need elsewhere so
> > far.
> >
> > Note that we also didn't merge (or even propose?) the ccache
> > optimization for that horrible and now (JP6) removed kernel overlay
> > of
>
> I proposed this patch in [1], but due to a lack of downstream
> consumers
> (except for JP5) and the questionable issue it is solving, it was
> never
> merged.

Thanks for sharing. I had a chance to look at our JP5 layer earlier
today (was away for the last two weeks) and I now see that it uses sed
to insert the "nvidia/include" directory to the list of directories to
ship with linux-headers.

No doubt that it works and is simple to maintain.

My concern is that it introduces a hidden contract between our kernel
recipe and linux-custom. That said chances are that changes to linux-
custom will cause a build failure for out-of-tree kernel modules if sed
did not manage to augment the list of directories to ship. We are
probably fine with that approach but I generally do not like such
hidden contracts. The other downside is that other layers may opt to go
with a different approach and I was hoping that we could get Isar to
offer a unified way to address this use-case even if the number of
users may be limited (and will hopefully remain limited as we would not
want vendor kernels to "pollute" kernel trees with extra folders.

>
> [1]
> https://groups.google.com/g/isar-users/c/dQqxKdA7d-4/m/xuFhLj7HEgAJ
>
> Felix
>
> > Nvidia. And for the header topic, we resolve it in the downstream
> > recipe
> > - a 3-liner by now.
> >
> > Jan
> >
> > > Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
> > > ---
> > >  RECIPE-API-CHANGELOG.md                              | 12
> > > ++++++++++++
> > >  .../linux/files/debian/isar/install.tmpl             |  6 ++++++
> > >  meta/recipes-kernel/linux/linux-custom.inc           | 12
> > > ++++++++++++
> > >  3 files changed, 30 insertions(+)
> > >
> > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> > > index 65cd98b3..21c558d2 100644
> > > --- a/RECIPE-API-CHANGELOG.md
> > > +++ b/RECIPE-API-CHANGELOG.md
> > > @@ -634,3 +634,15 @@ into kernel kbuild package.
> > >
> > >  When downloading from debian snapshot mirrors, rate limits might
> > > apply.
> > >  To limit the amount of parallel fetching to n kB / s, you can
> > > set
> > > `ISAR_APT_DL_LIMIT="<n>`.
> > > +
> > > +### Custom directories in vendor kernels
> > > +
> > > +Some vendor kernels come with additional directories to be
> > > included in the
> > > +linux-headers package in order to support building of their out-
> > > of-tree
> > > +drivers. `HEADERS_INSTALL_EXTRA` may be set to a list of
> > > directories relative
> > > +to ${S} in any kernel recipes that includes `linux-custom.inc`.
> > > A
> > > l4t kernel
> > > +recipe would use the following setting:
> > > +
> > > +```
> > > +HEADERS_INSTALL_EXTRA += "nvidia"
> > > +```
> > > diff --git a/meta/recipes-
> > > kernel/linux/files/debian/isar/install.tmpl b/meta/recipes-
> > > kernel/linux/files/debian/isar/install.tmpl
> > > index 00011517..0a7bdd66 100644
> > > --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > > +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > > @@ -193,6 +193,12 @@ 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}
> > >
> > > +    if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> > > +        for d in ${HEADERS_INSTALL_EXTRA}; do
> > > +            (cd ${S}; find ${d} -type f) >>${src_hdr_files}
> > > +        done
> > > +    fi
> > > +
> > >      if [ -n "${CONFIG_MODULES}" ]; then
> > >          echo Module.symvers >> ${obj_hdr_files}
> > >      fi
> > > diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> > > b/meta/recipes-kernel/linux/linux-custom.inc
> > > index 6aa70fd3..7e312b75 100644
> > > --- a/meta/recipes-kernel/linux/linux-custom.inc
> > > +++ b/meta/recipes-kernel/linux/linux-custom.inc
> > > @@ -48,6 +48,8 @@ LINUX_VERSION_EXTENSION ?= ""
> > >
> > >  KERNEL_DEFCONFIG ??= ""
> > >
> > > +HEADERS_INSTALL_EXTRA ??= ""
> > > +
> > >  # Add our template meta-data to the sources
> > >  FILESPATH:append := ":${FILE_DIRNAME}/files"
> > >  SRC_URI += "file://debian"
> > > @@ -84,6 +86,7 @@ TEMPLATE_VARS += "                \
> > >      KAFLAGS                       \
> > >      DISTRIBUTOR                   \
> > >      KERNEL_EXTRA_BUILDARGS        \
> > > +    HEADERS_INSTALL_EXTRA         \
> > >  "
> > >
> > >  inherit dpkg
> > > @@ -224,6 +227,15 @@ do_prepare_build:prepend() {
> > >
> > >         # produce a changelog for our kernel build
> > >         deb_add_changelog
> > > +
> > > +       # make sure user-specified directories do exist in ${S}
> > > +       if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> > > +               for d in ${HEADERS_INSTALL_EXTRA}; do
> > > +                       [ -d ${S}/${d} ] || {
> > > +                               bbfatal "HEADERS_INSTALL_EXTRA:
> > > '${d}' not found in \${S}!"
> > > +                       }
> > > +               done
> > > +       fi
> > >  }
> > >
> > >  # build directory for our "full" kernel build
> >
> > --
> > Siemens AG, Technology
> > Linux Expert Center
> >
>

--
Cedric Hombourger
Siemens AG
http://www.siemens.com/

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/3670596d722dd1aad1deedb893e2230b78e90028.camel%40siemens.com.

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

* Re: [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
  2024-08-12 11:57     ` 'cedric.hombourger@siemens.com' via isar-users
@ 2024-08-12 12:14       ` 'Jan Kiszka' via isar-users
  0 siblings, 0 replies; 11+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2024-08-12 12:14 UTC (permalink / raw)
  To: Hombourger, Cedric (DI CTO FDS CES LX),
	isar-users, Moessbauer, Felix (T CED OES-DE)

On 12.08.24 13:57, Hombourger, Cedric (DI CTO FDS CES LX) wrote:
> On Mon, 2024-08-12 at 11:41 +0000, Moessbauer, Felix (T CED OES-DE)
> wrote:
>> On Sun, 2024-08-11 at 10:10 +0200, 'Jan Kiszka' via isar-users wrote:
>>> On 10.08.24 23:58, 'Cedric Hombourger' via isar-users wrote:
>>>> Some vendor kernels come with additional directories to be
>>>> included
>>>> in the
>>>> linux-headers package in order to support building of their out-
>>>> of-
>>>> tree
>>>> drivers. HEADERS_INSTALL_EXTRA may be set to a list of
>>>> directories
>>>> relative
>>>> to ${S} in any kernel recipes that includes linux-custom.inc
>>>>
>>>
>>> Does this affect more than the legacy Nvidia Jetpack 5 kernel? I
>>> worked
>>> with a lot of vendor kernels but didn't have the need elsewhere so
>>> far.
>>>
>>> Note that we also didn't merge (or even propose?) the ccache
>>> optimization for that horrible and now (JP6) removed kernel overlay
>>> of
>>
>> I proposed this patch in [1], but due to a lack of downstream
>> consumers
>> (except for JP5) and the questionable issue it is solving, it was
>> never
>> merged.
> 
> Thanks for sharing. I had a chance to look at our JP5 layer earlier
> today (was away for the last two weeks) and I now see that it uses sed
> to insert the "nvidia/include" directory to the list of directories to
> ship with linux-headers.
> 
> No doubt that it works and is simple to maintain.
> 
> My concern is that it introduces a hidden contract between our kernel
> recipe and linux-custom. That said chances are that changes to linux-
> custom will cause a build failure for out-of-tree kernel modules if sed
> did not manage to augment the list of directories to ship. We are
> probably fine with that approach but I generally do not like such
> hidden contracts. The other downside is that other layers may opt to go
> with a different approach and I was hoping that we could get Isar to
> offer a unified way to address this use-case even if the number of
> users may be limited (and will hopefully remain limited as we would not
> want vendor kernels to "pollute" kernel trees with extra folders.
> 

I think Felix was referring to the ccache-related changes. Those are
orthogonal to the header installation.

Again my question: does the QCOM kernel have ccache issues as well?
Should we reconsider Felix' patch?

Jan

-- 
Siemens AG, Technology
Linux Expert Center

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/71e2c4c9-17ae-4f3c-934d-2851ad905b0f%40siemens.com.

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

* Re: [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
  2024-08-10 21:58 [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA 'Cedric Hombourger' via isar-users
  2024-08-11  8:10 ` 'Jan Kiszka' via isar-users
@ 2024-08-27 15:48 ` Uladzimir Bely
  2024-08-27 16:12   ` 'Jan Kiszka' via isar-users
  2024-08-27 16:58 ` Uladzimir Bely
  2 siblings, 1 reply; 11+ messages in thread
From: Uladzimir Bely @ 2024-08-27 15:48 UTC (permalink / raw)
  To: Cedric Hombourger, isar-users

On Sat, 2024-08-10 at 23:58 +0200, 'Cedric Hombourger' via isar-users
wrote:
> Some vendor kernels come with additional directories to be included
> in the
> linux-headers package in order to support building of their out-of-
> tree
> drivers. HEADERS_INSTALL_EXTRA may be set to a list of directories
> relative
> to ${S} in any kernel recipes that includes linux-custom.inc
> 
> Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
> ---
>  RECIPE-API-CHANGELOG.md                              | 12
> ++++++++++++
>  .../linux/files/debian/isar/install.tmpl             |  6 ++++++
>  meta/recipes-kernel/linux/linux-custom.inc           | 12
> ++++++++++++
>  3 files changed, 30 insertions(+)
> 
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index 65cd98b3..21c558d2 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -634,3 +634,15 @@ into kernel kbuild package.
>  
>  When downloading from debian snapshot mirrors, rate limits might
> apply.
>  To limit the amount of parallel fetching to n kB / s, you can set
> `ISAR_APT_DL_LIMIT="<n>`.
> +
> +### Custom directories in vendor kernels
> +
> +Some vendor kernels come with additional directories to be included
> in the
> +linux-headers package in order to support building of their out-of-
> tree
> +drivers. `HEADERS_INSTALL_EXTRA` may be set to a list of directories
> relative
> +to ${S} in any kernel recipes that includes `linux-custom.inc`. A
> l4t kernel
> +recipe would use the following setting:
> +
> +```
> +HEADERS_INSTALL_EXTRA += "nvidia"
> +```
> diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> index 00011517..0a7bdd66 100644
> --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> @@ -193,6 +193,12 @@ 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}
>  
> +    if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> +        for d in ${HEADERS_INSTALL_EXTRA}; do
> +            (cd ${S}; find ${d} -type f) >>${src_hdr_files}
> +        done
> +    fi
> +
>      if [ -n "${CONFIG_MODULES}" ]; then
>          echo Module.symvers >> ${obj_hdr_files}
>      fi
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> b/meta/recipes-kernel/linux/linux-custom.inc
> index 6aa70fd3..7e312b75 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -48,6 +48,8 @@ LINUX_VERSION_EXTENSION ?= ""
>  
>  KERNEL_DEFCONFIG ??= ""
>  
> +HEADERS_INSTALL_EXTRA ??= ""
> +
>  # Add our template meta-data to the sources
>  FILESPATH:append := ":${FILE_DIRNAME}/files"
>  SRC_URI += "file://debian"
> @@ -84,6 +86,7 @@ TEMPLATE_VARS += "                \
>      KAFLAGS                       \
>      DISTRIBUTOR                   \
>      KERNEL_EXTRA_BUILDARGS        \
> +    HEADERS_INSTALL_EXTRA         \
>  "
>  
>  inherit dpkg
> @@ -224,6 +227,15 @@ do_prepare_build:prepend() {
>  
>  	# produce a changelog for our kernel build
>  	deb_add_changelog
> +
> +	# make sure user-specified directories do exist in ${S}
> +	if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> +		for d in ${HEADERS_INSTALL_EXTRA}; do
> +			[ -d ${S}/${d} ] || {
> +				bbfatal "HEADERS_INSTALL_EXTRA:
> '${d}' not found in \${S}!"
> +			}
> +		done
> +	fi
>  }
>  
>  # build directory for our "full" kernel build
> -- 
> 2.39.2
> 

Hello all.

The patch is checked in CI and it passes OK, but it's still not clear
from a discussion if it's worth applying. Or should this new feature
leave on a downstrem side?

-- 
Best regards,
Uladzimir.



-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/639bbafa9073996114e4deb16ac59926b314df28.camel%40ilbers.de.

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

* Re: [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
  2024-08-27 15:48 ` Uladzimir Bely
@ 2024-08-27 16:12   ` 'Jan Kiszka' via isar-users
  2024-08-27 16:49     ` Uladzimir Bely
  0 siblings, 1 reply; 11+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2024-08-27 16:12 UTC (permalink / raw)
  To: Uladzimir Bely, Cedric Hombourger, isar-users

On 27.08.24 17:48, Uladzimir Bely wrote:
> On Sat, 2024-08-10 at 23:58 +0200, 'Cedric Hombourger' via isar-users
> wrote:
>> Some vendor kernels come with additional directories to be included
>> in the
>> linux-headers package in order to support building of their out-of-
>> tree
>> drivers. HEADERS_INSTALL_EXTRA may be set to a list of directories
>> relative
>> to ${S} in any kernel recipes that includes linux-custom.inc
>>
>> Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
>> ---
>>  RECIPE-API-CHANGELOG.md                              | 12
>> ++++++++++++
>>  .../linux/files/debian/isar/install.tmpl             |  6 ++++++
>>  meta/recipes-kernel/linux/linux-custom.inc           | 12
>> ++++++++++++
>>  3 files changed, 30 insertions(+)
>>
>> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
>> index 65cd98b3..21c558d2 100644
>> --- a/RECIPE-API-CHANGELOG.md
>> +++ b/RECIPE-API-CHANGELOG.md
>> @@ -634,3 +634,15 @@ into kernel kbuild package.
>>  
>>  When downloading from debian snapshot mirrors, rate limits might
>> apply.
>>  To limit the amount of parallel fetching to n kB / s, you can set
>> `ISAR_APT_DL_LIMIT="<n>`.
>> +
>> +### Custom directories in vendor kernels
>> +
>> +Some vendor kernels come with additional directories to be included
>> in the
>> +linux-headers package in order to support building of their out-of-
>> tree
>> +drivers. `HEADERS_INSTALL_EXTRA` may be set to a list of directories
>> relative
>> +to ${S} in any kernel recipes that includes `linux-custom.inc`. A
>> l4t kernel
>> +recipe would use the following setting:
>> +
>> +```
>> +HEADERS_INSTALL_EXTRA += "nvidia"
>> +```
>> diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
>> b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
>> index 00011517..0a7bdd66 100644
>> --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
>> +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
>> @@ -193,6 +193,12 @@ 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}
>>  
>> +    if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
>> +        for d in ${HEADERS_INSTALL_EXTRA}; do
>> +            (cd ${S}; find ${d} -type f) >>${src_hdr_files}
>> +        done
>> +    fi
>> +
>>      if [ -n "${CONFIG_MODULES}" ]; then
>>          echo Module.symvers >> ${obj_hdr_files}
>>      fi
>> diff --git a/meta/recipes-kernel/linux/linux-custom.inc
>> b/meta/recipes-kernel/linux/linux-custom.inc
>> index 6aa70fd3..7e312b75 100644
>> --- a/meta/recipes-kernel/linux/linux-custom.inc
>> +++ b/meta/recipes-kernel/linux/linux-custom.inc
>> @@ -48,6 +48,8 @@ LINUX_VERSION_EXTENSION ?= ""
>>  
>>  KERNEL_DEFCONFIG ??= ""
>>  
>> +HEADERS_INSTALL_EXTRA ??= ""
>> +
>>  # Add our template meta-data to the sources
>>  FILESPATH:append := ":${FILE_DIRNAME}/files"
>>  SRC_URI += "file://debian"
>> @@ -84,6 +86,7 @@ TEMPLATE_VARS += "                \
>>      KAFLAGS                       \
>>      DISTRIBUTOR                   \
>>      KERNEL_EXTRA_BUILDARGS        \
>> +    HEADERS_INSTALL_EXTRA         \
>>  "
>>  
>>  inherit dpkg
>> @@ -224,6 +227,15 @@ do_prepare_build:prepend() {
>>  
>>  	# produce a changelog for our kernel build
>>  	deb_add_changelog
>> +
>> +	# make sure user-specified directories do exist in ${S}
>> +	if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
>> +		for d in ${HEADERS_INSTALL_EXTRA}; do
>> +			[ -d ${S}/${d} ] || {
>> +				bbfatal "HEADERS_INSTALL_EXTRA:
>> '${d}' not found in \${S}!"
>> +			}
>> +		done
>> +	fi
>>  }
>>  
>>  # build directory for our "full" kernel build
>> -- 
>> 2.39.2
>>
> 
> Hello all.
> 
> The patch is checked in CI and it passes OK, but it's still not clear
> from a discussion if it's worth applying. Or should this new feature
> leave on a downstrem side?
> 

I said in my reply that "we apparently need this", now that we have two
downstream kernels with this pain.

We then had some unfinished (IIRC) follow-up discussion around ccache,
but that should not delay this change.

Jan

-- 
Siemens AG, Technology
Linux Expert Center

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/e464c354-5030-47f2-91f0-65e4dfc27e36%40siemens.com.

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

* Re: [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
  2024-08-27 16:12   ` 'Jan Kiszka' via isar-users
@ 2024-08-27 16:49     ` Uladzimir Bely
  0 siblings, 0 replies; 11+ messages in thread
From: Uladzimir Bely @ 2024-08-27 16:49 UTC (permalink / raw)
  To: Jan Kiszka, Cedric Hombourger, isar-users

On Tue, 2024-08-27 at 18:12 +0200, Jan Kiszka wrote:
> On 27.08.24 17:48, Uladzimir Bely wrote:
> > On Sat, 2024-08-10 at 23:58 +0200, 'Cedric Hombourger' via isar-
> > users
> > wrote:
> > > Some vendor kernels come with additional directories to be
> > > included
> > > in the
> > > linux-headers package in order to support building of their out-
> > > of-
> > > tree
> > > drivers. HEADERS_INSTALL_EXTRA may be set to a list of
> > > directories
> > > relative
> > > to ${S} in any kernel recipes that includes linux-custom.inc
> > > 
> > > Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
> > > ---
> > >  RECIPE-API-CHANGELOG.md                              | 12
> > > ++++++++++++
> > >  .../linux/files/debian/isar/install.tmpl             |  6 ++++++
> > >  meta/recipes-kernel/linux/linux-custom.inc           | 12
> > > ++++++++++++
> > >  3 files changed, 30 insertions(+)
> > > 
> > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> > > index 65cd98b3..21c558d2 100644
> > > --- a/RECIPE-API-CHANGELOG.md
> > > +++ b/RECIPE-API-CHANGELOG.md
> > > @@ -634,3 +634,15 @@ into kernel kbuild package.
> > >  
> > >  When downloading from debian snapshot mirrors, rate limits might
> > > apply.
> > >  To limit the amount of parallel fetching to n kB / s, you can
> > > set
> > > `ISAR_APT_DL_LIMIT="<n>`.
> > > +
> > > +### Custom directories in vendor kernels
> > > +
> > > +Some vendor kernels come with additional directories to be
> > > included
> > > in the
> > > +linux-headers package in order to support building of their out-
> > > of-
> > > tree
> > > +drivers. `HEADERS_INSTALL_EXTRA` may be set to a list of
> > > directories
> > > relative
> > > +to ${S} in any kernel recipes that includes `linux-custom.inc`.
> > > A
> > > l4t kernel
> > > +recipe would use the following setting:
> > > +
> > > +```
> > > +HEADERS_INSTALL_EXTRA += "nvidia"
> > > +```
> > > diff --git a/meta/recipes-
> > > kernel/linux/files/debian/isar/install.tmpl
> > > b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > > index 00011517..0a7bdd66 100644
> > > --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > > +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> > > @@ -193,6 +193,12 @@ 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}
> > >  
> > > +    if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> > > +        for d in ${HEADERS_INSTALL_EXTRA}; do
> > > +            (cd ${S}; find ${d} -type f) >>${src_hdr_files}
> > > +        done
> > > +    fi
> > > +
> > >      if [ -n "${CONFIG_MODULES}" ]; then
> > >          echo Module.symvers >> ${obj_hdr_files}
> > >      fi
> > > diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> > > b/meta/recipes-kernel/linux/linux-custom.inc
> > > index 6aa70fd3..7e312b75 100644
> > > --- a/meta/recipes-kernel/linux/linux-custom.inc
> > > +++ b/meta/recipes-kernel/linux/linux-custom.inc
> > > @@ -48,6 +48,8 @@ LINUX_VERSION_EXTENSION ?= ""
> > >  
> > >  KERNEL_DEFCONFIG ??= ""
> > >  
> > > +HEADERS_INSTALL_EXTRA ??= ""
> > > +
> > >  # Add our template meta-data to the sources
> > >  FILESPATH:append := ":${FILE_DIRNAME}/files"
> > >  SRC_URI += "file://debian"
> > > @@ -84,6 +86,7 @@ TEMPLATE_VARS += "                \
> > >      KAFLAGS                       \
> > >      DISTRIBUTOR                   \
> > >      KERNEL_EXTRA_BUILDARGS        \
> > > +    HEADERS_INSTALL_EXTRA         \
> > >  "
> > >  
> > >  inherit dpkg
> > > @@ -224,6 +227,15 @@ do_prepare_build:prepend() {
> > >  
> > >  	# produce a changelog for our kernel build
> > >  	deb_add_changelog
> > > +
> > > +	# make sure user-specified directories do exist in ${S}
> > > +	if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> > > +		for d in ${HEADERS_INSTALL_EXTRA}; do
> > > +			[ -d ${S}/${d} ] || {
> > > +				bbfatal "HEADERS_INSTALL_EXTRA:
> > > '${d}' not found in \${S}!"
> > > +			}
> > > +		done
> > > +	fi
> > >  }
> > >  
> > >  # build directory for our "full" kernel build
> > > -- 
> > > 2.39.2
> > > 
> > 
> > Hello all.
> > 
> > The patch is checked in CI and it passes OK, but it's still not
> > clear
> > from a discussion if it's worth applying. Or should this new
> > feature
> > leave on a downstrem side?
> > 
> 
> I said in my reply that "we apparently need this", now that we have
> two
> downstream kernels with this pain.
> 
> We then had some unfinished (IIRC) follow-up discussion around
> ccache,
> but that should not delay this change.
> 
> Jan
> 

OK, got you. Thanks for the answer.

-- 
Best regards,
Uladzimir.



-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/83897bff2e447acb0da6d2d5e8e986b9c101e5d9.camel%40ilbers.de.

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

* Re: [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA
  2024-08-10 21:58 [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA 'Cedric Hombourger' via isar-users
  2024-08-11  8:10 ` 'Jan Kiszka' via isar-users
  2024-08-27 15:48 ` Uladzimir Bely
@ 2024-08-27 16:58 ` Uladzimir Bely
  2 siblings, 0 replies; 11+ messages in thread
From: Uladzimir Bely @ 2024-08-27 16:58 UTC (permalink / raw)
  To: isar-users

On Sat, 2024-08-10 at 23:58 +0200, 'Cedric Hombourger' via isar-users
wrote:
> Some vendor kernels come with additional directories to be included
> in the
> linux-headers package in order to support building of their out-of-
> tree
> drivers. HEADERS_INSTALL_EXTRA may be set to a list of directories
> relative
> to ${S} in any kernel recipes that includes linux-custom.inc
> 
> Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
> ---
>  RECIPE-API-CHANGELOG.md                              | 12
> ++++++++++++
>  .../linux/files/debian/isar/install.tmpl             |  6 ++++++
>  meta/recipes-kernel/linux/linux-custom.inc           | 12
> ++++++++++++
>  3 files changed, 30 insertions(+)
> 
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index 65cd98b3..21c558d2 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -634,3 +634,15 @@ into kernel kbuild package.
>  
>  When downloading from debian snapshot mirrors, rate limits might
> apply.
>  To limit the amount of parallel fetching to n kB / s, you can set
> `ISAR_APT_DL_LIMIT="<n>`.
> +
> +### Custom directories in vendor kernels
> +
> +Some vendor kernels come with additional directories to be included
> in the
> +linux-headers package in order to support building of their out-of-
> tree
> +drivers. `HEADERS_INSTALL_EXTRA` may be set to a list of directories
> relative
> +to ${S} in any kernel recipes that includes `linux-custom.inc`. A
> l4t kernel
> +recipe would use the following setting:
> +
> +```
> +HEADERS_INSTALL_EXTRA += "nvidia"
> +```
> diff --git a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> index 00011517..0a7bdd66 100644
> --- a/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/isar/install.tmpl
> @@ -193,6 +193,12 @@ 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}
>  
> +    if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> +        for d in ${HEADERS_INSTALL_EXTRA}; do
> +            (cd ${S}; find ${d} -type f) >>${src_hdr_files}
> +        done
> +    fi
> +
>      if [ -n "${CONFIG_MODULES}" ]; then
>          echo Module.symvers >> ${obj_hdr_files}
>      fi
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> b/meta/recipes-kernel/linux/linux-custom.inc
> index 6aa70fd3..7e312b75 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -48,6 +48,8 @@ LINUX_VERSION_EXTENSION ?= ""
>  
>  KERNEL_DEFCONFIG ??= ""
>  
> +HEADERS_INSTALL_EXTRA ??= ""
> +
>  # Add our template meta-data to the sources
>  FILESPATH:append := ":${FILE_DIRNAME}/files"
>  SRC_URI += "file://debian"
> @@ -84,6 +86,7 @@ TEMPLATE_VARS += "                \
>      KAFLAGS                       \
>      DISTRIBUTOR                   \
>      KERNEL_EXTRA_BUILDARGS        \
> +    HEADERS_INSTALL_EXTRA         \
>  "
>  
>  inherit dpkg
> @@ -224,6 +227,15 @@ do_prepare_build:prepend() {
>  
>  	# produce a changelog for our kernel build
>  	deb_add_changelog
> +
> +	# make sure user-specified directories do exist in ${S}
> +	if [ -n "${HEADERS_INSTALL_EXTRA}" ]; then
> +		for d in ${HEADERS_INSTALL_EXTRA}; do
> +			[ -d ${S}/${d} ] || {
> +				bbfatal "HEADERS_INSTALL_EXTRA:
> '${d}' not found in \${S}!"
> +			}
> +		done
> +	fi
>  }
>  
>  # build directory for our "full" kernel build
> -- 
> 2.39.2
> 

Applied to next, thanks.

-- 
Best regards,
Uladzimir.



-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/f9736ca555dfc669e248c6cd22fc977a249ef110.camel%40ilbers.de.

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

end of thread, other threads:[~2024-08-27 16:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-10 21:58 [PATCH] linux-custom: support vendor directories via HEADERS_INSTALL_EXTRA 'Cedric Hombourger' via isar-users
2024-08-11  8:10 ` 'Jan Kiszka' via isar-users
2024-08-11  8:35   ` 'cedric.hombourger@siemens.com' via isar-users
2024-08-11  9:04     ` 'Jan Kiszka' via isar-users
2024-08-12 11:41   ` 'MOESSBAUER, Felix' via isar-users
2024-08-12 11:57     ` 'cedric.hombourger@siemens.com' via isar-users
2024-08-12 12:14       ` 'Jan Kiszka' via isar-users
2024-08-27 15:48 ` Uladzimir Bely
2024-08-27 16:12   ` 'Jan Kiszka' via isar-users
2024-08-27 16:49     ` Uladzimir Bely
2024-08-27 16:58 ` Uladzimir Bely

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