Commit Graph

3907 Commits

Author SHA1 Message Date
Hongxu Jia
5c8705b483 script/relocate_sdk.py: check dynamic loader arch before relocating interpreter
While multiple dynamic loader existed, in order to make executable file is
interpreted by the expected dynamic loader, relocating interpreter only if
the new dynamic loader and executable file have the same arch

[ YOCTO #15722 ]

(From OE-Core rev: 0c1f2bf3d8e31e66d28aaa81a7c1658f160bb79e)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 11:44:19 +00:00
Richard Purdie
a24b178666 oe-build-perf-report: Use commit_time if available
Currently, the perf report charts use start_time which is when the build
is run. If running builds for commits in the past, this is inaccurate so
switch to using the recently added commit_time if the field is present.
Over time, the reports will switch to using the more accurate values.

(From OE-Core rev: 8c22efd444b0b1486c43f01b41cba891a47c7520)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-11 11:44:19 +00:00
Quentin Schulz
31a537d124 b4-wrapper-poky.py: send changes to .b4-config to the poky mailing list
Both OE-Core and poky git repos have a .b4-config, both at the same
location and both different.

Therefore, changes made to .b4-config for OE-Core need to be sent to the
OE-Core mailing list and changes made to .b4-config for poky sent to the
poky mailing list.

Changes made to OE-Core's .b4-config can only be made from a vanilla
OE-Core git repo, not from poky git repo. With the current content of
OE-Core's .b4-config, b4-wrapper-poky.py script is NOT called to figure
out where to send patches, b4 gets it from the hardcoded value in
send-series-to.

Thus, we can say that if b4-wrapper-poky.py detects changes for
.b4-config, those changes are for poky since this script wouldn't be run
by b4 outside of poky git repo.

(From OE-Core rev: 1006712027812326fdeade2ab539b42bdf5b10e6)

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-10 13:03:58 +00:00
Igor Opaniuk
10870db533 wic: bootimg-efi: Support + symbol in filenames
Allow the '+' symbol as a valid character in filenames listed in the
IMAGE_EFI_BOOT_FILES variable.

The '+' symbol might be used to support boot counting for boot entries,
as described in the UAPI Boot Loader Specification [1]:

The boot counting data is stored in the name of the boot loader entry.
A boot loader entry file name may contain a plus (+) followed by a
number. This may optionally be followed by a minus (-)
followed by a second number. The dot (.) and file name suffix
(conf or efi) must immediately follow.
Boot counting is enabled for entries which match this pattern.

Example:
IMAGE_EFI_BOOT_FILES:append = " entry.conf;loader/entries/entry+3.conf"

[1] https://uapi-group.org/specifications/specs/boot_loader_specification/#boot-counting
(From OE-Core rev: 3f25822281eb9423ff86105eaebb0bed48663648)

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-10 13:03:58 +00:00
Ninette Adhikari
9f31270600 scripts/buildperf: Add chart tabs for commit count/time
We triggered a test of an older revision to narrow down when performance
changed. The issue is that git's timestamps are granular to 1s. We'll
usually merge a set of commits at the same time so they will all have
the same timestamp for a block of them. This means that even if we use
the commit date, all the points can't be distinguished on the graph.
The author date doesn't work either as the commits are not merged in
author date order.

To solve this this patch adds the commit_count chart as a separate tab
next to the start_time chart

(From OE-Core rev: b263edd33f6c895238d81ef148c0445fcd0aa268)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-09 22:23:30 +00:00
Quentin Schulz
0698d606be scripts: add b4-wrapper for poky
poky is a combo-layer containing BitBake, OpenEmbedded-Core and Yocto
Documentation source code into one big repo. It is not uncommon to have
people develop patches for either of those projects from a poky git
repo.
However, it is unlikely those patches are to be sent to the poky mailing
list as very few files contained in the poky git repo actually are
poky-specific. So we need a way to identify to which mailing list a
patch is destined to be sent.
Additionally, because the source code in openembedded-core is
merged/imported at the root of the git repo of poky, its .b4-config
introduced in the previous commit will be used if not overridden (which
will be done in a separate commit specific to the poky git repo). We
need to provide a different .b4-config in poky.

Therefore, this wrapper is used to identify automatically which mailing
list a patch series needs to be sent to (via b4 prep --auto-to-cc) and
does some additional checks (via b4 prep --check) such as making sure a
patch doesn't modify two different projects at the same time or that
multiple projects are modified by different patches in the same patch
series.

This wrapper script is meant to be used by poky's .b4-config. Ideally
the b4 prep --check part could be offloaded to `patchtest` once it
supports running on source different from OE-Core.

Note that b4 makes sure that an address doesn't appear twice in the
recipient list. There's also no priority in the type of recipient list,
so if the address appears first in Cc and then in To, only the Cc will
be added. The opposite is true as well.

(From OE-Core rev: a1d629a0823cf724bda607ef8d88ee4f722c3a08)

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-06 10:40:10 +00:00
Bastian Germann
bdcc24a44f licenses: Map SGIv1 to SGI-OpenGL
SGI-1 is not a SPDX license identifier. However, the SGI-1 license has
the same license text as SGI-OpenGL. Map the old SGIv1 name to SGI-OpenGL.

(From OE-Core rev: e97a9c3c86a8fe27a26ad69174ba50e5228846e5)

Signed-off-by: Bastian Germann <bage@debian.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-05 12:49:55 +00:00
Chris Laplante
e85a3c8f2c devtool: standard: simplify get_staging_kver
The goal is to make this more Pythonic, as it was a little cryptic the
first time I looked at it.

(From OE-Core rev: 80285b0f9b716ebad87a2feb08f12f87d70c27e3)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-01 13:20:45 +00:00
Chris Laplante
b7327c7c28 devtool: standard: fix unbound variable usage
(From OE-Core rev: 90efa31f36eaea910b979c128da719e1ae61e00d)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-01 13:20:45 +00:00
Chris Laplante
d37380004c devtool: standard: fix typo in variable
(From OE-Core rev: 9b24dae60573c5e798f1a2f49338f3e4ecbe8859)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-01 13:20:45 +00:00
Chris Laplante
1923c62fee devtool: standard: cleanup imports; stop relying on transitive bb imports
(From OE-Core rev: 8457e24f60a9a84e0f1cfc4a28a39989534fa7de)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-01 13:20:45 +00:00
Adrian Freihofer
096dbb7992 devtool: ide-sdk remove the plugin from eSDK installer
The ide-sdk command bootstraps the SDK from the bitbake environment
before the IDE configuration is generated. In the case of the eSDK
installer, the bootstrapping is performed during the installation of
the eSDK installer. Running the ide-sdk plugin from an eSDK installer
based setup would require skipping the bootstrapping and probably taking
some other differences into account when generating the IDE
configurations.

This would be possible. But it will probably never be implemented, as
running devtool ide-sdk directly from the bitbake environment is much
more flexible.
Also, some of the recent improvements that have made it into the core
have the potential to make the eSDK installer obsolete at some point in
the future:
- bitbake-layers create-layers-setup replicates the layers
- bitbake-config-build replicates the build configuration
- The new sstate mirror features replicate the sstate
- bblock locks the sstate more flexible than the eSDK installer
- devtool ide-sdk bootstraps the SDK directly from the bitbake
  environment. The same environment-setup... file is provided with
  --mode=shared.
  The devtool modify based workflow is supported since always by devtool
  and also the default --mode of devtool ide-sdk.
These functions essentially cover what the eSDK installer does without
a need for the current implementation of the eSDK installer and the
populate_sdk_ext, which is hard to maintain and takes a lot of time to
build.
This means that instead of making the ide-sdk plugin compatible with the
eSDK installer, we should rather replace the current implementation of
the eSDK installer and populate_sdk_ext with an implementation that can
replicate a normal bitbake environment in a convenient way where the
ide-sdk plugin also just works without additional complexity.

(From OE-Core rev: 177aa72b37f2061ff3311ec5dbb33aa56a5ba006)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-20 13:38:59 +00:00
Adrian Freihofer
9059981930 devtool: build-sdk remove unused imports
These imports are not needed.

(From OE-Core rev: c0e9e35843004aaac5bdcc12fa1f6bf8d2da0abb)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-20 13:38:59 +00:00
Chris Laplante
8ce537f158 devtool: remove unused 'config' param from '_create_workspace' method
(From OE-Core rev: cc64a0c645338b5b2a5955951570e47c014f66ea)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-20 13:38:59 +00:00
Chris Laplante
b44cfce570 devtool: misc cleanups
1. Bad None comparison
2. Reliance on transitive includes in bb
3. Unbound 'ret' variable

(From OE-Core rev: 0966d04c740f11da41c342a2a2d160d9ec5f5d70)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-20 13:38:59 +00:00
Chris Laplante
8a46267032 devtool: un-globalize 'plugins' variable
It never had to be a global anyway

(From OE-Core rev: 2d5557f4f5d228e94bc7a55ae5fd72b70b5c93e4)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-20 13:38:59 +00:00
Chris Laplante
58e9a21c91 devtool: un-globalize 'config' variable
'read_workspace' can now access it via the 'context' that's passed in

(From OE-Core rev: bfc525f6fdc8990b312123ac22d93118322b4e34)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-20 13:38:59 +00:00
Chris Laplante
d466af6e92 devtool: un-globalize 'context' variable and convert it to a dataclass
Please excuse the usage of 'typing' slipping in here - it's just how
dataclasses work :/.

(From OE-Core rev: 207cdead039383780bd39adbaf2a17b679889c63)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-20 13:38:59 +00:00
Chris Laplante
bc2403dcdb devtool: un-globalize 'workspace' variable
(From OE-Core rev: 3d32e507588fc292bf0f656b26817aee407f2d7c)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-20 13:38:59 +00:00
Chris Laplante
e6503a7f38 devtool: un-globalize the 'basepath' variable
(From OE-Core rev: 8a73a384e9cbd7ecf3b6f05bfc28574784725801)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-20 13:38:59 +00:00
Stefan Gloor
25520303d9 wic: add documentation for existing options to help.py
Add wic kickstart help for undocumented options for part/partition and
bootloader command.

(From OE-Core rev: 59786183c41b93b49fe97926dd77904c8d66b356)

Signed-off-by: Stefan Gloor <code@stefan-gloor.ch>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-28 10:57:00 +00:00
Georgi, Tom
465872544e devtool: ide-sdk: check 'tools-debug' for gdbserver
Also check that 'tools-debug' is not set in
IMAGE_FEATURES to determine if gdbserver is missing.

(From OE-Core rev: 28a8b35826302a40e7bb49f4bd3213fe7026f480)

Signed-off-by: Georgi, Tom <tom.georgi@karlstorz.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-20 15:48:16 +00:00
Alexander Kanavin
1db6f52e72 oe-setup-build: raise exceptions on errors
Otherwise the tool simply prints what went wrong and exits without error,
which makes it impossible for tools like bitbake-setup to determine that
the requested operation did not succeed.

(From OE-Core rev: d44ab1c3abb25ef08307558430d76a47cde07cc1)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-18 11:11:55 +00:00
Justin Bronder
4593b142d5 scripts: wrap lz4c and convert to lz4
Commit fe167e082cbde1c6d186ecdda531abef610ac2ac switched to requiring
lz4 instead of lz4c which allows us to support distros dropping lz4c.
However, it wasn't only OE that was still using the legacy lz4c, there's
a number of upstreams as well.  For instance, it's only in the 6.13
kernel that CONFIG_KERNEL_LZ4 makes the switch from lz4c to lz4.

So, while this all gets ironed out, simply intercept calls to lz4c and
convert them to use lz4.  This was picked instead of adding lz4c to
HOSTTOOLS_NONFATAL due to concerns about builds becoming
non-deterministic and failing late:
https://lore.kernel.org/openembedded-core/9c3143ebb7f9e17cfbd318ef0e17994aae7264be.camel@linuxfoundation.org/

(From OE-Core rev: c10b94d82d10058a9e26f7d6919a0d6d721a7c75)

Signed-off-by: Justin Bronder <jsbronder@cold-front.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-17 11:41:53 +00:00
Adrian Freihofer
92a4abac54 devtool: ide-sdk recommend DEBUG_BUILD
The debug_build_config function was never called. Compiling with debug
optimized compiler flags was not working. Even with the
--debug-build-config flag set, the build configuration from the recipe
was used.

The devtool ide-sdk --debug-build-config approach didn't work very well
anyway. The problem is that changing the bbappend file doesn't work
while bitbake uses the bbappend file. As a workaround, it would be
possible to parse the recipe, get DEBUG_BUILD and the path to the append
file, exit tinfoil, change the bbappend file, reopen tinfoil and do what
ide-sdk is supposed to do. Such an implementation would be complicated
and slow.
Therefore, the code that was originally supposed to implement this is
removed from ide-sdk and the new --debug-build function of devtool
modify is used instead. Additionally, a hint should be given on how to
manually add DEBUG_BUILD = '1' to bbappend.

This is compatible with the VSCode Bitbake plug-in, which does not
support this parameter anyway.

(From OE-Core rev: 65950eb601c6c8aac0e4bc8683e544305346229d)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-17 11:41:53 +00:00
Adrian Freihofer
71acb3b781 devtool: ide-sdk sort cmake preset
Sort the keys of the generated CMakeUserPreset.json file to make it
easier to search and compare.

(From OE-Core rev: b886c26bf893878ba8eb6bee80dd0507e5cb0d2d)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-17 11:41:53 +00:00
Adrian Freihofer
1f7eb26c94 devtool: modify support debug-builds
Add a new option --debug-builds to automatically add DEBUG_BUILD = “1”
to the bbappend file of this recipe. This is especially useful when
invoking devtool modify before invoking devtool ide-sdk to perform a
remote debugging session.

(From OE-Core rev: fc17808799d2b667afbe4ea9837b66af70d47007)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-17 11:41:53 +00:00
Antonin Godard
3a737b4c63 scripts/install-buildtools: Update to 5.1.1
Update to the 5.1.1 release of the 5.1 series for buildtools.

(From OE-Core rev: 0b746655fcc133db563d791673484c4ca82cda8a)

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-13 12:26:01 +00:00
Ross Burton
30ffe589e4 scripts/devtool: use bb.util.listtasks instead of __BBTASKS
Don't access private variables, instead use the new bb.build.listtasks()
function (from bitbake 185c4b)

(From OE-Core rev: d31a7718c16bd26efd6e174cb5e97fb088aad4bd)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-12 13:31:27 +00:00
Aleksandar Nikolic
6074281e43 scripts/install-buildtools: preserve formatting in the help message
Use the RawTextHelpFormatter formatter to preserve formatting in the
argpars help message.

(From OE-Core rev: ee94d7f99ff3c7e922fdb502fabbda3fd0cd8700)

Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-09 15:23:28 +00:00
Richard Purdie
8d8c58372f resulttool/store: Fix permissions of logarchive
We want the results directory to be visable to other users, tweak the
permissions of the created directory to ensure this is the case.

(From OE-Core rev: ed9d887e8d71a800db19826264de552f7736dc6a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-26 13:40:30 +00:00
Aleksandar Nikolic
a43e6ab8c2 scripts/install-buildtools: Update to 5.1
Update to the 5.1 release of the 5.1 series for buildtools.

(From OE-Core rev: f6c1e5541ee8d215a0327263c9dd3f4cc128cd56)

Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-23 14:44:54 +00:00
Richard Purdie
aea9cb3e8e resulttool: Improve repo layout for oeselftest results
Having all oe-selftest results on top of each other results in a large 640MB
json file which is hard to use. Split the results out per machine and test type.

This also stops the toolchain raw logs from overwriting each other meaning more
than one MACHINE is preserved.

(From OE-Core rev: 4b890f04bc7d147b4a11b824a84f3d2abd75ac54)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-23 14:44:54 +00:00
Richard Purdie
41d39a2826 resulttool: Trim the precision of duration information
The duration values have pointless amounts of precision. Removing some of the
least significant digits reduces result size and makes the results easier to read.

(From OE-Core rev: a789a2e6d97bb8efd663226a17db8d1ca6c1e40f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-23 14:44:54 +00:00
Richard Purdie
fae3c13eb6 resulttool: Clean up repoducible build logs
We've improved the data stored for reproduicible builds. Teach resulttool how
to apply those cleanups when reprocessing data so we can reduce results file
sizes and make the data easier to process.

(From OE-Core rev: b799c57ae6d61c1b1c7035c8a2c4ba6ee08d1a81)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-23 14:44:54 +00:00
Richard Purdie
33a2d01430 resulttool: Handle ltp rawlogs as well as ptest
Improve the rawlogs handling to include ltp logs as well as the ptest ones to
reduce the size of the results git repos.

(From OE-Core rev: a0a1954d559609c2c1ca16936d0d68eb3c4c6b45)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-23 14:44:54 +00:00
Richard Purdie
589bd28e46 resulttool: Add --logfile-archive option to store mode
Storing the log files inside the testresults git repo isn't scaling and isn't
really appropriate use of a git repository. Allow these to be optionally stored
in a separate filesystem location so the git repo can remain managable.

(From OE-Core rev: 1afc0f3d7e93fa8496be241e9622d3b9a6904bd5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-23 14:44:54 +00:00
Richard Purdie
e948ab9035 resulttool: Fix passthrough of --all files in store mode
When using store mode, --all was broken as not all files were being preserved.
Fix this by limiting the scope of the git rm command.

(From OE-Core rev: 9604561d2022b6c76b1cb4186d40800d1affdd2b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-23 14:44:54 +00:00
Richard Purdie
9f57d44abe resulttool: Use single space indentation in json output
Using 4 space indentation in resulted in hundreds of megabytes of extra file size
in general use. Reduce this to make filesizes more managable and reduce the processing
cost. Some level of indentation and spacing does make the files more readable and allows
use of git diff so we need to retain some of it.

(From OE-Core rev: a274cdcaf852cca9497f0358f44dda99c06aacbe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-23 14:44:54 +00:00
Ross Burton
4336f06475 scripts/checklayer: check for SECURITY.md
Add a check for a SECURITY.md file (or similar) to yocto-check-layer, as
knowing where to report security issues is important.

(From OE-Core rev: c7cb22ac4ceed60f88452e83c907a4c4f33660e4)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-22 16:53:37 +00:00
Nicolas Dechesne
79ef781499 scripts: patchreview: fix failure when running from a different folder
When running patchreview with --blame, the scripts runs a git log
command on the analyzed patch. When trying to analyse a layer which is
not in poky tree, we might be running the git log command from outside
the git workspace where the file is located, which results in such
failures:

Missing Signed-off-by tag ([truncated]/meta-qcom-hwe/recipes-devtools/partition-utils/qcom-ptool/0001-ptool.py-Generate-zero-files-in-output-folder-when-s.patch)
fatal: not a git repository (or any parent up to mount point /local/mnt)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Fix this situation by setting the current work dir inside the git
workspace of the patch when running git log.

(From OE-Core rev: 8cc1c900b91d60e633f62bfe16a2ffc2d61c3f55)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@oss.qualcomm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-21 12:16:28 +00:00
Richard Purdie
f0d4814d4d resulttool: Allow store to filter to specific revisions
We have a challenge on the autobuilder where test results from both OE-Core
and poky are being mixed together during result storage which is confusing the
data. Add a way to filter to specific revisions as the least worst way to fix
the various issues this is causing.

(From OE-Core rev: 3f276a0dc65341668788853be2cf27ab6aa12b13)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-14 11:45:22 +00:00
Martin Jansa
6eb0a35580 patchreview: use check_upstream_status() from oe.qa
* the idea was to reuse the same function as I've noticed that the
  QA check which was added to insane.bbclass in:
  https://git.openembedded.org/openembedded-core/commit/?id=76a685bfcf927593eac67157762a53259089ea8a
  is in some cases more strcit than scripts/contrib/patchreview.py

  To be honest I wasn't aware of scripts/contrib/patchreview.py
  existence when I've asked about moving check_upstream_status()
  to oe.qa in order to write standalone script just like
  patchreview.py

* I've sent this long time ago:
  https://lists.openembedded.org/g/openembedded-core/message/177207
  but didn't like the sys.path.append to find oe.qa much or the
  duplicated path to .patch file in the output, then I've forgot about
  it until today in https://github.com/OE4T/meta-tegra/pull/1749
  where checklayer found one more issue, which I haven't noticed
  with patchreview.py before (because I've accidentally used a version
  without this change). It's not perfect, but at least it will be
  consistent with checklayer and patch-status QA check.

(From OE-Core rev: f291c08ea6a95638c3ad1f70434678bd5e374195)

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-12 11:19:44 +00:00
Vince Chang
6d90d0ba44 wic: add WIC_SECTOR_SIZE variable
Currently WIC is unable to generate images that requires a sector
size different of 512. Add WIC_SECTOR_SIZE variable to handle
the sector size of 4096 for UFS.

For "wic ls" command modify get_partitions() to support WIC_SECTOR_SIZE.

(From OE-Core rev: 2255f28b579bc5db4138bcacbb829661ae0ee721)

Signed-off-by: Vince Chang <vince_chang@aspeedtech.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-29 11:19:57 +00:00
Peter Marko
3b551fc466 cve-check: add support for cvss v4.0
https://nvd.nist.gov/general/news/cvss-v4-0-official-support

CVSS v4.0 was released in November 2023
NVD announced support for it in June 2024

Current stats are:
* cvss v4 provided, but also v3, so cve-check showed a value
sqlite> select count(*) from nvd where scorev4 != 0.0 and scorev3 != 0.0;
2069
* only cvss v4 provided, so cve-check did not show any
sqlite> select count(*) from nvd where scorev4 != 0.0 and scorev3 = 0.0;
260

(From OE-Core rev: 358dbfcd80ae1fa414d294c865dd293670c287f0)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-25 15:25:33 +01:00
Ross Burton
9dd8d5d6d2 buildstats-summary: look for buildstats if not specified
If the user hasn't specified a buildstats directory, use the latest
entry under $BUILDDIR.

(From OE-Core rev: aeb69fbe130dca37b39d4065ec983441e0052803)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-25 15:25:32 +01:00
Mikko Rapeli
5fe59b3144 oeqa selftest uki.py: add tests for uki.bbclass
Tests builds and boots qemu into uki binary with systemd and sysvinit.
Due to depedency to x86 specific ovmf UEFI firmware, tests
are specific to x86 curently. UEFI firmware for ARM can be generated
via qemuarm64-secureboot machine in meta-arm and similar tests
on qemu will pass.

(From OE-Core rev: 8a3cb17876dbcaf07696a4bcd454e2f9a444fb1b)

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-25 15:12:22 +01:00
Mikko Rapeli
2f0ef8cd0e wic bootimg-efi.py: change UKI support from wic plugin to uki.bbclass
Remove custom wic plugin implementation and use systemd ukify reference
implementation when generating UKI images. Fail if users still have
create-unified-kernel-image in wic image config. uki.bbclass use is
detected from IMAGE_CLASSES variable ("inherit uki" in image
recipe) so export that to wic plugins.

If UKI is used, then only generate a minimal loader config for
systemd-boot which basically just sets a timeout. Also set 5 second
timeout by default instead of failing if wic bootloader config is
missing. Boot menu is generated at runtime based on UKI binaries
found from ESP partition.

(From OE-Core rev: 725fed6ea40c7443b5e0e69dc1dd9c38ac814c56)

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-25 15:12:22 +01:00
Mikko Rapeli
c50552a2a5 wic bootimg-efi.py: keep timestamps and add debug prints
Keep timestamps etc to help build reproducibility.

Add prints to see what is being copied to ESP partition.

(From OE-Core rev: cedcd25c5e3cd002dd34651c182193731d7c964b)

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-25 15:12:22 +01:00
Antonin Godard
bc67fcf621 devtool: ide-sdk: fix help typo
Change "paramter" -> "parameter".

(From OE-Core rev: e6e548170a5dee957b34d2a25161632fa37bb567)

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-22 12:28:18 +01:00
Changqing Li
a8f7f1b87e resulttool/regression.py: skip checking status for ptestresult.rawlogs/ptestresult.sections
ptestresult.rawlogs/ptestresult.sections don't have status is expected,
so skip them to avoid following error when running "resulttool regression
base target":

ERROR: Failed to retrieved base test case status: ptestresult.rawlogs
ERROR: Failed to retrieved base test case status: ptestresult.sections

(From OE-Core rev: c83a535d1b32f7fd292cd9caea1ec962bc3c735b)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-11 15:57:45 +01:00
Changqing Li
3315ffac47 resulttool/regression.py: fix AttributeError
Fix following AttributeError when running "resulttool regression base target":
  File "/yocto/poky/scripts/lib/resulttool/regression.py", line 322, in regression_common
    res, resstr = compare_result(logger, c, b, base_results[a][c], target_results[a][b], args.limit)
AttributeError: 'Namespace' object has no attribute 'limit'

(From OE-Core rev: d773edde8db2019550916d2552171c45fe31ac2a)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-11 15:57:45 +01:00
Yi Zhao
8028c989cc wic/rootfs.py: allow --exclude-path option to exclude symlinks
Currently, if we specify a symbolic link in --exclude-path option,
we will get the following error in do_image_wic:

ERROR: --exclude-path: Must point inside the rootfs: usr/bin/hello.link

This is because it uses os.path.realpath to eliminate symbolic links. To
exclude symbolic links, use os.path.abspath instead of os.path.realpath.

(From OE-Core rev: 42e829ac1e9d74646b6dfb327b18b15f6b0df60b)

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-11 15:57:45 +01:00
Richard Purdie
d074707199 efi-bootdisk.wks: Increase overhead-factor to avoid test failures
After commit d74bfb2d5c9e6247e4c0a3c2fdba0cc4a7585395:
"linux-yocto: Enable l2tp drivers when ptest featuee is on"
was merged, oe-selftest efibootpartition.GenericEFITest.test_boot_efi
breaks due to space issues.

Increase the disk space available to avoid this and allow functional
automated testing again.

(From OE-Core rev: eb76c15de881a56ead0a18f6428c5564291249c9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-10 11:58:02 +01:00
Richard Purdie
35c3b9132d migrate_localcount: Drop long obsolete code
If BB_URI_LOCALCOUNT isn't set, the code does nothing. That code was removed in 2012:

https://git.yoctoproject.org/poky/commit/?id=d0f35207f9e19b440393a79ebf621649c495738d

Therefore drop the rest of it!

(From OE-Core rev: fca25fc4d7721f85f64c942307ebe7ba9f2fad3e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-08 13:26:39 +01:00
Jon Mason
9377886a7d default-distrovars: Have KERNEL_CONSOLE reference SERIAL_CONSOLES
Currently, KERNEL_CONSOLE has a default value of "ttyS0".  However, Arm
machines and those using virtio serial prefer to use "ttyAMA0" or "hvc0"
(or something else).  These are usually defined by the machine config
file as SERIAL_CONSOLES, which has one or more entries.  Take the first
one of those instead of ttyS0, but default back to ttyS0 if nothing is
set.

Also, use this variable in the efi wic file instead of "ttyS0".
Of note, this changes the default speed of the default kernel console
from undefined (9600) to 115200.  This allows for users of the
mkefidisk.wks to work as before but any users of this variable could see
changed behavior and would now need to define this as:
KERNEL_CONSOLE ?= "ttyS0,9600"

This includes revisions suggested by Quentin Schulz and Ross Burton.

(From OE-Core rev: da42fc9ad55d1d60a04e38ff94c965f711f60cd6)

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-08 13:26:39 +01:00
Joshua Watt
dfa892cfa6 Add script to make SPDX bindings
Adds a script to generate the SPDX code bindings

(From OE-Core rev: f0a5fdf54f975f9bc30758aec1f6f27e2d8149de)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-30 17:07:18 +01:00
Trevor Gamblin
1d813b0d53 scripts/patchtest: split out result messages
Add a minor refactor for the result output.

(From OE-Core rev: 5553edc0f8d58dc6e3a4f703af9bdb04fda1e12f)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-30 17:00:50 +01:00
Trevor Gamblin
4c378fc895 patchtest: simplify, rename modules
- simplify base.py, data.py
- move some leftover regex patterns to patterns.py
- remove pyparsing path logic, since this is no longer needed
- rename PatchTestInput class to PatchtestParser
- data.py: rename to patchtest_parser.py
- patterns.py: rename to patchtest_patterns.py
- move PatchTestDataStore to test_metadata.py since that's the only
  place it's used
- remove unused logger code

(From OE-Core rev: 1e971b05b036b0b1eb0bdbd9b26b54d06e74294c)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-30 17:00:50 +01:00
Trevor Gamblin
d6ede9c73b patchtest: mbox.py: new data implementation
Consolidate and improve some objects:

- absorb utils.py functionality
- repo.py: use mbox.py
- repo.py: remove some cruft
- utils.py: replace with logs.py
- utils.py: delete
- patch.py: delete
- scripts/patchtest: use logging directly
- general cleanup

(From OE-Core rev: d4fbdb1d15f281b236137d63710c73bca8911a36)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-30 17:00:50 +01:00
Adrian Freihofer
90827ca3cf devtool: drop useless variables
Drop some unused code.

The actual intention was to look for remnants of S = WORKDIR, which
required the extra complicated oe-local-files directory. The remaining
code dealing with oe-local-files still seems to be useful.

(From OE-Core rev: 02b52a2de3bf5766bc05531138a2e23acb00a276)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-30 17:00:50 +01:00
Adrian Freihofer
bac51c7151 devtool: menuconfig remove useless code
When I tried to understand whether oe-local-files is actually still
needed here, I found some useless lines that can be dropped.

(From OE-Core rev: 43f0c6beaa2a99301a565837944250bb2e56c98a)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-30 17:00:50 +01:00
Adrian Freihofer
21917a63ab devtool: drop S = WORKDIR workaround
Dropping support for S = WORKDIR allows to drop this ugly workaround.

With S = WORKDIR it was possible to refer to a file via oe-local-files
symlink or via direct file path. Ensuring the pseudo database is
consistent for both paths was extra complicated and required this bad
function. Really nice to drop it now!

(From OE-Core rev: 2b799fdf267f44c26797593984d9828c4fd0fd31)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-30 17:00:50 +01:00
Richard Purdie
7c5d68f27a scripts/install-buildtools: Update to 5.0.3
Update to the 5.0.3 release of the 5.0 series for buildtools.

(From OE-Core rev: c922ca720a0c3b7b4d3d3187539e7cf77d93d457)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-17 12:25:21 +01:00
Ryan Eatmon
40052a34c6 oe-setup-build: Change how we get the SHELL value
There are times that a user might not have SHELL set for some reason.
We should default back to a known shell in the event that SHELL is not
set.

(From OE-Core rev: 9f3099b7eddccf2b7328c0fdd6423269d17138ce)

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-12 16:15:09 +01:00
Konrad Weihmann
eb016e9758 runqemu: remove unused uid variable
(From OE-Core rev: 2521f67f19cb0eea0a2d6c5e8c39fa5edd60330a)

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-10 13:05:00 +01:00
Konrad Weihmann
c9a9999400 runqemu: keep generating tap devices
in case there is no tap device the script tries to
generate a new one.
The new device is then unguarded for a moment, so
the newly generated device could be acquired
by a different instance or user, before it is locked to
the instance with acquire_taplock.
To fix that keep generating new tap devices in case
the lock can't be acquired up to 5 times.
If no tap device can be locked it fails in the existing
error handling

(From OE-Core rev: 23876576d054ebbab9b02c0012782aa56feda123)

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-10 13:05:00 +01:00
Ryan Eatmon
f0e84fa257 oe-setup-build: Fix typo
A variable was mistyped in an error message resulting in this error:

NameError: name 'tempalte_name' is not defined. Did you mean: 'template_name'?

(From OE-Core rev: 275a3c015d37729c3b0c9cc4395d50ea2f210f02)

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-05 21:47:22 +01:00
Adrian Freihofer
6e0dc47ce4 devtool: remove obsolete SRCTREECOVEREDTASKS handling
devtool modify generates a bbappend for kernel recipes which contains:
  SRCTREECOVEREDTASKS="\
    do_fetch \
    do_kernel_checkout \
    do_kernel_configcheck \
    do_unpack \
    do_validate_branches \
  "
  do_patch[noexec] = "1"

If the linux-yocto kernel is used, this is redundant. The
linux-yocto.bbclass already does the same:

linux-yocto sets SRCTREECOVEREDTASKS to
  SRCTREECOVEREDTASKS="\
    do_fetch \
    do_kernel_checkout \
    do_kernel_configcheck \
    do_patch \
    do_unpack \
    do_validate_branches \
  "

Also the do_patch[noexec] is redundant because the purpose of
SRCTREECOVEREDTASKS is to delete these tasks if the externalsrc.bbclass
is used.

The default value of SRCTREECOVEREDTASKS initialized in
externalsrc.bbclass is:
  SRCTREECOVEREDTASKS ?= "do_patch do_unpack do_fetch"
This is fine for kernels which do not inherit the linux-yocto.bbclass.

The code in devtool modify is redundant and therefore removed.

(From OE-Core rev: 94ff1be36a1eeef7ddceb4fcf20425a03cd052de)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-04 12:38:44 +01:00
Adrian Freihofer
b161ca0008 devtool: modify kernel adds append twice
Drop the redundant generation of the do_configure:append section for the
kernel. The same append is generated twice:

if bb.data.inherits_class('kernel', rd):
    f.write('\ndo_configure:append() {\n'
    '    cp ${B}/.config ${S}/.config.baseline\n'
    '    ln -sfT ${B}/.config ${S}/.config.new\n'
    '}\n')

KCONFIG_CONFIG_ENABLE_MENUCONFIG ??= "true"
KCONFIG_CONFIG_ROOTDIR ??= "${B}"
if rd.getVarFlag('do_menuconfig', 'task'):
    f.write('\ndo_configure:append() {\n'
    '    if [ ${@oe.types.boolean(d.getVar("KCONFIG_CONFIG_ENABLE_MENUCONFIG"))} = True ]; then\n'
    '        cp ${KCONFIG_CONFIG_ROOTDIR}/.config ${S}/.config.baseline\n'
    '        ln -sfT ${KCONFIG_CONFIG_ROOTDIR}/.config ${S}/.config.new\n'
    '    fi\n'
    '}\n')

In contradiction to the first code block the second code block considers
the variables which is correct.

(From OE-Core rev: b0733c440e861ed7bf70efdd9b7a73afb4701218)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-04 12:38:44 +01:00
Alessandro Pecugi
35cb7bc646 runqemu: add sd card device
runqemu currently only supports scsi, ide and virtio drive types.
Implement QB_DRIVE_TYPE=/dev/mmcblk which adds an sdhci-pci device and
mounts the rootfs file as an sd card.

(From OE-Core rev: 0740896afbe13f37058e990a0a13b2b51bba70fd)

Signed-off-by: Alessandro Pecugi <alessandro.pecugi@seco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-30 21:59:38 +01:00
Jörg Sommer
4b60e8690c runqemu: Fix detection of -serial parameter
The pattern `-serial` matches also `-device usb-serial` and `virtio-serial`
which are not the desired parameter. This causes the serial console ttyS1 is
missing and Systemd's getty@ttyS1 fails constantly.

(From OE-Core rev: b6d035894120b45b42f146ab5b3110522c58d178)

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-30 21:59:38 +01:00
Clara Kowalsky
5aeabd3217 resulttool: Add support to create test report in JUnit XML format
This adds the functionality to convert the results of the
testresults.json file to a unit test report in JUnit XML format. The
unit test report can be used in the CI/CD pipeline to display the test
results.

To use the resulttool scripts, first source oe environment, then run the
entry point script to look for help.
	$ resulttool

To generate the unit test report, execute the below
	$ resulttool junit <json_file>

By default the unit test report is stored as
<build_dir>/tmp/log/oeqa/junit.xml.

(From OE-Core rev: 3f9be03946243feaa09b908d7010899769091fe6)

Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-29 21:58:19 +01:00
Marta Rybczynska
38cfb6525e cve-json-to-text: add script
Add a script that converts the cve-check result from the JSON format
to the TEXT format.

(From OE-Core rev: da4e01dfa538578936e565413871a7496b8752df)

Signed-off-by: Marta Rybczynska <marta.rybczynska@ygreky.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-25 15:36:30 +01:00
Enguerrand de Ribaucourt
0a0caacfa5 recipetool: create_npm: reuse license utils
create_npm.py duplicated the logic for matching licenses from files and
also finding them. This patch refactors the code to reuse the license
utils. This will make the code more maintainable and also align both
behaviors. For instance, some licenses weren't matched properly because
the duplicate logic did not support the difference in format in the md5
tables for COMMON_LICENSE_DIR and licenses.csv.

This is also faster since the license files were being read twice.
The result is slightly more accurate since the utils have better
implementations, and I was able to reuse the logic for the root PN
package, as well as the base LICENSE variable.

I chose to extract generate_common_licenses_chksums into create.py
since it can be considered a general utility function to allow
other recipetool creators to refer to COMMON_LICENSE_DIR files.

I updated the wording in the code when appropriate.

v3:
 - added commit
 - this replaces the commit that added all the COMMON_LICENSE_DIR md5
   to licenses.csv

(From OE-Core rev: 7bc18bed63b94689890bcde63402d7cc1cedffa9)

Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-23 09:51:36 +01:00
Enguerrand de Ribaucourt
69bf37a3dd recipetool: create: split guess_license function
The npm recipetool handler redefines the license code the could be
unified. In order to do this refactoring, extract the bits we'll
need into separate functions.

guess_license() is renamed to find_licenses() and is split into
find_license_files() and match_licenses().

(From OE-Core rev: f1ec28feaea8ea6a2df894dd4ddba561c8a04ed2)

Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-23 09:51:36 +01:00
Enguerrand de Ribaucourt
01d17cd5d4 recipetool: create_npm: resolve licenses defined in package.json
Some npm packages do not copy the LICENSE or COPY file into their
git repository. They'll instead simply use SPDX identifiers in their
package.json. A fallback for those repositories attempted to match
the README file to a license file instead, which had a very low
probability of success.

This commit replaces this fallback with parsing the package.json and
looking for the license in COMMON_LICENSE_DIR. If the license is not
found, "Unknown" will still be produced.

This also generates "Unknown" for packages which had no README file,
which could silently not appear in the generated recipe. The user was
more likely to miss them.

Co-authored-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
(From OE-Core rev: 445604cfc4a5813ea635f18053cd1f673bf0b830)

Signed-off-by: Tanguy Raufflet <tanguy.raufflet@savoirfairelinux.com>
Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-23 09:51:36 +01:00
Trevor Gamblin
6c1e2d7971 scripts/patchtest.README: cleanup, add selftest notes
Make some minor fixes to grammar and layout, and add a short new section
describing how to setup and use the patchtest selftests properly.

(From OE-Core rev: 264185d2cfa31b1cf2534a8de21e4b17bb5bbf79)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-05 14:31:57 +01:00
Alexander Kanavin
18e4194539 devtool/upgrade: rename RECIPE_UPDATE_EXTRA_TASKS -> RECIPE_UPGRADE_EXTRA_TASKS
'UPDATE' as a name is somewhat unfortunate as the variable is intended only for
the 'devtool upgrade' operation and devtool also has an 'update-recipe' operation.

(From OE-Core rev: 4467aa0661e233f44c4ce029428c67d88fccfc07)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-08-03 07:56:10 +01:00
Marcus Folkesson
d045fed31a bootimg-partition: break out code to a common library.
Break out the code that parse IMAGE_BOOT_FILES to a common library.

(From OE-Core rev: 1e07fe51bdb24070308c85e83df0b80ab9f83cea)

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Konrad Weihmann <kweihmann@outlook.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-23 11:17:11 +01:00
Adrian Freihofer
a1b494e651 pybootchartgui.py: python 3.12+ regexes
$ ./scripts/pybootchartgui/pybootchartgui.py
./scripts/pybootchartgui/pybootchartgui/parsing.py:460: SyntaxWarning: invalid escape sequence '\d'
  disk_regex_re = re.compile ('^([hsv]d.|mtdblock\d|mmcblk\d|cciss/c\d+d\d+.*)$')
./scripts/pybootchartgui/pybootchartgui/parsing.py:597: SyntaxWarning: invalid escape sequence '\['
  timestamp_re = re.compile ("^\[\s*(\d+\.\d+)\s*]\s+(.*)$")
./scripts/pybootchartgui/pybootchartgui/parsing.py:598: SyntaxWarning: invalid escape sequence '\S'
  split_re = re.compile ("^(\S+)\s+([\S\+_-]+) (.*)$")
./scripts/pybootchartgui/pybootchartgui/parsing.py:643: SyntaxWarning: invalid escape sequence '\@'
  p = re.match ("\@ (\d+)", rest)
./scripts/pybootchartgui/pybootchartgui/draw.py:799: SyntaxWarning: invalid escape sequence '\s'
  ('system.cpu', 'CPU', lambda s: re.sub('model name\s*:\s*', '', s, 1)),

(From OE-Core rev: 0d94c22dd8d6c5655c2237ae740e8d9bb2adc751)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-22 16:53:06 +01:00
Alexander Kanavin
15e5193e9f devtool/upgrade: use PN instead of BPN for naming newly created upgraded recipes
BPN isn't correct, as it is set to 'cmake' when 'cmake-native' is being upgraded
(or libva for libva-initial etc.)

(From OE-Core rev: e634316547f86ce5662fa4899440a5af1047d494)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-22 16:53:06 +01:00
Alexander Kanavin
3d98aafc43 recipeutils/get_recipe_upgrade_status: group recipes when they need to be upgraded together
This will allow 'lockstep upgrades' of such recipes, improving success
rates in automated version updating process.

devtool check-upgrade-status now prints:

These recipes need to be upgraded together {
glib-2.0                  2.80.2          2.80.4          Anuj Mittal <anuj.mittal@intel.com>
glib-2.0-initial          2.80.2          2.80.4          Anuj Mittal <anuj.mittal@intel.com>
}
These recipes need to be upgraded together {
util-linux                2.39.3          2.40.2          Chen Qi <Qi.Chen@windriver.com>
util-linux-libuuid        2.39.3          2.40.2          Chen Qi <Qi.Chen@windriver.com>
}
These recipes need to be upgraded together {
cmake                     3.29.3          3.30.0          Unassigned <unassigned@yoctoproject.org>
cmake-native              3.29.3          3.30.0          Unassigned <unassigned@yoctoproject.org>
}

etc.

(From OE-Core rev: 7874aea5c62be3e8dbd19e04fce5389c5ed7aab6)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-22 16:53:06 +01:00
Alexander Kanavin
597b87a468 lib/oe/recipeutils: return a dict in get_recipe_upgrade_status() instead of a tuple
Putting various things in a tuple is an anti-pattern of sorts, as the consumers
have to unpack it into local variables for readability, or access items directly
with indexes, which makes code pretty much unreadable.

(From OE-Core rev: e86aa26d209eb9809198f6dd40cd058366318e3d)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-22 16:53:06 +01:00
Joshua Watt
cc191968a7 scripts/pull-spdx-licenses.py: Add script
Adds a script to pull the SPDX license data and update the license list
JSON data, as well as update the license directory.

(From OE-Core rev: cc2eb66fc0389664501baf57808e23f4cb4ee479)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-02 22:29:13 +01:00
Adithya Balakumar
c79c8ce71c wic/partition.py: Set hash_seed for empty ext partition
Although setting hash_seed is handled for the rootfs plugin case, but
this is missed when deploying an empty ext partition.

(From OE-Core rev: 0202fb594fb05098cb8d8b6088e63beb40b5906e)

Signed-off-by: Adithya Balakumar <adithya.balakumar@toshiba-tsip.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-18 08:44:41 +01:00
Ross Burton
4574919d30 scripts/makefile-getvar: add script to get values from Makefiles
There is often a need to extract a value from a Makefile, and standard
GNU Make doesn't provide a way to do this.  This script lets you access
values from Makefiles directly:

$ makefile-getvar curl/tests/server/Makefile noinst_PROGRAMS
getpart resolve rtspd sockfilt sws tftpd fake_ntlm socksd disabled mqttd

(From OE-Core rev: 881aa40d12d9dde73a932277093e5ceca8eb5c68)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-13 09:11:17 +01:00
Tim Orling
82d07928fe devtool upgrade: enable RECIPE_UPDATE_EXTRA_TASKS
For some recipes, such as those that inherit cargo-update-recipe-crates,
we need to run additional tasks once the new sources have been unpacked.

Introduce a new variable RECIPE_UPDATE_EXTRA_TASKS which is a space-
delimited list of tasks to run after the new sources have been
unpacked in scripts/lib/devtool/upgrade.py ugrade() method.

(From OE-Core rev: 59894f3b5b0bc257837d7ce4ea684f1d8c382cec)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-13 09:11:17 +01:00
Aleksandar Nikolic
a43f15565b install-buildtools: update base-url, release and installer version
Update the following default values:
- DEFAULT_BASE_URL (https instead of http)
- DEFAULT_RELEASE (5.0.1)
- DEFAULT_INSTALLER_VERSION (5.0.1)

(From OE-Core rev: b2ebb965a5aa128b05ed7ddc9216171463777732)

Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-12 16:08:32 +01:00
Aleksandar Nikolic
062c289efa install-buildtools: fix "test installation" step
The "Test installation" step fails with some harmless error messages
(see [1]). This can however make a user think that the buildtools
have not been installed correctly.

Two reasons for the error messages:
- some envvars in the environment-setup-<arch>-pokysdk-linux file
  start and end with double quotes (e.g., PATH) and are as such
  written into python os.environ. This leads that their usage is
  not valid later when testing the installation. This patch removes
  the double quotes before writing, if they are present.
- if installation directory (install_dir), given through the option
  --directory, is given as a relative path, checking if the path to
  a tool (e.g., gcc) in buildtools starts it will always fail. This
  patch converts the install_dir variable to an absolute path.

[1]
ERROR: Something went wrong: tar not found in ./build-tools
ERROR: Something went wrong: installation failed

(From OE-Core rev: e4eb0b14ecf9bd2fba13260441c9d86eb348f41e)

Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-12 16:08:32 +01:00
Aleksandar Nikolic
cedb7197cc install-buildtools: remove md5 checksum validation
No need to validate with the md5 checksum, as the file is not even
uploaded to the Yocto release webpage (the download never failed due
to a wrong indentation of an else statement). For validation purposes,
use the sha256 checksum only.

(From OE-Core rev: b740d2f9d40aef1e18c022d1e82b4fb2c5c1fc22)

Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-12 16:08:32 +01:00
Enrico Jörns
1d5b4d19c7 wic: bootimg-efi: fix error handling
If we check for empty variables, it does not make sense to print their
content in case they are empty.

Additionally, the error message in the 'kernel' check attempted to print
the wrong variable ('target') which was not even defined, yet.

Also, raising WicError doesn't require an extra newline.

(From OE-Core rev: f31cf475d0235f42d73aeec07694f79b9937fd76)

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-06 11:56:04 +01:00
Enrico Jörns
4f600110ee wic: engine.py: use raw string for escape sequence
Fixes:

| poky/scripts/lib/wic/engine.py:362: SyntaxWarning: invalid escape sequence '\/'

(From OE-Core rev: e33d7241f6c2897e930aff41e18b154891197ab9)

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-06 11:56:04 +01:00
Richard Purdie
6b9eb4e9f0 siteconfig: Drop siteconfig class/code/support
The siteconfig code was only used for 5 cache values. The complexity added to sstate
to support this code was considerable and the runtime much more significant than
any benefit the cache files would have added. Drop the support for this which
was only used minimally for ncurses and zlib.

(From OE-Core rev: f3766dc038f7ba9780ddaf5eb8d27385ea31d7d0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-31 16:58:36 +01:00
Ninette Adhikari
f66f8fa9f6 oe-build-perf-report: Add commit hash link to chart tooltip
Update tooltip to include the commit hash link to the poky repository

(From OE-Core rev: 1187a460c2608369df8de08fe52a5542e4ab6ecd)

Signed-off-by: Ninette Adhikari <ninette@thehoodiefirm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-24 16:59:31 +01:00
Richard Purdie
569f8e09f0 recipetool/devtool: Update to work correctly with UNPACKDIR
Tweak recipetool and devtool to correctly use UNPACKDIR. This allows some
simplification of the code. This patch makes things basically work but there
are likely deeper improvements that can be made now that WORKDIR != UNPACKDIR.

(From OE-Core rev: d2eeaa88b27a2875c419591d1d91bcc85d7b129c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-22 22:26:30 +01:00
Richard Purdie
6d77296d83 devtool: Drop oe-local-files and simplify
The only real reason for oe-local-files was to support S = WORKDIR. With changes to
drop support for that, it makes sense to simplify devtool and to try and make both
the code and the processes/workflows simpler.

This patch drops support for S = WORKDIR, removes oe-local-files and then updates
the test cases to match this new situation.

At the code level, we assume we can always now track code changes using git and
that things committed into git are handled as patches (as before) but delta against
HEAD is saved as specific file level changes to the recipe.

One test is disabled as it is no longer approproate. It is being keped until we can
make WORKDIR != UNPACKDIR at which point it should be revisited.

(From OE-Core rev: ce8190c519052fed10b5233697b69a75868db45a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-21 12:08:04 +01:00
Anton Almqvist
9a894dac19 devtool: modify: Catch git submodule error for go code
One of the git submodule commands failed for source extracted for
recipes using go.bbclass.  The root cause is probably the path set up
by go_do_unpack which makes S and gitroot not match.

This patch does not fix the root problem, but at least it is no worse
than before the git submodule support.

The extracted source will still have two .git folders, one in S
created by devtool and one in the go path which will contain the tru
git history.

[ YOCTO #15483 ]

(From OE-Core rev: fe242408af40dd1f6e47d9b2b232bdc76756c80a)

Signed-off-by: Anton Almqvist <antonal@axis.com>
Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-15 16:39:19 +01:00
Ninette Adhikari
cf0c866b51 oe-build-perf-report: Add dark mode
Update css to add dark mode when window prefers-color-scheme is dark.

(From OE-Core rev: ed02a235d42202279ad5e4e3153247f9e5e2bba8)

Signed-off-by: Ninette Adhikari <ninette@thehoodiefirm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-15 16:39:19 +01:00
Ninette Adhikari
20fafa0854 oe-build-perf-report: Update chart tooltip and chart type
- Update chart tooltip format to show value as size in MB for 'rootfs size'
and timestamp for 'tmpdir size'
- Add commit number to tooltip
- Update chart type to 'step chart' instead of 'line chart'

(From OE-Core rev: fb41cbbe6008e442b6eac77308eadeae327eed7d)

Signed-off-by: Ninette Adhikari <ninette@thehoodiefirm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-15 16:39:19 +01:00