Commit Graph

21 Commits

Author SHA1 Message Date
Alexander Kanavin
efb0410d38 meta: set S from UNPACKDIR in recipes that use only local files
There is no need to have two assignments; also setting S from
UNPACKDIR (and not vice versa) is more logical as unpack
task comes first, and tasks that come after unpack use S to access
unpack results.

Also adjust reference test data in selftest/recipeutils to reflect changes in test recipes.

(From OE-Core rev: f64b7e5fb3181734c8dde87b27e872a026261a74)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-20 12:07: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
Richard Purdie
d6ae8d2004 recipes: Switch away from S = WORKDIR
Where recipes use S = ${WORKDIR}, change them to set UNPACKDIR to
a subdir of WORKDIR and make S point at this instead.

I've chosen not to force S into any standard UNPACKDIR we may pick in
future just so the S = UNPACKDIR case is clearly visible by the
directory naming under WORKDIR as that should aid usability.

(From OE-Core rev: d9328e3b0b062f0621de3d114584b44f384a1c02)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-21 12:08:04 +01:00
Bruce Ashfield
88ae1b73c0 kernel: make LOCALVERSION consistent between recipes
The initial fix for localversion setting in 6.3+ broke older
recipes and also broke recipes setting localversion in a kernel
recipe, as make-mod-scripts (and other locations) can trigger
a regeneration of files and don't have access to the variable.

Moving the setting of this variable to the global namespace
doesn't make sense, so we follow the example of the kernel-abiversion
and save a kernel-localversion to the build artifacts.

Recipes that may regenerate scripts/dynamic files, must
depend on the do_shared_workedir of the kernel and use the helper
function to read the file storing the localversion.

(From OE-Core rev: b378eec156998eea55ba61e59103cb34fab0d07c)

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>
2023-07-25 15:27:33 +01:00
Khem Raj
0ef2e5081b kernel: Add kernel specific STRIP variable
strip can be coming from binutils or from llvm
in some cases llvm-strip can fail on kernel

Subprocess output:aarch64-yoe-linux-llvm-strip: error: Link field value 28 in section .rela.dyn is not a symbol table

This helps in selecting which strip is used when building kernel

(From OE-Core rev: 03973c8c1c93ddb1c8e05b773bfcc45aed73a99f)

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>
2023-06-19 13:18:56 +01:00
Khem Raj
43a4d45f51 kernel: Add kernel specific OBJDUMP
This helps in switching toolchains cleanly for kernel build
between gcc and clang

Currently, some kernels allow building with clang but not all
the distro might use clang as default system compiler but kernel
may demand gcc which is provided via KERNEL_* variables, however
kernel does use OBJCOPY at places during build and it maybe set
to use llvm objcopy when using clang. That should be a deliberate
setting when clang is used for kernel as well, otherwise it should
use binutils provided objcopy

(From OE-Core rev: 17b409f2fd97894e0943d13c2cb0d52abde647e3)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-01 21:29:31 +00:00
Richard Purdie
5bd43a58a7 make-mod-scripts: Ensure kernel build output is deterministic
The definitions in linux-kernel-base are needed to ensure the generated headers
are consistent. This was a small step that was missing from the previous
changes to linux-kernel-base as both kernel-devsrc and make-mod-scripts
need this information defined consistently.

(From OE-Core rev: 0d79d4883f924cef0d0ba361506ad75d441b9721)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-29 10:50:42 +00:00
Richard Purdie
73cf55cdde bitbake.conf/recipes: Introduce add DEV_PKG_DEPENDENCY to change RDEPENDS:${PN}-dev
There is a pattern that several recipes need to break the dependency of ${PN}-dev
on ${PN}, most often as ${PN} may be be empty. Add a new variable to parameterise
this and allow it to be changed more easily.

(From OE-Core rev: a5b381c0f45c590a762647a9956a8f41e2e2315e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-28 23:49:37 +01: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
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
Denys Dmytriyenko
8c130cd764 make-mod-scripts: pass CROSS_COMPILE to configure and build
Fixes:
|   CALL    /OE/poky-master/build/tmp/work-shared/qemuarm64/kernel-source/scripts/checksyscalls.sh
|   CALL    /OE/poky-master/build/tmp/work-shared/qemuarm64/kernel-source/scripts/atomic/check-atomics.sh
|   LDS     arch/arm64/kernel/vdso/vdso.lds
|   CC      arch/arm64/kernel/vdso/vgettimeofday.o
|   AS      arch/arm64/kernel/vdso/note.o
|   AS      arch/arm64/kernel/vdso/sigreturn.o
|   LD      arch/arm64/kernel/vdso/vdso.so.dbg
|   VDSOSYM include/generated/vdso-offsets.h
|   OBJCOPY arch/arm64/kernel/vdso/vdso.so
| objcopy: Unable to recognise the format of the input file `arch/arm64/kernel/vdso/vdso.so.dbg'
| /OE/poky-master/build/tmp/work-shared/qemuarm64/kernel-source/arch/arm64/kernel/vdso/Makefile:61: recipe for target 'arch/arm64/kernel/vdso/vdso.so' failed

Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Cc: Nishanth Menon <nm@ti.com>
(From OE-Core rev: ddad8183490c725062626fa52985da2b04a2aa8f)

Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-05 15:29:02 +01:00
Meh Mbeh Ida Delphine
3ca5157080 recipes-kernel: Add missing HOMEPAGE and DESCRIPTION for recipes.
Fixes: [YOCTO #13471]

(From OE-Core rev: 16409694f19e4d3b7bdc10a7f71c67938ce5f3ff)

Signed-off-by: Ida Delphine <idadelm@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-02 20:39:35 +00:00
Richard Purdie
87ed5dab07 recipes: Update common-licenses references to match new names
The licenses were renamed to match their SPDX names, fix the
references in LIC_FILES_CHKSUM in OE-Core.

(From OE-Core rev: 9af48917cfe583d2db9e1e088c7e396fcf638949)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-21 22:01:28 +00:00
Bruce Ashfield
b866a973ac make-mod-scripts: add HOSTCXX definitions and gmp-native dependency
With kernel v5.8+ and gcc10 plugins, we can run into the following build error:

      HOSTCXX -fPIC scripts/gcc-plugins/arm_ssp_per_task_plugin.o
    In file included from
    /home/pokybuild/yocto-worker/qemuarm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/make-mod-scripts/1.0-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/10.1.0/plugin/include/gcc-plugin.h:28,
                     from
    /home/pokybuild/yocto-worker/qemuarm/build/build/tmp/work-shared/qemuarm/kernel-source/scripts/gcc-plugins/gcc-common.h:7,
                     from
    /home/pokybuild/yocto-worker/qemuarm/build/build/tmp/work-shared/qemuarm/kernel-source/scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3:
    /home/pokybuild/yocto-worker/qemuarm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/make-mod-scripts/1.0-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/10.1.0/plugin/include/system.h:687:10:
    fatal error: gmp.h: No such file or directory
      687 | #include <gmp.h>
          |          ^~~~~~~

(From OE-Core rev: cb055446e0fe4771c8bd6122e79d43ef8db2e45b)

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
Khem Raj
e3bb371e2d make-mod-scripts: Fix a rare build race condition
There is a build break which rarely happens but is seen often enough
with 4.1 kernel based builds

/bin/sh: 1: scripts/basic/fixdep: Permission denied
scripts/Makefile.host:124: recipe for target 'scripts/dtc/srcpos.o' failed
make[3]: *** [scripts/dtc/srcpos.o] Error 126

this patch sequences the build targets so it can work reliably with
different kernel versions

Divide the target into scripts_basic scripts is not
strictly necessary and was simply what was used for
testing on kernel 4.1, which is quite an old kernel

perhaps just using scripts is sufficient, but it is not tested to not
known will cause the build race as seen above.

(From OE-Core rev: 55ac6e2d251287419138931aa0d0894cf1267787)

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>
2020-05-30 12:32:48 +01:00
zhengruoqin
282b57bae0 make-mod-scripts: Fix dependence error.
Error:
 Problem: conflicting requests
  - nothing provides make-mod-scripts = 1.0-r0 needed by
make-mod-scripts-dev-1.0-r0

(From OE-Core rev: 8aef2bcc2bed261098c45f77e5706d9460d1290c)

Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-19 22:57:26 +01:00
Robert Yang
ce107dc8af make-mod-scripts: Depends on bison-native
Fixed do_configure error when use linux-dummy:
PREFERRED_PROVIDER_virtual/kernel = "linux-dummy"

/bin/sh: bison: command not found

Build make-mod-scripts doesn't make sense when use linux-dummy, but it breaks
"bitbake world", so add bison-native to DEPENDS to fix the problem.

(From OE-Core rev: 4301d533512669834282a6ba43ae8e266a79fe22)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-21 00:33:23 +01:00
Richard Purdie
0f85563eac make-mod-scripts/kernel-devsrc: Fix objtool issues
Kernels which use tools/objtool can now fail when building external modules
due to objtool being missing, the generated files can also cause problems
for kernel-devsrc.

Ensure objtool is generated in make-mod-scripts by also calling
"make prepare".

For devsrc, delete the generated binaries since they'd be native
binaries and unsuitable for the target.

The oeqa kernel module tests also need to have the additional "make prepare"
step added.

(From OE-Core rev: 52fd2993784b4218f5df4f343e7da45d964df305)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-30 00:31:18 +01:00
Ross Burton
a5c274b451 meta: remove some EXCLUDE_FROM_WORLD assignments
Now that we have recipe-specific-sysroots we don't need to exclude recipes from
world builds because they conflict with other recipes, as they'll all be built
with their own sysroots.

(From OE-Core rev: b2f3ac4d994a1921791f6bd0cdb3591586733694)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-15 06:27:19 -07:00
Bruce Ashfield
dfb9ffbafd make-mod-scripts: add build requirements for external modules
Newer kernels (4.14/v4.15+) have dependencies for the build of
modules (and hence external modules). Without these dependencies
explicitly in the build chain, you can end up with build failures like:

  work-shared/qemux86/kernel-source/scripts/extract-cert.c:21:25: fatal
  error: openssl/bio.h: No such file or directory
  |  #include <openssl/bio.h>
  |                          ^
  | compilation terminated.
  | make[2]: *** [scripts/extract-cert] Error 1
  | make[1]: *** [scripts] Error 2

To ensure that these headers are in place, and that the scripts use
our build environment flags, we add a dependency on openssl-native
and use oe_make to invoke the build.

Older kernels have no issues with the extra dependency, so there's no
need to make this conditional.

(From OE-Core rev: 916cb2029d3c97bf12ebf03832b9ba980451dbcf)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:44 +00:00
Joe Slater
bb5a8acd65 make-mod-scripts: change how some kernel module tools are built
Remove do_make_scripts() from module-base.bbclass and put
functionality in a recipe.  This will build the scripts only
once instead of each time an external module is built.

[YOCTO #12228]

(From OE-Core rev: ea12c46fe8748fb6606c603d463075a8624e6563)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:44 +00:00