Commit Graph

376 Commits

Author SHA1 Message Date
Richard Purdie
c917323a39 classes/recipes: Switch to use inherit_defer
Now that bitbake supports the use of inherit_defer, switch all conditional
(variable based) inherits to use this instead. This leads to more a more
deterministic user experience since there is no longer an immediate expansion
and later changes to the variables in question (e.g. a bbappend) are
accounted for.

This patch tries to ensure the behaviour before/after remains as unchanged
as it reasonably can, e.g. by always inherting populate_sdk_base. native
and nativesdk continue to need to be inherited last, hence being used
with inherit_defer in a handful of very specific cases.

(From OE-Core rev: 451363438d38bd4552d5bcec4a92332f5819a5d4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-18 10:15:58 +00:00
Richard Purdie
bc883e4991 rootfs-postcommands: Try and improve ordering constraints
The current code is in race to see who can set things last. This isn't scalable or
sustainable and problemtic in the face of inherit ordering changes.

Move the ordering issue into the actual code execution, which isn't ideal but
the best of several bad options and at least lets us drop the anonymous python.

(From OE-Core rev: 0ffff2c1f80a9b79b133d787764bab164d9abd70)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-18 10:15:58 +00:00
Richard Purdie
12619deabd rootfs: Fix MULTILIB_RE_ALLOW to be inherit order independent
This variable is only used by the ipk backend with multilibs.

In order to make it work correctly regardless of inherit order, change
the string to be space delimeted, set using += and add in the regex '|'
sperator at the end of processing.

(From OE-Core rev: 72befdb12568fbc642022ef0a23b269c5b37a638)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-18 10:15:58 +00:00
Richard Purdie
55eaa3eb3f allarch: Fix allarch corner case
Most of the allarch code is conditional and only set if the recipe remains marked
as allarch. The qemu wrapper handling is not handled in the same way however and
is unconditional.

Move the code to some slightly uglier inline python to allow it to be conditional
and match the way the rest of the code works.

(From OE-Core rev: dfd704f1741dccd9a85338c5d45dee4be079064d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-18 10:15:58 +00:00
Etienne Cordonnier
90ea98a24c siteinfo.bbclass: add support for darwin19 and darwin21
Ported from the meta-darwin layer which supports darwin19 (honister version)
and darwin21 (kirkstone version).

(From OE-Core rev: ec4de080691717bf56170f7e39d9fb5bb2d2b2d6)

Signed-off-by: Dominik Schnitzer <dominik@snap.com>
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-15 21:42:15 +00:00
Ross Burton
dda251dfc2 xmlcatalog: limit to native recipes only
The sysroot postinst is explicitly native-only, so use more overrides to
ensure that we don't try to run them outside of native recipes.

Also add a comment so this doesn't get forgotten again, and link to the
related bug.

(From OE-Core rev: 38a5fc5dbb33fd3314f0a98c861a842342add064)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-12 11:54:05 +00:00
Ross Burton
ac6fb1aa6a meson: use pkg-config in the cross files
>From Meson 1.3.0, the "pkgconfig" entry is deprecated and "pkg-config"
should be used instead[1].

[1] https://mesonbuild.com/Release-notes-for-1-3-0.html#machine-files-pkgconfig-field-deprecated-and-replaced-by-pkgconfig

(From OE-Core rev: d64b307891422e290bbe821d4303b3af526bbe17)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-12 11:54:05 +00:00
Ross Burton
2c8e3a3b83 gtk-doc: don't manually call gtkdocize
The autoreconf call will now call gtkdocize if needed, so we don't need
to run it manually here.

This obsoletes GTKDOC_DOCDIR.  If this is needed then the replacement is
to ensure that the configure.ac has a call to GTK_DOC_CHECK which passes
--docdir.

For example, this is the change required for kmod:

-GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
+GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat --docdir libkmod/docs])

(From OE-Core rev: 57b0201bfccb4552893d72dc4d76eaa855618563)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-12 11:54:05 +00:00
Ross Burton
614b228d0a gtk-doc: remove obsolete logic
This manual disabling of gtk-doc for autotools and meson in native and
nativesdk builds is replicating logic above for target builds.

Instead, use one assignment for all builds, as we explicitly disable
gtk-doc in native builds and it can be useful in nativesdk.

(From OE-Core rev: e13b019c61d86f1add32f23795f6e71110c6a70c)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-12 11:54:05 +00:00
Ross Burton
3dc895804f autotools: don't exclude gtkdocize
gtkdocize can now be ran successfully from autoreconf, so there's no
need to exclude it and run it manually.

(From OE-Core rev: 891ec38d4c5cc5ac7bc34938276261ebd6f6d54e)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-12 11:54:05 +00:00
Ross Burton
3c72b2d711 autotools: append to EXTRA_AUTORECONF
Inherit order may mean that this class is inherited after assignments,
so extend instead of assign EXTRA_AUTORECONF.

(From OE-Core rev: 83958b4bdea90a0bb9331d33c2f266900a108fee)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-12 11:54:05 +00:00
Ming Liu
0d93308425 qemu.bbclass: fix a python TypeError
QEMU_OPTIONS can be empty which will trigger a exception TypeError:
| can only concatenate str (not "NoneType") to str. Fix it by setting a
empty string.

ALso removed two useless blanks.

(From OE-Core rev: b619197bd52a4a99a9989e7ea6fb7032415b1e42)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-09 22:59:28 +00:00
Robert Berger
23549b87c5 uninative-tarball.xz - reproducibility fix
added --clamp-mtime --mtime to the tar command

see:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15148

(From OE-Core rev: 2ef7c63871ab4fb62a9cea45a23a78bf9d541e4a)

Signed-off-by: Robert Berger <Robert.Berger@ReliableEmbeddedSystems.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-24 10:39:06 +00:00
Ludovic Jozeau
7608ad08ae image-live.bbclass: LIVE_ROOTFS_TYPE support compression
The task for fstypes with compression is the same as the task for the
uncompressed fstypes, e.g. when adding tar.xz to `IMAGE_FSTYPES`, it will
be included into the do_image_tar task and not creating a separate
do_image_tar.xz task.

This commit fixes `LIVE_ROOTFS_TYPE` with compressed fstypes by
depending on the actual task instead of the non-existent
do_image_<fstype>.<compression> task.

Fixes [YOCTO #15331]

(From OE-Core rev: 67c507e3d42e52a6d452c4a453eeaf7f2e2d68d6)

Signed-off-by: Ludovic Jozeau <ludovic.jozeau@smile.fr>
Reviewed-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-23 08:46:00 +00:00
Ross Burton
64162b1812 nativesdk: don't unset MACHINE_FEATURES, let machine-sdk/ set it
There is actually a use for nativesdk MACHINE_FEATURES; for example
qemu-usermode being supported, as this is needed to build profile-guided
optimised code.

We shouldn't use the target MACHINE_FEATURES for this because the target
and the SDK can be entirely different, so instead set the
MACHINE_FEATURES in nativesdk.bbclass to SDK_MACHINE_FEATURES (which
defaults to "") and let the conf/machine-sdk/*.conf files set that as
appropriate.

(From OE-Core rev: 14571764b7e046507f81bbe589a9f42c5b16665a)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Link: https://lore.kernel.org/r/20231221170159.1995650-2-ross.burton@arm.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-23 08:46:00 +00:00
Ross Burton
60ce68180a nativesdk: ensure features don't get backfilled
nativesdk aims to run in a slightly different environment than the
target build, so it resets MACHINE_FEATURES and filters DISTRO_FEATURES
with DISTRO_FEATURES_NATIVESDK.

However, feature backfill happens _after_ these operations:

 $ bitbake-getvar -r nativesdk-glib-2.0 MACHINE_FEATURES
 #
 # $MACHINE_FEATURES [5 operations]
 #   set /home/ross/Yocto/poky/meta/conf/machine/include/qemu.inc:14
 #     "alsa bluetooth usbgadget screen vfat"
 #   set /home/ross/Yocto/poky/meta/conf/documentation.conf:284
 #     [doc] "Specifies the list of hardware features the MACHINE supports."
 #   set? /home/ross/Yocto/poky/meta/conf/bitbake.conf:893
 #     ""
 #   set /home/ross/Yocto/poky/meta/classes-recipe/nativesdk.bbclass:18
 #     ""
 #   append utils.py:132 [features_backfill]
 #     " rtc qemu-usermode"
 # pre-expansion value:
 #   " rtc qemu-usermode"
 MACHINE_FEATURES=" rtc qemu-usermode"

This is not intentional nor desired as the target machine features are
unrelated to the nativesdk environment.

(From OE-Core rev: f560ac0a5ccced02b84df337f0f26209cd4b6474)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Link: https://lore.kernel.org/r/20231221170159.1995650-1-ross.burton@arm.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-23 08:46:00 +00:00
Joshua Watt
df548e981d ipk: Switch to using zstd compression
Converts IPK package generation to use zstd instead of xz. zstd has a
much larger compression/speed tradeoff range allowing users to choose
what suits them best, and fast decompression speeds. It also continues
to support parallel compression as xz did.

A new variable called ZSTD_DEFAULTS is provided to set the defaults for
places that want to use zstd for compression; the zst image conversion
command is also modified to use this.

Finally, in order for this to function properly, opkg must include zstd
support, so it is enabled all the time with no PACKAGECONFIG to turn it
off.

(From OE-Core rev: 1bc3e9bbaa670b6128c74c76b4b5264e60ce3463)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-23 08:46:00 +00:00
Richard Purdie
08369812c1 testimage: Drop target_dumper and most of monitor_dumper
The target_dumper code is basically broken. It has been reading binary files
over the text base serial communication and runs at every command failure which
makes no sense. Each run might overwrite files from the previous run and the
output appears corrupted due to confusion from the binary data.

For now, remove the commands and the target dumper code as the command
and execution point are problematic. Also remove the same pieces of the monitor
code but leave the command list since in theory this can be moved to a more
useful place in the code.

(From OE-Core rev: a24d787987dccc95fdd95b7e85bf525a1c55b285)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20 07:47:00 +00:00
Richard Purdie
038d364992 testimage: Exclude wtmp from target-dumper commands
wtmp is filled with binary data which the run_serial command can't cope with.
Catting this results in confusion of the serial interface and potentially large
backlogs of data in the buffers which can hang qemu.

Exclude the problematic files from the command.

(From OE-Core rev: 599ac08a6f6fb3f6a89a897c8e06367c63c2f979)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20 07:47:00 +00:00
Tim Orling
ca5427280d classes-recipe: add python_maturin.bbclass
maturin is a replacement for setuptools_rust and another "backend" for
building python wheels.

(From OE-Core rev: 1c2f9d8f18ef8154573142638ca10a8f88e43419)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17 19:07:21 +00:00
Adrian Freihofer
d7c05e4eed cmake-qemu.bbclass: make it more usable
Make the cmake-qemu.bbclass more usable:
- Drop the CMAKE_EXEWRAPPER_ENABLED variable (which does not make much
  sense without the second commit of the original patch series).
- Inherit qemu to make the cmake-qemu a drop in replacement for cmake.

(From OE-Core rev: 5cb05ca6542aa6239e0371dd9df4705b168d245e)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:58:15 +00:00
Alex Kiernan
6543d3c5e9 cargo: Add CARGO_LOCK_PATH for path to Cargo.lock
When building a workspace enabled project, the Cargo.lock is found at
the root of the project, not alongside the Cargo.toml. Expose
CARGO_LOCK_PATH so it can be explicitly configured.

(From OE-Core rev: 30159f88a97c73d234f69c5800ba2adb0e26ad44)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Alex Kiernan
dddfe1e3f4 rust: cargo: Convert single-valued variables to weak defaults
All of these variables are single-valued, so we can use weak-defaults
for them and only see the final assignment after parsing.

(From OE-Core rev: 3221e82a35a149fdf38fe66dcd5de758ac1b9185)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Alex Kiernan
43df94f7af cargo: Move CARGO_MANIFEST_PATH/CARGO_SRC_DIR to cargo_common
cargo_common_do_configure uses CARGO_MANIFEST_PATH (which depends on
CARGO_SRC_DIR), but their definition was in cargo.bbclass.

(From OE-Core rev: 740374a13ad5359767b421666decf50c158ea0df)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Alex Kiernan
a8f959a8d3 cargo: Rename MANIFEST_PATH -> CARGO_MANIFEST_PATH
This variable is a piece of recipe configurable interface, scope it with
the class name to make that clear.

(From OE-Core rev: 0101de25832fbed3d08cd522512784133c628cad)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 16:58:34 +00:00
Khem Raj
c55cb443d0 rust-common.bbclass: Define rust arch for x32 platforms
(From OE-Core rev: 02d6c89ca2e72e95d093282f5626e607060da588)

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>
2023-12-02 17:18:57 +00:00
Adrian Freihofer
0746299278 cmake-qemu.bbclass: support qemu for cmake
Define the CMAKE_CROSSCOMPILING_EMULATOR variable similar to what the
meson bbclass does. This allows for example to execute cross compilied
unit tests on the build machine when using an SDK.

CMAKE_CROSSCOMPILING_EMULATOR is a semi colon separated list of
paramters which could directly handle the -L and the -E parameters.
Creating a wrapper script is not absolutely mandatory. But anyway lets
do it similar to what the meson.bbclass does and also disable pseudo.

Further information can be found in the camke documentation in the
CMAKE_CROSSCOMPILING_EMULATOR section.

Keep the code optional, as the core does not need this function and does
not intend to use it in the future.

[YOCTO #15214]

(From OE-Core rev: b197d0b0de1fa5f295d32dbda2eb815ca0153299)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-30 08:43:03 +00:00
Javier Tia
cbdc226a99 kernel-arch: use ccache only for compiler
Attempting to use it with other tools is not beneficial, only with the
compiler. Confirmation from ccache's maintainer [1].

[1] https://github.com/ccache/ccache/discussions/1346#discussioncomment-7616180

(From OE-Core rev: 47fa8d81083f1ef594f8fe6fcab3e227e9607b3f)

Signed-off-by: Javier Tia <javier.tia@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-22 14:08:48 +00:00
Martin Jansa
d7a8a51cf5 rust: drop PE, PR from /usr/src/debug paths
(From OE-Core rev: e4931b1d6f147fc7ced080e30c63f0aaf0d1e7ff)

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-20 15:30:53 +00:00
Richard Purdie
0769e8ef6b bitbake.conf: Drop oldincludedir
Autoconf defines this as:

"The directory for installing C header files for non-GCC compilers."

Whilst this is something autoconf does allow changing, I find it hard
to believe it has much use in the wild now and that headers don't get
split like this in reality, it would probably only be useful on really
old unixes.. The values are the same in our configuration anyway.

Drop the value and just use includedir everywhere.

(From OE-Core rev: 506c91cbc6a604a84e37e53ccff430436369802e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-20 15:30:52 +00:00
Stefan Herbrechtsmeier
9b8c59b165 classes: go-mod: do not pack go mod cache
Clean go module cache from builddir to prevent it of beeing packed.

(From OE-Core rev: 328bea56dec8f83b5c118f567e122510f9243087)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-20 15:30:52 +00:00
Joakim Tjernlund
a2ea2cb8d9 sed -i destroys symlinks
If /etc/passwd is a symlink, sed -i on same file will replace the
symlink with a new file. Prevent that by adding --follow-symlinks
option to sed

(From OE-Core rev: 6ec004b2e7b4342465af8e5e6cc66041834821a0)

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-20 15:30:52 +00:00
Markus Volk
d217ca41bf gnomebase.bbclass: Use meson as default buildsystem
The vast majority of gnome recipes uses meson. Set it as default
and override the few recipes that still use autotools.

This way we can remove a lot of lines in meta-oe and more important
it would not be needed to explicitly set GNOMEBASEBUILDCLASS = "meson" for newly
created gnome recipe anymore.

(From OE-Core rev: 8b061ea36f8b94b482c5867fe2ba7213288a5aa3)

Signed-off-by: Markus Volk <f_l_k@t-online.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-13 11:38:03 +00:00
Bruce Ashfield
d6b37f2230 kernel-yocto: improve metadata patching
The ability to patch the kernel-yocto metadata was added to support
debug and easier test cycles on kernel-cache provided fragments. As
such, it was very simple and has limited functionality.

That being said, it is an available feature and can be improved to
handle patches that fail to apply.

The main kernel patching is already handled by the kern-tools, so
we extend the patching of the meta-data to same tools and inherit
more functinality from the scripts.

[YOCTO #15266]

(From OE-Core rev: e867addd6c2f508f7a95e72222e750d37f3d19d8)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-09 16:57:26 +00:00
Alexander Kanavin
e946b17cf1 populate_sdk_ext: split copy_buildsystem() into logical steps defined as functions
copy_buildsystem() has become far too large and needs to be split
into shorter and more understandable pieces; some of those
pieces will be reused for the purpose of providing esdk mode
directly from a plain yocto build.

(From OE-Core rev: a163b8f339f32bc9e3865736af321190bc89c61b)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-08 11:00:09 +00:00
Dmitry Baryshkov
33477e1bbe meson: use correct targets for rust binaries
Follow the example of rust and cargo classes and pass RUST_HOST_SYS and
RUST_BUILD_SYS to rustc's --target argument instead of bare HOST_SYS and
BUILD_SYS.

(From OE-Core rev: 1471c6c076f544ccd6f0722c82878311199881a7)

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-06 16:49:21 +00:00
Dmitry Baryshkov
39aecc8b3e kernel-arch: drop CCACHE from KERNEL_STRIP definition
Building linux-yocto with ccache enabled results in the 'command not
found' error, because kernel-yocto.bbclass passes the KERNEL_STRIP
as a single value, whic is then interpreted as a command name.

ERROR: Fatal errors occurred in subprocesses:
[Errno 2] No such file or directory: 'ccache aarch64-linaro-linux-strip': Traceback (most recent call last):
  File "/home/lumag/Projects/RPB/build-rpb/conf/../../layers/openembedded-core/meta/lib/oe/utils.py", line 288, in run
    ret = self._target(*self._args, **self._kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Fixes: 03973c8c1c93 ("kernel: Add kernel specific STRIP variable")
(From OE-Core rev: 41f019afc41f800b622c46a6d7cf1beffc97716a)

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-05 11:28:35 +00:00
Niko Mauno
b1116c8102 image_types.bbclass: Use xz default compression preset level
Commit ef0654f145
("Set XZ_COMPRESSION_LEVEL to -9") changed the xz compression preset
level from previous value of -3 to -9. The commit message explains that
the change was made in order to be consistent with other compressors
that also use their best compression. However looking at xz man page,
under the compression preset level selection chapter there is mentioned
that

  The  differences  between  the  presets  are more significant than with gzip(1) and
  bzip2(1).  The selected compression settings determine the memory  requirements  of
  the  decompressor,  thus  using  a  too  high preset level might make it painful to
  decompress the file on an old system with little RAM.   Specifically,  it's  not  a
  good  idea  to  blindly  use  -9  for  everything like it often is with gzip(1) and
  bzip2(1).

which is then followed by a table, which mentions that the decompressor
memory requirement for preset -9 is 65 MiB, whereas for xz default
preset -6 it is just 9 MiB. Given that the use case where a device
running a Yocto generated Linux OS decompresses an ext4 root filesystem
image to non-volatile memory as part of firmware upgrade process is not
far-fetched, and considering that a range of these devices can run low
on available RAM when there are other applications running at the same
time, the lower decompressor memory requirement of the default preset
level makes sense in order to prevent an OOM situation from occurring.

This change was tested on a 32 CPU core build host with 128 GB RAM by
issuing

  $ bitbake -c cleansstate core-image-minimal core-image-sato
  $ time bitbake core-image-minimal
  $ time bitbake core-image-sato

With MACHINE="qemux86-64" and IMAGE_FSTYPES="ext4 ext4.xz" using
XZ_COMPRESSION_LEVEL values "-6" and "-9". In both cases the resulting
'ext4' image size remained same, 38141952 bytes for core-image-minimal,
and 565043200 bytes for core-image-sato.

The observation was that with this change there is a small increase in
the resulting 'ext4.xz' file size, and a build speed improvement that
was significant for larger rootfs image.

core-image  XZ  real time    time delta	   ext4.xz size      size delta
-----------------------------------------------------------------------
minimal     -9  0m44.992s                      15932508
minimal     -6  0m42.445s        -5.66%        16243484         +1.95%
sato        -9  2m40.828s                      85080416
sato        -6  1m38.891s       -38.51%        87447456         +2.78%

Regarding decompression speed, issuing following command in qemux86-64
target OS

  $ time xz -dkc --memlimit=MEMLIMIT core-image-sato-qemux86-64.rootfs.ext4.xz > /dev/null

using the lowest accepted value for MEMLIMIT for each case (providing a
lower value caused xz to exit with 'Memory usage limit reached' error)
showed that decompression time saw a minuscule improvement with the -6
compression preset level:

XZ   MEMLIMIT   real time
-------------------------
-9        65M    0m43.83s
-6         9M    0m43.28s

(In the above tables, XZ refers to XZ_COMPRESSION_LEVEL value used when
images were generated with Yocto).

(From OE-Core rev: 9ca62e24a6a0f5d2778b2b587646df7447e3c65f)

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-05 11:28:30 +00:00
Alexander Kanavin
81a400a8f5 scripts/esdk-tools: use a dedicated, static directory for esdk tools
This allows easier replication of esdk environment (which provides
a curated, limited set of tools that for example does not include bitbake)
in a standard yocto build. Switchover between various sets can be achieved
via PATH manipulation.

(From OE-Core rev: 20c548f2edca3888152adb63de7b23d84e3848e7)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-05 08:44:06 +00:00
Alexander Kanavin
c7bd942988 populate_sdk_ext.bbclass: do not symlink unfsd from sdk image sysroot into eSDK tools path
This was done in 2016 to support Eclipse plugin (long dead),
it's currently broken as image sysroot is not in the SDK
until the image is built in that context, and current tools
all rely on runqemu-export-rootfs which does not rely on PATH
and runs unfsd with full path to recipe-specific sysroots.

(From OE-Core rev: 0f1361061c8c0b16ea2b50349b08a3b03140c45c)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-05 08:44:06 +00:00
Chen Qi
57e3f6ff28 kernel.bbclass: add preceding space in appendVar setting
The appendVar setting should have a preceding space, otherwise, when
KERNEL_MODULE_SPLIT is set to "0", we'll sometimes get dependency error
due to lacking of space.

(From OE-Core rev: 266cd948d4aa68de34075e8ed6299f7d80d19346)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-30 17:12:19 +00:00
William A. Kennington III
070582a248 kernel: Commit without running hooks
The hooks are pulled from the impure environment and are often broken in
our environments. There is no reason to add extra metadata or verify the
commit message as its arbitrary to turn the tarball into a git repo.

(From OE-Core rev: dd52102a6c3f69d156bfcf85827123c96f18d5a1)

Signed-off-by: William A. Kennington III <wak@google.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-30 08:50:46 +00:00
Max Krummenacher
50c57ee367 Revert "bin_package.bbclass: Inhibit the default dependencies"
This reverts commit d1d09bd4d7be88f0e341d5fccbfbefeb98d4b727.

The commit not only removes the dependencies on the cross compiler
but also does not depend on e.g. virtual/${TARGET_PREFIX}compilerlibs
and virtual/libc which in turn makes the file-rdeps qa check fail
if installing binaries linked against e.g. libc or libstdc++.

(From OE-Core rev: ababf6ceebe360c5f59a57428566c27b7a97a9e6)

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-30 08:50:46 +00:00
Khem Raj
aedce97caa kernel.bbclass: Use strip utility used for kernel build in do_package
os.environ does not pass this down to runstrip() function and in
strip_execs() its using STRIP bitbake variable to find the strip utility
to use. Since there might be a trailing whitespace in KERNEL_STRIP
remove that otherwise python is not able to launch it.
e.g.

FileNotFoundError: [Errno 2] No such file or directory: 'riscv64-yoe-linux-strip '

This is more evident when STRIP and KERNEL_STRIP are different utilities
e.g. when using clang as default toolchain but using gcc+binutils only for
kernel build.

(From OE-Core rev: 77497dbdca92ab4d6386a071bc281c42a7e8a14b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-27 08:28:38 +01:00
Marcus Folkesson
37dc9faae0 qemuboot.bbclass: fix typos in documentation
comand -> command
docuemntation -> documentation

(From OE-Core rev: 302228fb858384a7ef4e46ecae80d1ebbc00f1a7)

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-23 10:49:19 +01:00
Joshua Watt
70eddc70f8 goarch: Move Go architecture mapping to a library
Other spaces uses the Go architecture definitions as their own (for
example, container arches are defined to be Go arches). To make it
easier for other places to use this mapping, move the code that does the
translation of OpenEmbedded arches to Go arches to a library.

(From OE-Core rev: 3e86f72fc2e1cc2e5ea4b4499722d736941167ce)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-19 13:26:05 +01:00
Ross Burton
a4857688c3 qemuboot: reduce default size of software I/O translation buffer
With 6.5+ (specifically, if DMA_BOUNCE_UNALIGNED_KMALLOC is set) the
SWIOTLB is used, and it defaults to 64MB. This is too much when there's
only 256MB of RAM, so request 0 slabs and lets the kernel round up to
the appropriate minimum (1MB on aarch64, typically). In virtual hardware
there's very little need for these bounce buffers, so the 64MB would be
mostly wasted.

(From OE-Core rev: 369e768d87b80be9efe76937bfafeddabc35f559)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-09 15:51:13 +01:00
Peter Kjellerstedt
68b54a02d5 cmake.bbclass: Add *.cmake to CONFIGURE_FILES
This makes do_configure depend on changes to any cmake file when
externalsrc is active.

(From OE-Core rev: dae2757bf0fea6ae821a28bd6ea9d0232694c177)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-09 15:51:13 +01:00
Peter Kjellerstedt
23f4bb7710 autotools.bbclass: Add *.m4 to CONFIGURE_FILES
This makes do_configure depend on changes to any m4 file when
externalsrc is active.

(From OE-Core rev: 492559191943c9e2666c3dda1824c5aafbe487d5)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-06 11:51:11 +01:00
Quentin Schulz
8d8c9078c6 uboot-extlinux-config.bbclass: fix missed override syntax migration
uboot-extlinux-config allows to specify multiple "labels" (entries in a
menu, à-la grub) and each of them have their own values for some fields.
Each "base" variable, e.g. UBOOT_EXTLINUX_FDT can be overridden for each
label. This is done via the OVERRIDES mechanism based on the label name,
e.g. UBOOT_EXTLINUX_FDT:linux if linux is a label.

However, OVERRIDES doesn't contain the label globally because it's only
necessary in one task. Therefore, the OVERRIDES itself is modified
within the task. This means that the sigdata will not be told the
dependency on UBOOT_EXTLINUX_FDT:linux, because it cannot know about it.

For this reason, we need to explicitly specify which variables this task
depends on via vardeps varflag for the task.

This was done in the past, but we missed updating it during the override
syntax migration so the cache wouldn't get invalidated if someone
modifies UBOOT_EXTLINUX_FDT:linux from a configuration file or a
bbappend for example.

Let's fix this by migrating it to the new syntax.

(From OE-Core rev: b4dd9d873508128adbbf5ff6cf0a3df3d2ffbcf6)

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-05 21:09:10 +01:00