diff mbox series

[langdale] kernel.bbclass: Include randstruct seed assets in STAGING_KERNEL_BUILDDIR

Message ID 86508b235df8fd9da34ab1f420c6a98f3edf2ba5.1669100497.git.diego.sueiro@arm.com
State New
Headers show
Series [langdale] kernel.bbclass: Include randstruct seed assets in STAGING_KERNEL_BUILDDIR | expand

Commit Message

Diego Sueiro Nov. 22, 2022, 7:04 a.m. UTC
When building with CONFIG_MODVERSIONS=y and CONFIG_RANDSTRUCT=y we need
to copy the build assets generated for the randstrutc seed to
STAGING_KERNEL_BUILDDIR, otherwise the out-of-tree modules build will
generate those assets which will result in a different
RANDSTRUCT_HASHED_SEED.

(From OE-Core rev: b36303158b2e0273ff415bdedefb379f680b30fc)

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes-recipe/kernel.bbclass | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Steve Sakoman Nov. 22, 2022, 2:13 p.m. UTC | #1
Hi Diego,

This patch is already in the patchset currently out for review:

https://lists.openembedded.org/g/openembedded-core/message/173569

I'll be sending the pull request later today, so it should appear in
the langdale branch in the next day or two.

Thanks!

Steve



On Mon, Nov 21, 2022 at 9:04 PM Diego Sueiro <diego.sueiro@arm.com> wrote:
>
> When building with CONFIG_MODVERSIONS=y and CONFIG_RANDSTRUCT=y we need
> to copy the build assets generated for the randstrutc seed to
> STAGING_KERNEL_BUILDDIR, otherwise the out-of-tree modules build will
> generate those assets which will result in a different
> RANDSTRUCT_HASHED_SEED.
>
> (From OE-Core rev: b36303158b2e0273ff415bdedefb379f680b30fc)
>
> Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/classes-recipe/kernel.bbclass | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
> index 7bb3449223..3834a42fb9 100644
> --- a/meta/classes-recipe/kernel.bbclass
> +++ b/meta/classes-recipe/kernel.bbclass
> @@ -591,6 +591,22 @@ do_shared_workdir () {
>                         cp tools/objtool/objtool ${kerneldir}/tools/objtool/
>                 fi
>         fi
> +
> +       # When building with CONFIG_MODVERSIONS=y and CONFIG_RANDSTRUCT=y we need
> +       # to copy the build assets generated for the randstruct seed to
> +       # STAGING_KERNEL_BUILDDIR, otherwise the out-of-tree modules build will
> +       # generate those assets which will result in a different
> +       # RANDSTRUCT_HASHED_SEED
> +       if [ -d scripts/basic ]; then
> +               mkdir -p ${kerneldir}/scripts
> +               cp -r scripts/basic ${kerneldir}/scripts
> +       fi
> +
> +       if [ -d scripts/gcc-plugins ]; then
> +               mkdir -p ${kerneldir}/scripts
> +               cp -r scripts/gcc-plugins ${kerneldir}/scripts
> +       fi
> +
>  }
>
>  # We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
> --
> 2.35.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#173670): https://lists.openembedded.org/g/openembedded-core/message/173670
> Mute This Topic: https://lists.openembedded.org/mt/95191269/3620601
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [steve@sakoman.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 7bb3449223..3834a42fb9 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -591,6 +591,22 @@  do_shared_workdir () {
 			cp tools/objtool/objtool ${kerneldir}/tools/objtool/
 		fi
 	fi
+
+	# When building with CONFIG_MODVERSIONS=y and CONFIG_RANDSTRUCT=y we need
+	# to copy the build assets generated for the randstruct seed to
+	# STAGING_KERNEL_BUILDDIR, otherwise the out-of-tree modules build will
+	# generate those assets which will result in a different
+	# RANDSTRUCT_HASHED_SEED
+	if [ -d scripts/basic ]; then
+		mkdir -p ${kerneldir}/scripts
+		cp -r scripts/basic ${kerneldir}/scripts
+	fi
+
+	if [ -d scripts/gcc-plugins ]; then
+		mkdir -p ${kerneldir}/scripts
+		cp -r scripts/gcc-plugins ${kerneldir}/scripts
+	fi
+
 }
 
 # We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware