diff mbox series

[1/3] kernel-devsrc: Add needed fixes for 6.1+ kernel build on target on RISCV

Message ID 20240206184941.748116-1-raj.khem@gmail.com
State Accepted, archived
Commit 0b1e8df551d50331fc26048209b759a199bd964d
Headers show
Series [1/3] kernel-devsrc: Add needed fixes for 6.1+ kernel build on target on RISCV | expand

Commit Message

Khem Raj Feb. 6, 2024, 6:49 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-kernel/linux/kernel-devsrc.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Bruce Ashfield Feb. 6, 2024, 11:26 p.m. UTC | #1
On Tue, Feb 6, 2024 at 1:49 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-kernel/linux/kernel-devsrc.bb | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> index 9c3c09e7144..07a20feb8ef 100644
> --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> @@ -224,10 +224,16 @@ do_install() {
>         if [ "${ARCH}" = "riscv" ]; then
>              cp -a --parents arch/riscv/kernel/vdso/*gettimeofday.* $kerneldir/build/
>              cp -a --parents arch/riscv/kernel/vdso/note.S $kerneldir/build/
> +                 # v6.1+
> +                 cp -a --parents arch/riscv/kernel/asm-offsets.c $kerneldir/build/
>              if [ -e arch/riscv/kernel/vdso/gen_vdso_offsets.sh ]; then
>                      cp -a --parents arch/riscv/kernel/vdso/gen_vdso_offsets.sh $kerneldir/build/
>              fi
> -           cp -a --parents arch/riscv/kernel/vdso/* $kerneldir/build/ 2>/dev/null || :
> +                 cp -a --parents arch/riscv/kernel/vdso/* $kerneldir/build/ 2>/dev/null || :

I'm just off a flight and running on very little sleep, but I can't
tell what changed in the line
above here.  Is it whitespace ?

> +            if [ -e arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh ]; then
> +                    cp -a --parents arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh $kerneldir/build/
> +            fi

I realize I have a mix of conditionals and ||: in the file, but we've
been doing most of
the new additions without conditionals. Would the
gen_compat_vdso_offsets.sh copy
work in that style ?

i.e.   cp -a --parents
arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh
$kerneldir/build/2>/dev/null || :

Bruce

> +                 cp -a --parents arch/riscv/kernel/compat_vdso/* $kerneldir/build/ 2>/dev/null || :
>         fi
>
>         # include the machine specific headers for ARM variants, if available.
> --
> 2.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#195016): https://lists.openembedded.org/g/openembedded-core/message/195016
> Mute This Topic: https://lists.openembedded.org/mt/104203996/1050810
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Khem Raj Feb. 6, 2024, 11:36 p.m. UTC | #2
On Tue, Feb 6, 2024 at 3:27 PM Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
>
> On Tue, Feb 6, 2024 at 1:49 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> >  meta/recipes-kernel/linux/kernel-devsrc.bb | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> > index 9c3c09e7144..07a20feb8ef 100644
> > --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> > +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> > @@ -224,10 +224,16 @@ do_install() {
> >         if [ "${ARCH}" = "riscv" ]; then
> >              cp -a --parents arch/riscv/kernel/vdso/*gettimeofday.* $kerneldir/build/
> >              cp -a --parents arch/riscv/kernel/vdso/note.S $kerneldir/build/
> > +                 # v6.1+
> > +                 cp -a --parents arch/riscv/kernel/asm-offsets.c $kerneldir/build/
> >              if [ -e arch/riscv/kernel/vdso/gen_vdso_offsets.sh ]; then
> >                      cp -a --parents arch/riscv/kernel/vdso/gen_vdso_offsets.sh $kerneldir/build/
> >              fi
> > -           cp -a --parents arch/riscv/kernel/vdso/* $kerneldir/build/ 2>/dev/null || :
> > +                 cp -a --parents arch/riscv/kernel/vdso/* $kerneldir/build/ 2>/dev/null || :
>
> I'm just off a flight and running on very little sleep, but I can't
> tell what changed in the line
> above here.  Is it whitespace ?

yeah. There seems to be all kinds of tabs and space mix in there.

>
> > +            if [ -e arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh ]; then
> > +                    cp -a --parents arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh $kerneldir/build/
> > +            fi
>
> I realize I have a mix of conditionals and ||: in the file, but we've
> been doing most of
> the new additions without conditionals. Would the
> gen_compat_vdso_offsets.sh copy
> work in that style ?
>
> i.e.   cp -a --parents
> arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh
> $kerneldir/build/2>/dev/null || :
>

Yeah that would work too. Infact. I have just put it as defence
against older kernels where this file may not exist but
perhaps 6.x onwards it will always exist so we can get rid of this
conditional check completely.

> Bruce
>
> > +                 cp -a --parents arch/riscv/kernel/compat_vdso/* $kerneldir/build/ 2>/dev/null || :
> >         fi
> >
> >         # include the machine specific headers for ARM variants, if available.
> > --
> > 2.43.0
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#195016): https://lists.openembedded.org/g/openembedded-core/message/195016
> > Mute This Topic: https://lists.openembedded.org/mt/104203996/1050810
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [bruce.ashfield@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
Richard Purdie Feb. 8, 2024, 11:14 p.m. UTC | #3
On Tue, 2024-02-06 at 18:26 -0500, Bruce Ashfield wrote:
> On Tue, Feb 6, 2024 at 1:49 PM Khem Raj <raj.khem@gmail.com> wrote:
> > 
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> >  meta/recipes-kernel/linux/kernel-devsrc.bb | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
> > index 9c3c09e7144..07a20feb8ef 100644
> > --- a/meta/recipes-kernel/linux/kernel-devsrc.bb
> > +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
> > @@ -224,10 +224,16 @@ do_install() {
> >         if [ "${ARCH}" = "riscv" ]; then
> >              cp -a --parents arch/riscv/kernel/vdso/*gettimeofday.* $kerneldir/build/
> >              cp -a --parents arch/riscv/kernel/vdso/note.S $kerneldir/build/
> > +                 # v6.1+
> > +                 cp -a --parents arch/riscv/kernel/asm-offsets.c $kerneldir/build/
> >              if [ -e arch/riscv/kernel/vdso/gen_vdso_offsets.sh ]; then
> >                      cp -a --parents arch/riscv/kernel/vdso/gen_vdso_offsets.sh $kerneldir/build/
> >              fi
> > -           cp -a --parents arch/riscv/kernel/vdso/* $kerneldir/build/ 2>/dev/null || :
> > +                 cp -a --parents arch/riscv/kernel/vdso/* $kerneldir/build/ 2>/dev/null || :
> 
> I'm just off a flight and running on very little sleep, but I can't
> tell what changed in the line
> above here.  Is it whitespace ?
> 
> > +            if [ -e arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh ]; then
> > +                    cp -a --parents arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh $kerneldir/build/
> > +            fi
> 
> I realize I have a mix of conditionals and ||: in the file, but we've
> been doing most of
> the new additions without conditionals. Would the
> gen_compat_vdso_offsets.sh copy
> work in that style ?
> 
> i.e.   cp -a --parents
> arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh
> $kerneldir/build/2>/dev/null || :

I ended up heavily cleaning up the whitespace in this file and this
patch.

If anyone wants to make the conditionals more consistent I'm fine with
that too, I tend to prefer the if blocks but you can argue it both
ways, as ever...

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index 9c3c09e7144..07a20feb8ef 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -224,10 +224,16 @@  do_install() {
 	if [ "${ARCH}" = "riscv" ]; then
             cp -a --parents arch/riscv/kernel/vdso/*gettimeofday.* $kerneldir/build/
             cp -a --parents arch/riscv/kernel/vdso/note.S $kerneldir/build/
+	          # v6.1+
+	          cp -a --parents arch/riscv/kernel/asm-offsets.c $kerneldir/build/
             if [ -e arch/riscv/kernel/vdso/gen_vdso_offsets.sh ]; then
                     cp -a --parents arch/riscv/kernel/vdso/gen_vdso_offsets.sh $kerneldir/build/
             fi
-	    cp -a --parents arch/riscv/kernel/vdso/* $kerneldir/build/ 2>/dev/null || :
+	          cp -a --parents arch/riscv/kernel/vdso/* $kerneldir/build/ 2>/dev/null || :
+            if [ -e arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh ]; then
+                    cp -a --parents arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh $kerneldir/build/
+            fi
+	          cp -a --parents arch/riscv/kernel/compat_vdso/* $kerneldir/build/ 2>/dev/null || :
 	fi
 
 	# include the machine specific headers for ARM variants, if available.