Commit Graph

78 Commits

Author SHA1 Message Date
Jiaying Song
2f5d21049f kernel-devsrc: fix incorrect python shebang replacement
Update the sed replacement rule to strictly match '/usr/bin/python'
(with no trailing characters)

The previous sed rule was too broad and could incorrectly change Python
shebangs such as in
/lib/modules/6.16.11-yocto-standard/build/scripts/macro_checker.py from
'#!/usr/bin/python3' to '#!/usr/bin/env python33'.

(From OE-Core rev: c548259dbf55f2194088e62ad018560286834e49)

Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-30 11:06:28 +00:00
Chen Qi
8808d15b02 kernel-devsrc: copy arch/powerpc/tools contents
For now, using qemuppc64 as MACHINE and building things inside SDK,
we'll get the following error:

  ERROR: modpost: "_mcount" undefined

This is because after [1], MPROFILE_KERNEL is using arch/powerpc/tools/
contents to do the check. This in turn affects HAVE_OBJTOOL.
"""
arch/powerpc/Kconfig:   select HAVE_OBJTOOL                     if ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32
"""

The current MPROFILE_KERNEL for powerpc:
"""
config MPROFILE_KERNEL
            depends on PPC64_ELF_ABI_V2 && FUNCTION_TRACER
            def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -mlittle-endian) if CPU_LITTLE_ENDIAN
            def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -mbig-endian) if CPU_BIG_ENDIAN
"""

If MPROFILE_KERNEL is disabled, thus HAVE_OBJTOOL being disabled, then
FTRACE_MCOUNT_USE_RECORDMCOUNT will be enabled, causing this error.

The scripts are listed and copied one by one. Their names and the reasons why
they are copied are as below:
  gcc-check-mprofile-kernel.sh: needed by MPROFILE_KERNEL
  gcc-check-fpatchable-function-entry.sh: needed by ARCH_USING_PATCHABLE_FUNCTION_ENTRY
  head_check.sh/relocs_check.sh/unrel_branch_check.sh: needed by Makefile.postlink

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abba759796f9b73eb24df9b734dd063839fc62e0

(From OE-Core rev: df1c7c276422eeaf0eac178aec377a315a249c52)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-28 14:51:50 +01:00
Bruce Ashfield
360c3cde36 kernel-devsrc/x86: add v6.16+ build requirements
We require cpufeaturemasks.awk to create the build components
for x86.

(From OE-Core rev: 59c72bf15088c7d5e29b63603630b40a44183e8c)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-17 10:41:18 +01:00
Hongxu Jia
1fb4a71811 kernel-devsrc: make package version consistent with kernel source
The package version of kernel-devsrc is 1.0 which is not consistent
with kernel source

$ bitbake kernel-devsrc
$ ls tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0/deploy-rpms/qemux86_64/kernel-devsrc-*
tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0/deploy-rpms/qemux86_64/kernel-devsrc-1.0-r0.qemux86_64.rpm
tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0/deploy-rpms/qemux86_64/kernel-devsrc-dbg-1.0-r0.qemux86_64.rpm
tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0/deploy-rpms/qemux86_64/kernel-devsrc-dev-1.0-r0.qemux86_64.rpm

After commit [kernelsrc.bbclass/perf: make package version consistent
with kernel source] applied, it moved the setting of PKGV to
kernelsrc.bbclass for common use. And bbclass kernelsrc has already
inherited linux-kernel-base, this commit uses bbclass kernelsrc to
instead of linux-kernel-base, and remove duplicated settings.

After applying this commit:
$ ls tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0/deploy-rpms/qemux86_64/kernel-devsrc-*
tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0/deploy-rpms/qemux86_64/kernel-devsrc-6.12.31-r0.qemux86_64.rpm
tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0/deploy-rpms/qemux86_64/kernel-devsrc-dbg-6.12.31-r0.qemux86_64.rpm
tmp/work/qemux86_64-poky-linux/kernel-devsrc/1.0/deploy-rpms/qemux86_64/kernel-devsrc-dev-6.12.31-r0.qemux86_64.rpm

(From OE-Core rev: ceff363630ac0397c40be4a5ce54a6c20f901c40)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-03 10:40:17 +01:00
Erick Shepherd
62ef491722 kernel-devsrc.bb: Replace extra System.map file with symlink
Currently there are two .map files being copied to $kerneldir/build.
One of the files is System.map and the other is
System.map-<kernel version>. Each .map file takes up about 5MB and
have identical sha256sum hashes. This change will make it so only
System.map-<kernel version> is copied in order to save disk space.
It also recreates System.map as a symlink to that .map file.

(From OE-Core rev: cc971fffb134aa6af9edeabb7a5f4143dee2151e)

Signed-off-by: Erick Shepherd <erick.shepherd@ni.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-05-15 10:55:26 +01:00
Richard Purdie
c2da016918 meta/meta-selftest: Fix variable assignment whitespace
Recipes are much more readable with whitespace around the assignment operators.
Fix various assignments in OE-Core to show this is definitely the preferred
formatting.

(From OE-Core rev: 30ea609d3357fb3de911f2f6a5e6856c151b976a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-01 13:42:34 +00:00
Bruce Ashfield
054ed2cf17 kernel-devsrc: fix powerpc for 6.12+
crtsavres need to be available for scripts to be regenerated
in 6.12+:

  commit 699d53f04829d6b8855ff458f86e4b75ef3e5f0c
  Author: Christophe Leroy <christophe.leroy@csgroup.eu>
  Date:   Thu Sep 19 20:55:57 2024 +0200

      powerpc/vdso32: Fix use of crtsavres for PPC64

(From OE-Core rev: ecf72da891ebb08807a694967caccb51805813f2)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-22 16:53:37 +00:00
Bruce Ashfield
ce6a0b875b kernel-devsrc: update for 6.12+
arm64 needs some new files to regenerate the build environment
in 6.12+.

This is due to upstream commits:

  commit e632bca07c8eef1de9dc50f4e4066c56e9d68b07
  Author: Arnd Bergmann <arnd@arndb.de>
  Date:   Thu Jul 4 14:33:34 2024 +0200

      arm64: generate 64-bit syscall.tbl

      Change the asm/unistd.h header for arm64 to no longer include
      asm-generic/unistd.h itself, but instead generate both the asm/unistd.h
      contents and the list of entry points using the syscall.tbl scripts that
      we use on most other architectures.

      Once his is done for the remaining architectures, the generic unistd.h
      header can be removed and the generated tbl file put in its place.

      The Makefile changes are more complex than they should be, I need
      a little help to improve those. Ideally this should be done in an
      architecture-independent way as well.

      Acked-by: Catalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: Arnd Bergmann <arnd@arndb.de>

and:

  commit 712676ea2bb3882a852bcf49862c4247317fc9b2
  Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
  Date:   Tue Sep 3 12:09:17 2024 +0000

      arm64: vDSO: Wire up getrandom() vDSO implementation

      Hook up the generic vDSO implementation to the aarch64 vDSO data page.
      The _vdso_rng_data required data is placed within the _vdso_data vvar
      page, by using a offset larger than the vdso_data.

      The vDSO function requires a ChaCha20 implementation that does not write
      to the stack, and that can do an entire ChaCha20 permutation.  The one
      provided uses NEON on the permute operation, with a fallback to the
      syscall for chips that do not support AdvSIMD.

      This also passes the vdso_test_chacha test along with
      vdso_test_getrandom. The vdso_test_getrandom bench-single result on
      Neoverse-N1 shows:

         vdso: 25000000 times in 0.783884250 seconds
         libc: 25000000 times in 8.780275399 seconds
       syscall: 25000000 times in 8.786581518 seconds

      A small fixup to arch/arm64/include/asm/mman.h was required to avoid
      pulling kernel code into the vDSO, similar to what's already done in
      arch/arm64/include/asm/rwonce.h.

      Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
      Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
      Acked-by: Will Deacon <will@kernel.org>
      Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

(From OE-Core rev: b3c24a31c29aa74a9d63a0ea0bcaccca73db870b)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-12 11:19:44 +00:00
Bruce Ashfield
f09f9e82a6 kernel-devsrc: make tools/Build optional
kernel-devsrc fails to copy files for v6.12+ as the
following upstream commit has removed the file tools/build/Build:

   commit ea974028a049f2cea4bb6be963ee3e3844a03f6d
   Author: Brian Norris <briannorris@chromium.org>
   Date:   Mon Jul 15 13:32:43 2024 -0700

       tools build: Avoid circular .fixdep-in.o.cmd issues

We make the failed copy of this file non-fatal to support
all kernel versions.

(From OE-Core rev: 13e16e5be25f379211c7329fa1462464174c0f2d)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-07 13:31:26 +00:00
Bruce Ashfield
a7260ae9ba kernel-devsrc: remove 64 bit vdso cmd files
In a similar way to the other architectures, 64 bit arches
can also require vdso generation. If we leave the .cmd files
around, they'll be packaged and generate build errors:

   ERROR: kernel-devsrc-1.0-r0 do_package_qa: QA Issue: File /usr/lib/modules/6.10.0-yocto-standard/build/include/generated/.vdso64-offsets.h.cmd in package kernel-devsrc contains reference to TMPDIR [buildpaths]
So we add the file to our remove list and avoid the issue.

(From OE-Core rev: 0238a49f57c83600909b0f3773a1569bcd13551c)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-03 07:47:35 +01:00
Richard Purdie
353fb8f18f kernel-devsrc: Improve vdso-offsets handling for qemuriscv64
Fix:

kernel-devsrc-1.0-r0 do_package_qa: QA Issue: File /lib/modules/6.6.15-yocto-standard/build/include/generated/.compat_vdso-offsets.h.cmd in package kernel-devsrc contains reference to TMPDIR [buildpaths]

by adding to the list of files we do this with. Also drop the
conditional since rm -f handles this.

This only apppears for qemurisc*.

(From OE-Core rev: a8fde81958fef39589e0df3f57c1dffd028d1631)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-17 18:19:19 +00:00
Richard Purdie
4a6a1a8c3c kernel-devsrc: Clean up whitespace
This file had a function full of mixed tabs and spaces. Our policy says
tabs, some layers use spaces but this function matched nothing.

It makes sense to clean this up, I'm torn between which to use. I've gone
with the lesser invasive change (despite what the diff looks like) and used
spaces as the code was clearly written with that partly in mind and tabs would
have changed every line. Hopefully this makes future patches a little less
weird looking.

(From OE-Core rev: 34f0b22978a81abe891b00f716a56533504161d7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-08 23:14:51 +00:00
Khem Raj
18c4179d11 kernel-devsrc: Add needed fixes for 6.1+ kernel build on target on RISCV
(From OE-Core rev: 0b1e8df551d50331fc26048209b759a199bd964d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-08 11:07:38 +00:00
Claus Stovgaard
4c1eefd0c3 kernel-devsrc: RDEPENDS on gawk
In reality all architectures have been depending on awk / gawk for
significant time.

gawk directly since v5.10 as it introduced scripts/check-sysctl-docs

grep for /usr/bin/awk results in

* arch/x86/tools/gen-insn-attr-x86.awk:#!/usr/bin/awk -f
* scripts/ver_linux:#!/usr/bin/awk -f
* tools/arch/x86/tools/gen-insn-attr-86.awk:#!/usr/bin/awk -f

So instead of relying on other recipes adding gawk - RDEPEND on it.

(From OE-Core rev: b55b07cd3660c7ff151e9456e85c5163978a1027)

Signed-off-by: Claus Stovgaard <claus.stovgaard@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-03 21:43:35 +00:00
Claus Stovgaard
11b804bbf1 kernel-devsrc: fix RDEPENDS for make
Since kernel version 6.6 the debian package rules has been split up into
a separate rules file, resulting in a runtime requirement for make.
See scripts/package/debian/rules

Remove the rules file, for not RDEPENDS on make for something we are
not using for building modules.

For reproducing the issue on a normal qemux86-64 machine, change to the
linux-yocto-dev kernel, add the kernel-devsrc to the toolchain target
task and disable ptest in distro features. (Notice ptest adds make as
RDEPENDS for other packages hiding the issue)

when populating sdk you will see dnf failing.

 Problem: conflicting requests
  - nothing provides /usr/bin/make needed by kernel-devsrc-1.0-r0.qemux86_64 from oe-repo

(From OE-Core rev: 711fc671012820458a7a28717ee0456fa850a523)

Signed-off-by: Claus Stovgaard <claus.stovgaard@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-03 21:43:35 +00:00
Zang Ruochen
7cf595a49b kernel-devsrc: Fixed missing loongarch64 kernel source code when test_kernelmodules
(From OE-Core rev: 754cf445b2670442cf94c9432b0a69141cc2a67d)

Signed-off-by: Zang Ruochen <zangruochen@loongson.cn>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-07 14:42:38 +01:00
bkylerussell@gmail.com
2368c2c884 kernel-devsrc: depend on python3-core instead of python3
Avoids pulling in potential GPLv3 packages through python3-misc catch-all.

python3-core is the intended minimal RDEPENDS for packages requiring python3
support.  Other python3 module dependencies should be listed explicitly.

(From OE-Core rev: 231f93becad619f6afa383f9b1132f1d4b02fa64)

Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-13 11:56:07 +01:00
Bruce Ashfield
0544310d60 kernel/kernel-devsrc: powerpc: add elfutils dependency
When working on 6.3+ kernel support powerpc started to fail when
doing on target kerne module builds, and in some cases when building
the kernel itself.

This was due to crtsavres requiring objtool to build, which was
missing required development headers.

So in a similar manner to x86, we add elfutils as an arch specific
dependency in these recipes.

(From OE-Core rev: 14b815b0beb6edc14b4fcc016201ade967875e28)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-26 18:50:17 +01:00
Bruce Ashfield
2cf5280cd4 kernel-devsrc: fix mismatched compiler warning
When building a module on target, we use the native compiler
(always "gcc") versus the same compiler, but named in a cross
compiler manner, for the kernel build.

The kernel captures the compiler string in several places,
some of which we are already fixing, but others we are not
(as they don't cause issues).

But when building an on target module, the main kernel Makefile
compares compiler strings and outputs a warning similar to:

  warning: the compiler differs from the one used to build the kernel
    The kernel was built by: x86_64-poky-linux-gcc (GCC) 11.3.0
    You are using:           gcc (GCC) 11.3.0

We drop the cross compilation prefix from the captured compiler
string, and we avoid the warning.

RP: tweaked one sed expression to fix quoting issue with 5.15
(From OE-Core rev: 70419f281a4571d01975bd79a47a6ed7ae70b1ae)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-26 18:50:17 +01:00
Denys Zagorui
ad5f0a2fe4 kernel-devsrc: powerpc: add missed dependency for modules_prepare
There is an issue during 'make modules_prepare' execution for PPC_85xx:

arch/powerpc/kernel/asm-offsets.c:58:10: fatal error: head_booke.h: No such file or directory
   58 | #include "head_booke.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.build:118: arch/powerpc/kernel/asm-offsets.s] Error 1

asm-offests.c has dependency on head_booke.h so add it to kernel-devsrc package

(From OE-Core rev: 46705c47428a8d909518a0ed29dd2051f6321e2f)

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-02-15 10:21:35 +00:00
Bruce Ashfield
2be1b5d7d3 kernel-devsrc: fix for v6.1+
The 6.1 kernel has a number of Kbuild and architecture changes
that required us to update our devsrc recipe. With these changes
we are once again able to build on target modules for all
supported archectures.

(From OE-Core rev: a3972b3f919400a12bb9a546ae98092cbfdcdbb8)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-22 12:26:45 +00:00
Richard Purdie
8bc77f0dc6 kern-devsrc: Drop auto.conf creation
After this commit in the mainline kernel, the quoting is different in auto.conf
compared to .config:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=129ab0d2d9f38b9d43df35235fc66c6740d6928b

We therefore can't just copy one over the other or it leads to syntax/quoting
errors. We end up running make prepare anyway in all our tests so drop
this copy for fix 5.19 kernels.

(From OE-Core rev: 8edbb540be564cebb72d7af38429405aca662bc9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-09 16:37:24 +01:00
Bruce Ashfield
5eb28fc7a1 kernel-devsrc: support powerpc on v5.19+
The on-target/scripts requirements have expanded for powerpc on v5.19+
we copy the required .S and .sh files as part of devsrc to support the
archtecture.

(From OE-Core rev: 9fb466612bd735046a4037b0d62f24a9d6f35628)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:21 +01:00
Bruce Ashfield
83ac474414 kernel-devsrc: support arm v5.19+ on target build
Adding two new tools required for 'scripts prepare' on arch arm
and arm64.

(From OE-Core rev: 7b195d7be1d0db1ad8024494ff990717bd30aea4)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Bruce Ashfield
4cb5773ace kernel-devsrc: ppc32: fix reproducibility
In a similar manner to the arm/arm32 reprodicibility fixes,
we can also fix ppc32.

The file .vdso32-offsets.h.cmd has captured paths, but we don't
need it on target or SDKs to regenerate a build enviroment.

We add it to our vdso-offsets list of files to delete and we
no longer have files patckaged with buildpaths.

(From OE-Core rev: 2a142b68b232ff7728f4eb945eea923c64e7ebd5)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-12 12:52:52 +01:00
Bruce Ashfield
44e84bfe0c kernel-devsrc: fix reproducibility and buildpaths QA warning
We've been removing .vdso-offsets.h.cmd for quite some time, as it
is not required to regenerate scripts or to satisfy the prepare
target in the kernel source.

That being said, there is a secondary location that this file may
be found, and since we aren't detecting or removing it, we end up
with embedded build paths, which cause both reproducibility and
buildpaths QA warnings.

We can test for both files, and force remove them if present, and
we'll fix this new location of the file and not risk breaking
any old kernels.

(From OE-Core rev: e0a9433685397b716920fa9ad5d5a7be95c496f7)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-08 00:09:42 +01:00
Khem Raj
32276b968e kernel-devsrc: Check for gen_vdso_offsets.sh before copying on riscv
This file is introduced in newer kernels >= 5.15 but some RISCV machines
still use 5.13 kernels, this ensures that kernel-devsrc can build on
older kernels for RISCV

(From OE-Core rev: b4d3c2c03495730a2253669ad8a438288629a1c8)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-14 09:47:00 +01:00
Oleksandr Ocheretnyi
cff7f3c174 kernel-devsrc: do not copy Module.symvers file during install
When CONFIG_MODULES is not enabled in kernel config - Module.symvers
generation is not done, which causes the file not to be created.

This fails later in do_install() due to the fact that copy
command in executed for non-existing Module.symvers file.

Check for Module.symvers existence before copy command in executed.

(From OE-Core rev: deacceac6461400037b152260c8edbc819f6309a)

Signed-off-by: Oleksandr Ocheretnyi <oocheret@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-27 12:34:40 +00:00
Richard Purdie
b0130fcf91 meta/meta-selftest/meta-skeleton: Update LICENSE variable to use SPDX license identifiers
An automated conversion using scripts/contrib/convert-spdx-licenses.py to
convert to use the standard SPDX license identifiers. Two recipes in meta-selftest
were not converted as they're that way specifically for testing. A change in
linux-firmware was also skipped and may need a more manual tweak.

(From OE-Core rev: ceda3238cdbf1beb216ae9ddb242470d5dfc25e0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-20 16:45:25 +00:00
Ross Burton
c0583c6bfc meta: use ln -rs instead of lnr
lnr is a script in oe-core that creates relative symlinks, with the same
behaviour as `ln --relative --symlink`.  It was added back in 2014[1] as
not all of the supported host distributions at the time shipped
coreutils 8.16, the first release with --relative.

However the oldest coreutils release in the supported distributions is
now 8.22 in CentOS 7, so lnr can be deprecated and users switched to ln.

[1] 6ae3b85eaffd1b0b6914422e8de7c1230723157d

(From OE-Core rev: 1ca455a98de4c713f58df0a537d4c982d256cd68)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-10 19:27:29 +00:00
Khem Raj
a45d5e201c kernel-devsrc: Add vdso.lds and other build files for riscv64 as well
These additional bits are needed on riscv64 as well
Fixes
make[1]: *** No rule to make target 'arch/riscv/kernel/vdso/vdso.lds', needed by 'arch/riscv/kernel/vdso/vdso.so.dbg'.  Stop.
make: *** [arch/riscv/Makefile:114: vdso_prepare] Error 2

(From OE-Core rev: 446972600ed51ca75a2a4e579cdc3e6dd2e05195)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-05 11:41:00 +00:00
Bruce Ashfield
7cd1bae810 kernel-devsrc: fix 5.14+ objtool compilation
In v5.14+, x86 requires not just elfutils, but the elf headers
on the target to build objtool (required for 'scripts parepare'),
so we tweak our RDEPENDS to ensure that the right headers are
on the target.

(From OE-Core rev: 03ccc234386f753e1b0129ec557e67bcd04cc69e)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-18 17:01:06 +01:00
Bruce Ashfield
408a1d24e1 kernel-devsrc: 5.14+ updates
commit 6218d0f6b8dec [x86/syscalls: Switch to generic syscalltbl.sh]
means that x86 no longer has a syscall script to copy, which causes
a build error.

We already copy the generic syscall script (in scripts), so we just
catch errors for the copies to support older and 5.14+ kernels in
the same devsrc recipe.

(From OE-Core rev: 5debc9bc25110b836b76927c61b2455e5e235a84)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-18 17:01:06 +01:00
Richard Purdie
bb6ddc3691 Convert to new override syntax
This is the result of automated script conversion:

scripts/contrib/convert-overrides.py <oe-core directory>

converting the metadata to use ":" as the override character instead of "_".

(From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-02 15:44:10 +01:00
Bruce Ashfield
1453135bd7 kernel-devsrc: powerpc64 add scripts prepare support
Similar to 32bit powerpc, we need more vdso bits in devsrc to
support on target scripts prepare for powerpc64.

(From OE-Core rev: 412186e001c66f943e10d787e9b826f1ca987402)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-05 10:59:40 +01:00
Bruce Ashfield
c903260701 kernel-devsrc: fix scripts prepare for powerpc
5.13 introduces some new tweaks required to get on target scripts
and prepare working for powerpc:

  - 'nm' is detected as 'nm --synthetic', so we adjust our replacement
  - more vdso is required on target, so we copy those files (like arm64
    does)
  - grep is required during processing, so we add it to the redpends

(From OE-Core rev: c43baf3a0e41b41a64f450fd03810306c8ddd314)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-05 10:59:40 +01:00
Bruce Ashfield
ef8f5d17cc kernel-devsrc: fix scripts/prepare for ARM64
There are two new tools in 5.13+ required for on target
recreation of the build environment.

We conditionally add them to the devsrc recipe to support
both 5.13 and older kernels.

(From OE-Core rev: cb1b7e76f20dc7f11a667fa00958ab56e680c632)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-05 10:59:40 +01:00
Bruce Ashfield
6938faf9d1 kernel-devsrc: adjust NM and OBJTOOL variables for target
v5.13 has started storting the values for NM and OBJTOOL in
auto.conf.cmd

Just as we've done for other tools, we need to adjust NM and
OBJTOOL to the names of the on-target executables. With this
adjustment, 'make scripts prepare' continues to work without
user intervention on the target.

(From OE-Core rev: e749b81ece1f94f99ca26028a2f6f891aa14bda9)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-18 23:52:53 +01:00
Bruce Ashfield
ea8f03e279 kernel-devsrc: fix on-target scripts/prepare for v5.12+
AR is now captured are part of the build environment. If we don't
subtitute our on-target variant for the cross version, we'll end
up getting a prompted configure when preparing to build modules.

(From OE-Core rev: 09bf40bf890a9d56c8365eb93a4baf467dc3308c)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-20 18:54:57 +00:00
Bruce Ashfield
3a457ee449 kernel-devsrc: fix 32bit ARM devsrc builds
As a follow up to commit: 0fc66a0b64953 [kernel: provide module.lds
for out of tree builds in v5.10+], we must not only copy module.lds
from its new location, we have to not error when it isn't found in
the old location.

With this tweak, we have coverage on all supported arches for the
new location of module.lds, and backwards compatibility through
kernel versions.

(From OE-Core rev: cb940d8af359fa370254bd4c2b36ba26708bb54b)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-30 14:01:07 +00:00
INC@Cisco)
51c5cd66e1 kernel-devsrc: improve reproducibility for arm64
.vdso-offsets.h.cmd contains command that was used to produce vdso-offsets.h.
It breaks reproducibility because it has an absolute path in it. There is no
any value to package such files so it can be dropped.

(From OE-Core rev: d31b4db24643b0867c654af34c684b4de2f8122b)

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-24 10:27:44 +00:00
Bruce Ashfield
92eceb5f1d kernel: provide module.lds for out of tree builds in v5.10+
The upstream commit 596b0474d3d [kbuild: preprocess module linker
script], adds a dependency on module.lds for external module
building.

Since module.lds is generated as part of 'modules_prepare', we
must make it available with the other kernel artifacts in the
kernel shared workdir, otherwise out of tree builds fail.

This fixes errors like:

    | make[4]: *** No rule to make target 'scripts/module.lds', needed by
        'build/tmp/work/qemuarm64-poky-linux/cryptodev-module/1.11-r0/git/cryptodev.ko'.
        Stop.
    | make[4]: *** Waiting for unfinished jobs....

We also ensure that kernel-devsrc has a copy to support on
target module builds that are often prepared with 'make scripts
prepare'. Those targets won't regenerate it, so the build fails.
If 'make modules_prepare' is used, the file will be regenerated
and overwrite our copy (as expected).

(From OE-Core rev: 0fc66a0b64953aae38d0124b57615fffaec8de52)

Signed-off-by: Pan, Kris <kris.pan@intel.com>
Signed-off-by: Lili Li <lili.li@intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-16 14:27:46 +00:00
Bruce Ashfield
d1c691b3ad kernel-devsrc: account for HOSTCC and HOSTCXX
Since commit 740d87766cb87f75c477 [kernel.bbclass: Configuration
for environment with HOSTCXX], both HOSTCC and HOSTCXX are pickedup
by the kernel build system as triggers to reconfigure if changed.

As with previous changes to devsrc, we replace the cross build
variant, with what will be on target, so operations such as
'make scripts prepare' won't trigger a reconfiguration.

(From OE-Core rev: d7981babc55845914f20e7deb11b81aa2dbfcff3)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-12 14:49:00 +01:00
Bruce Ashfield
fc2b9f7f99 kernel-devsrc: 5.8 + gcc10 require gcc-plugins + libmpc-dev
In order to execute 'make scripts prepare' on target with the
5.8 kernel and gcc 10, we need to have the gcc-plugins and
libmpc-dev on target.

Although not strictly required for all kernel versions, they
don't do any harm when included.

We add them to the RDEPENDS of devsrc to avoid the errors:

   scripts/gcc-plugins/gcc-common.h:5:10: fatal error: bversion.h: No such
   file or directory
   | #include "bversion.h"

and

   /usr/lib/gcc/arm-poky-linux-gnueabi/10.1.0/plugin/include/builtins.h:23:10:
     fatal error: mpc.h: No such file or directory

(From OE-Core rev: a69746351029a878d4d41baeb3f679d65118d5e3)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-13 08:07:00 +01:00
Bruce Ashfield
84daf88c9c kernel-devsrc: fix on target modules prepare for ARM
The arm compiler and linker weren't matching the replacement
regex's in devsrc. We make the expressions a bit more generic
to catch the triplets for ARM.

(From OE-Core rev: 36b848118fc4963118c96b0c3211e7ee017790eb)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-13 08:07:00 +01:00
Bruce Ashfield
dfa3d5e395 kernel-devsrc: fix x86 (32bit) on target module build
The previous devsrc v5.8 on target build fixup [532ae127c
kernel-devsrc: fix on-target module build for v5.8+], missed
on condition: the defconfig

On 32bit x86 the arch can be queried differently on the host
and target. We aren't building against the defconfig, so we
remove it from auto.conf.cmd and we can again prepare to build
modules on target.

(From OE-Core rev: 368537ab94e141e02eb981fa0fb44548b4be297e)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-06 15:12:39 +01:00
Bruce Ashfield
60d3f65d1c kernel-devsrc: fix on-target module build for v5.8+
The kernel build is now more sensitive to changing build inputs,
like the compiler, linker, source tree location, versions, file
timestamps, etc.

When a difference is detected, the kernel build invokes a syncconfig
to update/regenerate files as required. That process may prompt, and
hence breaks automated tested and other workflows.

By default, we don't want this to happen so we make sure that auto*
timestamps are newer or equal to the .config timestap, we ensure that
autoconf.h is in the filesystem and that we've substituted the
cross tools used to build the kernel with the names that will be
on the target.

(From OE-Core rev: 532ae127c52c9f7b1d2e4ca5cbca91881d23a2ac)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-20 08:37:38 +01:00
Ruslan Bilovol
fa4945100a kernel-devsrc: support 4.4+ ARM/ARM64 kernels
Linux Kernel 4.4 is an LTS kernel so people may still
build it with OE.

Thus make copying of some files optional:
 - arm64 module.lds file first appeared with kernel v4.6 commit
   fd045f6cd98e arm64: add support for module PLTs"
 - arm32 *.tbl files first appeared in kernel v4.10 in
   commit 96a8fae0fe09 "ARM: convert to generated
   system call tables"

(From OE-Core rev: 3329dd6ea914c5fadbf63ecbfde9c66472df19ee)

Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-03 13:06:29 +00:00
Bruce Ashfield
a8fa7a3f40 devsrc: fix objtool generation for v5.4+
commit 6ec14aa7a58a1c2fb303692f8cb1ff82d9abd10a [objtool: Silence build output]
was added to -stable in v5.4.19.

This change was meant to ensure that build output was truly silent when required.
But the trailing "cd -" in the tools script was ensuring that a success return
code was always returned from the sync script. As such, some missing files for
x86 were being masked.

We add those files to ensure that objtool can be regenerated as required

(From OE-Core rev: 3009e82f65bcf0988b4400552afd554ff91f024b)

Signed-off-by: Bruce Ashfield <bruce.ashfield@xilinx.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-22 23:57:26 +00:00
Bruce Ashfield
29ba11e7d1 kernel-devsrc: update to v5.4+
To support on-target module building, we need to include syscall.tbl
for ARM64 (just like we do for other architectures).

We also copy .config with -a to ensure that we don't trigger extra
processing and regen configs.

(From OE-Core rev: 1be199f79479d9c8125bd3548cd4f2354f597640)

Signed-off-by: Bruce Ashfield <bruce.ashfield@xilinx.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-03 00:10:11 +00:00