diff mbox series

[1/6] linux-yocto-dev: conditionally add coreutils to depends

Message ID 88eada332f5d3d00baf9f2cedf63460d80356032.1728912923.git.bruce.ashfield@gmail.com
State New
Headers show
Series [1/6] linux-yocto-dev: conditionally add coreutils to depends | expand

Commit Message

Bruce Ashfield Oct. 14, 2024, 1:45 p.m. UTC
From: Bruce Ashfield <bruce.ashfield@gmail.com>

6.11+ uses truncate as part of the build. While truncate has been
added to HOSTTOOLS in oe-core master, it still is possible to
build a kernel recipe newer than 6.11+ on a release that doesn't
have the HOSTTOOLS tweak.

We can test for truncate and condtionally add the dependency.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/recipes-kernel/linux/linux-yocto-dev.bb | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Quentin Schulz Oct. 14, 2024, 5:15 p.m. UTC | #1
Hi Bruce,

On 10/14/24 3:45 PM, Bruce Ashfield via lists.openembedded.org wrote:
> From: Bruce Ashfield <bruce.ashfield@gmail.com>
> 
> 6.11+ uses truncate as part of the build. While truncate has been
> added to HOSTTOOLS in oe-core master, it still is possible to
> build a kernel recipe newer than 6.11+ on a release that doesn't
> have the HOSTTOOLS tweak.
> 
> We can test for truncate and condtionally add the dependency.
> 
> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> ---
>   meta/recipes-kernel/linux/linux-yocto-dev.bb | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> index 292897ce43..752d108bd8 100644
> --- a/meta/recipes-kernel/linux/linux-yocto-dev.bb
> +++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> @@ -44,6 +44,10 @@ PACKAGECONFIG[dt-validation] = ",,python3-dtschema-native"
>   # we need the wrappers if validation isn't in the packageconfig
>   DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', '', 'python3-dtschema-wrapper-native', d)}"
>   
> +# 6.11+ uses truncate in the build, so we need to either have it in host tools, or
> +# build it ourselves
> +DEPENDS += "${@bb.utils.contains('HOSTTOOLS', 'truncate', '', 'coreutils-native', d)}"
> +

Nice :)

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>

For the sake of completeness, truncate is part of HOSTTOOLS in 
scarthgap-5.0.5+ (yes, not released yet) and styhead and later releases. 
We may want to backport this HOSTTOOLS+truncate patch to kirkstone as 
well maybe? So this patch here is only required for any other scenario 
:) (it's basically not useful for master branch but is nice as a hint to 
user trying to figure out how to compile 6.11 on other branches :) ).

Thanks!
Quentin
Richard Purdie Oct. 15, 2024, 2:15 p.m. UTC | #2
On Mon, 2024-10-14 at 09:45 -0400, bruce.ashfield@gmail.com wrote:
> From: Bruce Ashfield <bruce.ashfield@gmail.com>
> 
> 6.11+ uses truncate as part of the build. While truncate has been
> added to HOSTTOOLS in oe-core master, it still is possible to
> build a kernel recipe newer than 6.11+ on a release that doesn't
> have the HOSTTOOLS tweak.
> 
> We can test for truncate and condtionally add the dependency.
> 
> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> ---
>  meta/recipes-kernel/linux/linux-yocto-dev.bb | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> index 292897ce43..752d108bd8 100644
> --- a/meta/recipes-kernel/linux/linux-yocto-dev.bb
> +++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> @@ -44,6 +44,10 @@ PACKAGECONFIG[dt-validation] = ",,python3-dtschema-native"
>  # we need the wrappers if validation isn't in the packageconfig
>  DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', '', 'python3-dtschema-wrapper-native', d)}"
>  
> +# 6.11+ uses truncate in the build, so we need to either have it in host tools, or
> +# build it ourselves
> +DEPENDS += "${@bb.utils.contains('HOSTTOOLS', 'truncate', '', 'coreutils-native', d)}"
> +
>  COMPATIBLE_MACHINE = "^(qemuarmv5|qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64|qemuriscv32|qemuriscv64|qemuloongarch64)$"
>  
>  KERNEL_DEVICETREE:qemuarmv5 = "arm/versatile-pb.dtb"

This is for master so truncate should always be in HOSTTOOLS? I don't
understand why we need this there?

Cheers,

Richard
Bruce Ashfield Oct. 15, 2024, 8:56 p.m. UTC | #3
On Tue, Oct 15, 2024 at 10:15 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Mon, 2024-10-14 at 09:45 -0400, bruce.ashfield@gmail.com wrote:
> > From: Bruce Ashfield <bruce.ashfield@gmail.com>
> >
> > 6.11+ uses truncate as part of the build. While truncate has been
> > added to HOSTTOOLS in oe-core master, it still is possible to
> > build a kernel recipe newer than 6.11+ on a release that doesn't
> > have the HOSTTOOLS tweak.
> >
> > We can test for truncate and condtionally add the dependency.
> >
> > Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> > ---
> >  meta/recipes-kernel/linux/linux-yocto-dev.bb | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> > index 292897ce43..752d108bd8 100644
> > --- a/meta/recipes-kernel/linux/linux-yocto-dev.bb
> > +++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> > @@ -44,6 +44,10 @@ PACKAGECONFIG[dt-validation] = ",,python3-dtschema-native"
> >  # we need the wrappers if validation isn't in the packageconfig
> >  DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', '', 'python3-dtschema-wrapper-native', d)}"
> >
> > +# 6.11+ uses truncate in the build, so we need to either have it in host tools, or
> > +# build it ourselves
> > +DEPENDS += "${@bb.utils.contains('HOSTTOOLS', 'truncate', '', 'coreutils-native', d)}"
> > +
> >  COMPATIBLE_MACHINE = "^(qemuarmv5|qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64|qemuriscv32|qemuriscv64|qemuloongarch64)$"
> >
> >  KERNEL_DEVICETREE:qemuarmv5 = "arm/versatile-pb.dtb"
>
> This is for master so truncate should always be in HOSTTOOLS? I don't
> understand why we need this there?

It came out of a discussion to do a reference for people that are building
newer kernels on older releases (of which there seem to be quite a few).

So either we'd have to bacckport the hosttools addition (which is likely
possible), or I could throw together that reference of how you'd build it
conditionally.

Bruce

>
> Cheers,
>
> Richard
>
Richard Purdie Oct. 15, 2024, 9:01 p.m. UTC | #4
On Tue, 2024-10-15 at 16:56 -0400, Bruce Ashfield wrote:
> On Tue, Oct 15, 2024 at 10:15 AM Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > 
> > On Mon, 2024-10-14 at 09:45 -0400, bruce.ashfield@gmail.com wrote:
> > > From: Bruce Ashfield <bruce.ashfield@gmail.com>
> > > 
> > > 6.11+ uses truncate as part of the build. While truncate has been
> > > added to HOSTTOOLS in oe-core master, it still is possible to
> > > build a kernel recipe newer than 6.11+ on a release that doesn't
> > > have the HOSTTOOLS tweak.
> > > 
> > > We can test for truncate and condtionally add the dependency.
> > > 
> > > Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> > > ---
> > >  meta/recipes-kernel/linux/linux-yocto-dev.bb | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> > > index 292897ce43..752d108bd8 100644
> > > --- a/meta/recipes-kernel/linux/linux-yocto-dev.bb
> > > +++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> > > @@ -44,6 +44,10 @@ PACKAGECONFIG[dt-validation] = ",,python3-dtschema-native"
> > >  # we need the wrappers if validation isn't in the packageconfig
> > >  DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', '', 'python3-dtschema-wrapper-native', d)}"
> > > 
> > > +# 6.11+ uses truncate in the build, so we need to either have it in host tools, or
> > > +# build it ourselves
> > > +DEPENDS += "${@bb.utils.contains('HOSTTOOLS', 'truncate', '', 'coreutils-native', d)}"
> > > +
> > >  COMPATIBLE_MACHINE = "^(qemuarmv5|qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64|qemuriscv32|qemuriscv64|qemuloongarch64)$"
> > > 
> > >  KERNEL_DEVICETREE:qemuarmv5 = "arm/versatile-pb.dtb"
> > 
> > This is for master so truncate should always be in HOSTTOOLS? I don't
> > understand why we need this there?
> 
> It came out of a discussion to do a reference for people that are building
> newer kernels on older releases (of which there seem to be quite a few).
> 
> So either we'd have to bacckport the hosttools addition (which is likely
> possible), or I could throw together that reference of how you'd build it
> conditionally.

I think the addition was backported for scarthgap so we're good there.
The main question would be around kirkstone where this commit could be
more appropriate if someone were building 6.11+.

I'm find with having this patch around as a proof of concept but I
don't think it should go into master...

Cheers,

Richard
Bruce Ashfield Oct. 15, 2024, 9:09 p.m. UTC | #5
On Tue, Oct 15, 2024 at 5:01 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Tue, 2024-10-15 at 16:56 -0400, Bruce Ashfield wrote:
> > On Tue, Oct 15, 2024 at 10:15 AM Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > >
> > > On Mon, 2024-10-14 at 09:45 -0400, bruce.ashfield@gmail.com wrote:
> > > > From: Bruce Ashfield <bruce.ashfield@gmail.com>
> > > >
> > > > 6.11+ uses truncate as part of the build. While truncate has been
> > > > added to HOSTTOOLS in oe-core master, it still is possible to
> > > > build a kernel recipe newer than 6.11+ on a release that doesn't
> > > > have the HOSTTOOLS tweak.
> > > >
> > > > We can test for truncate and condtionally add the dependency.
> > > >
> > > > Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
> > > > ---
> > > >  meta/recipes-kernel/linux/linux-yocto-dev.bb | 4 ++++
> > > >  1 file changed, 4 insertions(+)
> > > >
> > > > diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> > > > index 292897ce43..752d108bd8 100644
> > > > --- a/meta/recipes-kernel/linux/linux-yocto-dev.bb
> > > > +++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
> > > > @@ -44,6 +44,10 @@ PACKAGECONFIG[dt-validation] = ",,python3-dtschema-native"
> > > >  # we need the wrappers if validation isn't in the packageconfig
> > > >  DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', '', 'python3-dtschema-wrapper-native', d)}"
> > > >
> > > > +# 6.11+ uses truncate in the build, so we need to either have it in host tools, or
> > > > +# build it ourselves
> > > > +DEPENDS += "${@bb.utils.contains('HOSTTOOLS', 'truncate', '', 'coreutils-native', d)}"
> > > > +
> > > >  COMPATIBLE_MACHINE = "^(qemuarmv5|qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64|qemuriscv32|qemuriscv64|qemuloongarch64)$"
> > > >
> > > >  KERNEL_DEVICETREE:qemuarmv5 = "arm/versatile-pb.dtb"
> > >
> > > This is for master so truncate should always be in HOSTTOOLS? I don't
> > > understand why we need this there?
> >
> > It came out of a discussion to do a reference for people that are building
> > newer kernels on older releases (of which there seem to be quite a few).
> >
> > So either we'd have to bacckport the hosttools addition (which is likely
> > possible), or I could throw together that reference of how you'd build it
> > conditionally.
>
> I think the addition was backported for scarthgap so we're good there.
> The main question would be around kirkstone where this commit could be
> more appropriate if someone were building 6.11+.
>
> I'm find with having this patch around as a proof of concept but I
> don't think it should go into master...

No objections on my part. I had told Quentin that I'd eventually send
out my local workaround for it, which I've done now. If there is somewhere
else we can put it, I'm all ears for that as well.

No matter what, I'll keep it around locally, so I can send it to anyone that
might need it (and then eventually remove it once anything that might
need such support is old and not supported).

Bruce

>
> Cheers,
>
> Richard
>
diff mbox series

Patch

diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
index 292897ce43..752d108bd8 100644
--- a/meta/recipes-kernel/linux/linux-yocto-dev.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
@@ -44,6 +44,10 @@  PACKAGECONFIG[dt-validation] = ",,python3-dtschema-native"
 # we need the wrappers if validation isn't in the packageconfig
 DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', '', 'python3-dtschema-wrapper-native', d)}"
 
+# 6.11+ uses truncate in the build, so we need to either have it in host tools, or
+# build it ourselves
+DEPENDS += "${@bb.utils.contains('HOSTTOOLS', 'truncate', '', 'coreutils-native', d)}"
+
 COMPATIBLE_MACHINE = "^(qemuarmv5|qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64|qemuriscv32|qemuriscv64|qemuloongarch64)$"
 
 KERNEL_DEVICETREE:qemuarmv5 = "arm/versatile-pb.dtb"