Commit Graph

1795 Commits

Author SHA1 Message Date
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
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
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
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
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
Ninette Adhikari
314a220280 oe-build-perf-report: Improve report styling and add descriptions
Styling updates are added including page margin, labels for x and y axis, tooltip, and section descriptions.

(From OE-Core rev: 2a2568fcf1a3f8e467bd814f4fb13dffae8ec61d)

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
99861c17e7 oe-build-perf-report: Display more than 300 commits and date instead of commit number
- This commit updates measurement statistics data to include start_time so that time can be displayed instead of commit numbers on the chart.
- It also updates default commit history length to 300.

(From OE-Core rev: 64275a41c37130aaaacc5e592f94a1afe057119b)

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
836b4b57d6 oe-build-perf-report: Add apache echarts to make report interactive
- Add Apache echarts (https://echarts.apache.org/en/index.html) library to create build performance charts.
- Restructure data to time and value array format so that it can be used by echarts.
- This commit also converts test duration to minutes to map against the values axis.
- Zoom is added to the line charts.

(From OE-Core rev: 63c9321832aae79d20a4ddd199a4a1385f81de53)

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
Antonin Godard
12c447b38a devtool: ide-sdk: correct help typo
(From OE-Core rev: 50e043387a2f0f9a5c2f7a5f914c465c830d329b)

Signed-off-by: Antonin Godard <antoningodard@pm.me>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-09 09:48:58 +01:00
Richard Purdie
808f700efc classes/lib/scripts: Initial WORKDIR -> UNPACKDIR updates
Work through the initial issues I found where we need to change WORKDIR
to UNPACKDIR.

(From OE-Core rev: 86fec41b1e809d1a2fa2feadc26d29020df53d39)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-02 15:15:51 +01:00
John Ripple
5756ac9936 rootfs.py: Fix logger error message format
--_000_PH7PR17MB61307CB6690EC00DEB4ED9B39C0F2PH7PR17MB6130namp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

This patch adds a missing "%s" format in a logger.error call. Without
this addition the logger itself would error out and not print a useful
message.

(From OE-Core rev: 2c892e5dd9ba72a51c0a8fb851599cc2dc3a8b5c)

Signed-off-by: John Ripple <john.ripple@keysight.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-25 10:19:28 +01:00
Julien Stephan
28516320d8 devtool: standard: update-recipe/finish: fix update localfile in another layer
When trying to use devtool update-recipe/finish on another layer, with modified
local file we have the following error:

  Traceback (most recent call last):
    File "<..>/poky/scripts/devtool", line 350, in <module>
      ret = main()
            ^^^^^^
    File "<..>/poky/scripts/devtool", line 337, in main
      ret = args.func(args, config, basepath, workspace)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<..>/poky/scripts/lib/devtool/standard.py", line 1968, in update_recipe
      updated, _, _ = _update_recipe(args.recipename, workspace, rd, args.mode, args.append, args.wildcard_version, args.no_remove, args.initial_rev, dry_run_outdir=dry_run_outdir, no_overrides=args.no_overrides, force_patch_refresh=args.force_patch_refresh)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<..>/poky/scripts/lib/devtool/standard.py", line 1930, in _update_recipe
      updated, appendf, removed = _update_recipe_patch(recipename, workspace, srctree, crd, appendlayerdir, wildcard_version, no_remove, no_report_remove, initial_rev, dry_run_outdir, force_patch_refresh)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<..>/poky/scripts/lib/devtool/standard.py", line 1747, in _update_recipe_patch
      patchdir = param.get('patchdir', ".")
                 ^^^^^^^^^
  AttributeError: 'str' object has no attribute 'get'

This was introduced when adding support for git submodules.
No selftest case exists to catch this, so a selftest will be
added in another commit.

(From OE-Core rev: de7ca9f800e15e10271502da7e51e3ae08e0c85b)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-25 10:10:14 +01:00
Vincent Kriek
629063944c devtool: sync: Fix Execution error
When executing devtool sync on a recipe that was extract with devtool
extract earlier the following error occured:

    Traceback (most recent call last):
    [...]
    bb.process.ExecutionError: Execution of 'git fetch file:///home/vin/projects/poky/build/tmp/work/all-poky-linux/netbase/6.4/devtooltmp-figt1jmr/workdir/netbase devtool:devtool' failed with exit code 128:
    fatal: refusing to fetch into branch 'refs/heads/devtool' checked out at '/home/vin/projects/poky/build/netbase-src'

Fix this by adding --update-head-ok and --force to git fetch so it will
override the current head even if it is checked out and has changes.
Possible existing changes in the devtool branch can be retrieved by
checking out the devtool.bak branch

(From OE-Core rev: 4c89b061003a0f4143c6d3838e39fc2643edc8d6)

Signed-off-by: Vincent Kriek <vincent@coelebs.dev>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-25 10:10:14 +01:00
Sven Schwermer
8219eefdd8 recipetool: Handle several go-import tags in go resolver
When dynamically resolving go modules, the HTML page may contain several
go-import meta tags. We must handle all and pick the correct one based
on the module name. An example for such a behaviour is
gonum.org/v1/gonum:

<meta name="go-import" content="gonum.org/v1/exp git https://github.com/gonum/exp">
<meta name="go-import" content="gonum.org/v1/gonum git https://github.com/gonum/gonum">
<meta name="go-import" content="gonum.org/v1/hdf5 git https://github.com/gonum/hdf5">
<meta name="go-import" content="gonum.org/v1/netlib git https://github.com/gonum/netlib">
<meta name="go-import" content="gonum.org/v1/plot git https://github.com/gonum/plot">
<meta name="go-import" content="gonum.org/v1/tools git https://github.com/gonum/tools">

(From OE-Core rev: 9c36a61e29359067165bddc7f2accdf2c4c8a761)

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-23 13:40:24 +01:00
Sven Schwermer
e4c3483ecf recipetool: Handle unclean response in go resolver
It appears that some go modules repond with a 404 error when trying to
resolve them dynamically. The response body may still contain the
go-import meta tag. An example for such behaviour is gonum.org/v1/gonum.

(From OE-Core rev: 8f2e14ab6562a9a68819a960c66a258ea9dbe246)

Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-23 13:40:24 +01:00
Julien Stephan
834e91ce53 devtool: standard: throws appropriate error if source is in detached HEAD
If source is in detached HEAD, we get the following error when using
detvool finish command:

    [...]
    File "<...>/poky/scripts/lib/devtool/standard.py", line 1938, in _update_recipe
      bb.process.run('git checkout %s' % startbranch, cwd=srctree)
    File "<...>/poky/bitbake/lib/bb/process.py", line 189, in run
      raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
  bb.process.ExecutionError: Execution of 'git checkout (HEAD detached at 9bbf87e)' failed with exit code 2:
  /bin/sh: -c: line 1: syntax error near unexpected token `('
  /bin/sh: -c: line 1: `git checkout (HEAD detached at 9bbf87e)'

Check this and throws an appropriate error in this case

(From OE-Core rev: d9c686b5ff9f591ec6b928ed539084c02df4c8a5)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-12 17:27:53 +01:00
Anibal Limon
7c3f956a0a wic: bootimg-partition allow to set var to get boot files
This is a generic functionality that takes a set of files and create a
boot parition based on IMAGE_BOOT_FILES var, allow to sepcify the
variable name so a BSP plugin can extend this and re-use the
functionality.

(From OE-Core rev: 3a2339455be29a6ff65c8c5f6865a4cd35dd7f63)

Signed-off-by: Anibal Limon <anibal@limonsoftware.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-26 17:10:51 +00:00
Trevor Woerner
f15676592b bmaptool: now part of Yocto Project
The bmaptool (previously: bmap-tools, bmap-tool, bmaptool) has been moved
to be under the Yocto Project umbrella and is now hosted at:

	github.com/yoctoproject/bmaptool

[RP: Added a couple of missing renames]
(From OE-Core rev: 7a036b1a1ec7dcd27dbe18d4c2e703bd2a8af182)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-05 12:24:50 +00:00
Adrian Freihofer
c82c57621b devtool: ide-sdk prefer sources from workspace
Improve the previous commit:
- log an error if some assumptions are not true
- Use TARGET_DBGSRC_DIR variable
- Do the same for ide none

Why the additional source mapping is required:

For example the cmake-example recipe refers to sources like this:
./recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-readelf \
  -wi image/usr/bin/cmake-example | grep -B1 DW_AT_comp_dir
    ...
    <560>   DW_AT_name        : (indirect line string, offset: 0x1da):
    /usr/src/debug/cmake-example/1.0/oe-local-files/cpp-example.cpp
    ...

Another example is powertop:
./recipe-sysroot-native/usr/bin/x86_64-poky-linux/x86_64-poky-linux-readelf \
  -wi image/usr/sbin/powertop | grep -B1 DW_AT_comp_dir
    ...
    <561>   DW_AT_name        : (indirect line string, offset: 0x1da):
    /usr/src/debug/powertop/2.15/src/devlist.cpp
    ...

For recipes with local files this works. The oe-local-files folder is
not available in the rootfs-dbg and therefore the sources are first
found in the workspace folder. GDB searches for source files in various
places:
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Source-Path.html
However, for the powertop example the sources opened in the editor are
from the rootfs-dbg instead of from the workspace.

Bitbake calls the compiler with
  -fmacro-prefix-map=${S}=${TARGET_DBGSRC_DIR}
where TARGET_DBGSRC_DIR defaults to "/usr/src/debug/${PN}/${PV}".

A source map which maps the recipe specific path from TARGET_DBGSRC_DIR
to the workspace fixes this.
The already existing source map for /usr/src/debug applies for all other
recipes. It finds the sources (read only) in the rootfs-dbg folder.

(From OE-Core rev: 06601632c1879cb80276f9b36de91fb7808311a5)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:38:46 +00:00
Enguerrand de Ribaucourt
a5b75e29ff devtool: ide-sdk source mapping for vscode
When launching the debug configuration, the source files from the debug
rootfs were openened in the editor instead of the local workspace files.
We add an exception to properly map them to the file being developed and
compiled by the IDE integration. This also more closely matches what the
user would expect compared to native development.

This is also true for the devtool fallback mode.

(From OE-Core rev: 24db2b8d0d7104960c1cdb2c7ee5216c830a6754)

Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:38:46 +00:00
Adrian Freihofer
4c6f3bbc77 devtool: ide-sdk launch.json per recipe only
If multiple recipes are processed at once, the launch.json and the
tasks.json of the second recipe contains also the configurations for the
binaries of the first recipe.

Example:
  devtool ide-sdk powertop cmake-example oe-selftest-image
generated a launch and a tasks configuration for the cmake-example
recipe which also offers debugging the powertop binary.

(From OE-Core rev: 63986b2c40d90fe96cdc6a46aa649efcf17f6ac2)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:38:46 +00:00
Enrico Jörns
54c27d84b6 wic: 'empty' plugin: fix typo in comment
(From OE-Core rev: 1a9013c3767d174a970d31e80748bc8d73af0dba)

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:35:43 +00:00
Adrian Freihofer
4e3b6c24d5 devtool: ide-sdk python 3.12 escaping
scripts/lib/devtool/ide_sdk.py:709: SyntaxWarning: invalid escape sequence '\.'
  re_so = re.compile('.*\.so[.0-9]*$')

scripts/lib/devtool/ide_plugins/__init__.py:87: SyntaxWarning: invalid escape sequence '\$'
  gdbserver_cmd_start += "test -f \$TEMP_DIR/pid && exit 0; "

scripts/lib/devtool/ide_plugins/__init__.py:88: SyntaxWarning: invalid escape sequence '\$'
  gdbserver_cmd_start += "mkdir -p \$TEMP_DIR; "

scripts/lib/devtool/ide_plugins/__init__.py:89: SyntaxWarning: invalid escape sequence '\$'
  gdbserver_cmd_start += "%s --multi :%s > \$TEMP_DIR/log 2>&1 & " % (

scripts/lib/devtool/ide_plugins/__init__.py:91: SyntaxWarning: invalid escape sequence '\$'
  gdbserver_cmd_start += "echo \$! > \$TEMP_DIR/pid;"

scripts/lib/devtool/ide_plugins/__init__.py:94: SyntaxWarning: invalid escape sequence '\$'
  gdbserver_cmd_stop += "test -f \$TEMP_DIR/pid && kill \$(cat \$TEMP_DIR/pid); "

scripts/lib/devtool/ide_plugins/__init__.py:95: SyntaxWarning: invalid escape sequence '\$'
  gdbserver_cmd_stop += "rm -rf \$TEMP_DIR; "

(From OE-Core rev: e8c64921de7206bf617fc42433286867ae3c931d)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-24 16:10:23 +00:00
Enguerrand de Ribaucourt
e2f8ed72dd devtool: ide: define compilerPath for meson projects
The compile_commands.json file output by meson uses the compiler as if
present in the $PATH. However, when using an IDE, the $PATH used by
bitbake is not there.

The vscode-cpptools now allows to define the compilerPath in addition
to replace the one from compile_commands.json.

(From OE-Core rev: d9f5c27c8beee07c7cbbed11f5d45058e7315846)

Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-23 14:29:03 +00:00
Enguerrand de Ribaucourt
c0d340c52e devtool: ide: vscode: Configure read-only files
When debugging or browsing files, the user may fall into external
sources from other packages in the sysroot or dbg-rootfs. Modifying them
will only lead to confusion since they will be overwritten by Yocto. The
user should open them in a separate devtool modify session if they want
to make changes. Meanwhile, we should prevent write access to them.

(From OE-Core rev: 8a95ad9aecb81732c865e00a987bb8bd3d6cb91d)

Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-20 12:58:41 +00:00
Enguerrand de Ribaucourt
8e84fbba72 devtool: ide_sdk: Use bitbake's python3 for generated scripts
The generated scripts use the sys.path configuration found inside
bitbake. It can be a different python version than the one used on the
host through the IDE.

For instance, when running the generated script
deploy_target_cmake-example-core2-64 from an eSDK generated on another
machine, I got the following exception:
    AssertionError: SRE module mismatch

We need to match the sys.executable to the sys.path.

(From OE-Core rev: 45704319661570b45ef69fddd6b4b4fa22ca80d1)

Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-20 12:58:41 +00:00
Tim Orling
9f7475b4e5 recipetool; add support for python_mesonpy class
* Add support to detect the "mesonpy" build-backend for recipetool create.
* Add oe-selftest case for creating a recipe for "siphash24" from pypi.
  https://pypi.org/project/siphash24/

This is by far the simplest recipe using the mesonpy build backend.

Upstream does not provide LICENSE file(s) and we do not detect the
LICENSE so don't check for that result in the test. Likewise, upstream
does not define HOMEPAGE, so skip that result.

(From OE-Core rev: 256749322671d2f4ea994db671d73c4de10e1723)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-20 11:39:45 +00:00
Peter Kjellerstedt
4cfd0f7e4e lib/oe/patch: Use git notes to store the filenames for the patches
The old way of keeping track of the filenames for the patches that
correspond to the commits was to add a special comment line to the end
of the commit message, e.g., "%% original patch: <filename>", using a
temporary git hook. This method had some drawbacks, e.g.:

* It caused problems if one wanted to push the commits upstream as the
  comment line had to be manually removed.
* The comment line would end up in patches if someone used git
  format-path rather than devtool finish to generate the patches.
* The comment line could interfere with global Git hooks used to
  validate the format of the Git commit message.
* When regenerating patches with `devtool finish --force-patch-refresh`,
  the process typically resulted in adding empty lines to the end of the
  commit messages in the updated patches.

A better way of keeping track of the patch filenames is to use Git
notes. This way the commit messages remain unaffected, but the
information is still shown when, e.g., doing `git log`. A special Git
notes space, refs/notes/devtool, is used to not intefere with the
default Git notes. It is configured to be shown in, e.g., `git log` and
to survive rewrites (i.e., `git commit --amend` and `git rebase`).

Since there is no longer any need for a temporary Git hook, the code
that manipulated the .git/hooks directory has also been removed. To
avoid potential problems due to global Git hooks, --no-verify was added
to the `git commit` command.

To not cause troubles for those who have done `devtool modify` for a
recipe with the old solution and then do `devtool finish` with the new
solution, the code will fall back to look for the old strings in the
commit message if no Git note can be found.

While not technically motivated like above, the way to keep track of
ignored commits is also changed to use Git notes to avoid having
different methods to store similar information.

(From OE-Core rev: f5e6183b9557477bef74024a587de0bfcc2b7c0d)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19 16:03:22 +00:00
Peter Kjellerstedt
85b5e87c7d devtool: Make use of oe.patch.GitApplyTree.commitIgnored()
This makes use of the oe.patch.GitApplyTree.commitIgnored() function to
create commits that shall be ignored by `devtool finish`.

(From OE-Core rev: 4e1b9289450b5e7946bd5999c95a3ee214aab8a5)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19 16:03:22 +00:00
Peter Kjellerstedt
09839f6a8a devtool: _extract_source: Correct the removal of an old backup directory
Also correct the comment describing what is happening.

(From OE-Core rev: 7d867753fba8d536bef4c72c7bea3f4ed26a1a95)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-18 22:02:40 +00:00
Peter Kjellerstedt
890446392b devtool: standard: Add some missing whitespace
Makes it a little bit easier when reading the code.

(From OE-Core rev: 6a757f9648685448fd18507f6aaf4eed0a57579f)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-18 07:34:42 +00:00
Adrian Freihofer
539c880126 devtool: ide-sdk make deploy-target quicker
(From OE-Core rev: 3b63e7adb5596739b846396304ff815859ce6a74)

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>
2024-02-18 07:34:42 +00:00
Adrian Freihofer
3ccb4d8ab1 devtool: new ide-sdk plugin
The new devtool ide plugin provides the eSDK and configures an IDE to
work with the eSDK. In doing so, bitbake should be used to generate the
IDE configuration and update the SDK, but it should no longer play a
role when working on the source code. The work on the source code should
take place exclusively with the IDE, which, for example, calls cmake
directly to compile the code and execute the unit tests from the IDE.

The plugin works for recipes inheriting the cmake or the meson bbclass.
Support for more programming languages and build tools may be added in
the future.

There are various IDEs that can be used for the development of embedded
Linux applications. Therefore, devtool ide-sdk, like devtool itself,
supports plugins to support IDEs.
VSCode is the default IDE for this first implementation. Additionally,
some generic helper scripts can be generated with --ide none instead of
a specific IDE configuration. This can be used for any IDE that
supports calling some scripts.

There are two different modes supported:

- devtool modify mode (default):
  devtool ide-sdk configures the IDE to manage the build-tool used by the
  recipe (e.g. cmake or meson). The workflow looks like:
    $ devtool modify a-recipe
    $ devtool ide-sdk a-recipe a-image
    $ code "$BUILDDIR/workspace/sources/a-recipe"
    Work in VSCode, after installing the proposed plugins

  Deploying the artifacts to the target device and running a remote
  debugging session is supported as well.
  This first implementation still calls bitbake and devtool to copy the
  binary artifacts to the target device. In contrast to compiling,
  installation and copying must be performed with the file rights of the
  target device. The pseudo tool must be used for this. Therefore
  bitbake -c install a-recipe && devtool deploy-target a-recipe
  are called by the IDE for the deployment. This might be improved later
  on.

  Executing the unit tests out of the IDE is supported via Qemu user if
  the build tool supports that. CMake (if cmake-qemu.bbclass is
  inherited) and Meson support Qemu usermode.

- Shared sysroots mode: bootstraps the eSDK with shared sysroots for
  all the recipes passed to devtool ide-sdk. This is basically a wrapper
  for bitbake meta-ide-support && bitbake build-sysroots. The workflow
  looks like:
    $ devtool ide-sdk --share-sysroots a-recipe another-recipe
    vscode where/the/sources/are
  If the IDE and the build tool support it, the IDE gets configured to
  offer the cross tool-chain provided by the eSDK. In case of VSCode and
  cmake a cmake-kit is generated. This offers to use the cross
  tool-chain from the UI of the IDE.

Many thanks to Enguerrand de Ribaucourt for testing and bug fixing.

(From OE-Core rev: 3f8af7a36589cd05fd07d16cbdd03d6b3dff1f82)

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>
2024-02-18 07:34:42 +00:00
Peter Kjellerstedt
37aa0e077a devtool: modify: Correct appending of type=git-dependency to URIs
A missing space when using :append would lead to run-on URIs if there
was no whitespace at the end of the original SRC_URI.

(From OE-Core rev: 4de0c679e4b1a3cb394f348d625b97ad73f1efe7)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-16 15:14:26 +00:00
Adrian Freihofer
605ef6f5a2 scripts: python 3.12 regex
All the regexes throw a warning like this:

WARNING: scripts/lib/recipetool/create_buildsys.py:140:
      SyntaxWarning: invalid escape sequence '\s'
      proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE)

Python 3 interprets string literals as Unicode strings, and therefore
\s is treated as an escaped Unicode character which is not correct.
Declaring the RegEx pattern as a raw string instead of unicode is
required for Python 3.

(From OE-Core rev: 24b0ba00d4f0b4d9834f7693ecb6032dfc534a80)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-13 13:51:41 +00:00
Ross Burton
c472b4ce59 recipetool: don't dump stack traces if a toml parser can't be found
If we can't find tomllib or tomli then we can just tell the user politely
that we can't parse the pyproject.toml file, there's no need to dump
exception stack traces.

Move the parser exception handler to catch the actual parse, as otherwise
it will never be used.

Whilst here, also add some debug statements to make it clear what of the
handlers is being called.

(From OE-Core rev: 1a3ba4c312844d80ae382912b319e60ad8b30737)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-10 14:13:24 +00:00
Adrian Freihofer
233d2d8c0d recipetool: cleanup imports
- os is missing
- glob is not used

(From OE-Core rev: f560bc8972e97d2e497d7b976586e4a79ffc74ec)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-08 23:14:51 +00:00
Adithya Balakumar
e685773513 wic: implement reproducible Disk GUID
GPT based disks have a disk guid apart from the 32-bit disk identifier.
This commit implements reproducible disk guid by using SOURCE_DATE_EPOCH (if available) value as a random seed

(From OE-Core rev: 150e079589e207fe174d2dceb40cd8f3d3972c5a)

Signed-off-by: Adithya Balakumar <Adithya.Balakumar@toshiba-tsip.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-08 10:53:13 +00:00
Adrian Freihofer
c2813a4c69 devtool: refactor deploy-target
Make the deploy function independent from d. This allows to call the
function also from Python code not running in bitbake.
This is needed to for the devtool ide plugin which will call the
do_install task and the code from devtool deploy-target independently
from a bitbake server. This allows a much quicker workflow.

(From OE-Core rev: c8697d1132cbd4b2a2502b4c48e7d91fc18de786)

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>
2024-02-02 10:38:28 +00:00
Adrian Freihofer
50618e59dd devtool: refactor deploy to use exec_fakeroot_no_d
This is a step towards a deploy function which can be called without
passing the d variable.

(From OE-Core rev: 3e8c41ec373a1766f68932d3b979d00e4e3bb3a9)

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>
2024-02-02 10:38:28 +00:00
Adrian Freihofer
c17ce99a2f devtool: refactor exec_fakeroot
Provide a function exec_fakeroot_no_d which does the same like
exec_fakeroot does, but is usable independenlty from bitbake. This
allows to use the fanction from scripts where the d variable is not
available.

(From OE-Core rev: 6f5980d96844559639fc3660bb975b0bdd1aa523)

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>
2024-02-02 10:38:28 +00:00
Julien Stephan
facab170b6 devtool: modify: add support for multiple source in SRC_URI
[YOCTO #15162]

when doing devtool modify, sources are extracted into a devtool
temporary workdir. The main source is moved inside
build/workspace/sources/${BPN}/ and local files are moved inside
build/workspace/sources/${BPN}/oe-local-files. Secondary sources are
currently not handled and are lost.

Here is the output of devtool modify/build on bzip2 recipe:

NOTE: bzip2: compiling from external source tree <...>/build/workspace/sources/bzip2
ERROR: bzip2-1.0.8-r0 do_install_ptest_base: ExecutionError('<...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368', 1, None, None)
ERROR: Logfile of failure stored in: <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/log.do_install_ptest_base.3368
Log data follows:
| DEBUG: Executing shell function do_install_ptest_base
| NOTE: make -j 16 DESTDIR=<...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest install-ptest
| sed  -n '/^runtest:/,/^install-ptest:/{/^install-ptest:/!p}' \
|            ../../../../../../workspace/sources/bzip2/Makefile.am      > <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/Makefile
| cp ../../../../../../workspace/sources/bzip2/sample1.ref      <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/
| cp ../../../../../../workspace/sources/bzip2/sample2.ref      <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/
| cp ../../../../../../workspace/sources/bzip2/sample3.ref      <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/
| cp ../../../../../../workspace/sources/bzip2/sample1.bz2      <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/
| cp ../../../../../../workspace/sources/bzip2/sample2.bz2      <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/
| cp ../../../../../../workspace/sources/bzip2/sample3.bz2      <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/
| ln -s /usr/bin/bzip2          <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/bzip2
| cp: cannot stat '<...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/git/commons-compress': No such file or directory
| WARNING: <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368:189 exit 1 from 'cp -r <...>/build/tmp/work/core2-64-poky-linux/bzip2/
1.0.8/git/commons-compress <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/bzip2-tests/commons-compress'
| WARNING: Backtrace (BB generated script):
|       #1: do_install_ptest, <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368, line 189
|       #2: do_install_ptest_base, <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368, line 158
|       #3: main, <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368, line 226
ERROR: Task (<...>/poky/meta/recipes-extended/bzip2/bzip2_1.0.8.bb:do_install_ptest_base) failed with exit code '1'
NOTE: Tasks Summary: Attempted 776 tasks of which 765 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  <...>/poky/meta/recipes-extended/bzip2/bzip2_1.0.8.bb:do_install_ptest_base

externalsrc class modify SRC_URI to keep only:
* 'file', 'npmsw' and 'crate' sources
* url with type parameter matching 'kmeta' or 'git-dependency'

So by forcing to add type='git-dependency' on secondary sources, we
ensure that when building the recipe, the secondary sources can be
unpacked into WORKDIR.

This allows recipes containing several sources to be built under a
devtool context, but it has some limitations:
* user would not be able to generate patches for the secondary sources
* type="git-dependency" is added for secondary sources even on non git
  sources, so we may want to rename this parameter

(From OE-Core rev: cfd5ee890163a3d975093359016dda104e7b71df)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-24 15:46:19 +00:00
Vyacheslav Yurkov
5eb10c53d8 recipetool: Disregard version in URL for replaced modules
Major module version is a part of name, but not necessary part of the
actual URL (See https://go.dev/ref/mod#module-path).

Nevertheless, name detection function can't handle that suffix, so get
rid of it to determine component name.

For replaced modules that name might be different that the actual module
name defined in go.mod file.

(From OE-Core rev: 0cccfa1041d48f0ae3a2dc89a129cf7884fc08f0)

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-19 12:21:22 +00:00
Vyacheslav Yurkov
0576bd1edd recipetool: Proceed even with a missing license file
Whenever the recipe uses a CLOSED license, the list is going to be
empty. It's a discouraged practice not to have a license, but proceed
anyway to finish recipe generation.

(From OE-Core rev: 5ca920284d0946346f5b06f5e443c80d9d8b85ce)

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-19 12:21:22 +00:00
Vyacheslav Yurkov
0161d08ac9 recipetool: Don't fail on local go modules
Local modules are usually referenced with a 'replace' directive in
go.mod file. If that's the case, remove them from populating SRC_URI.

(From OE-Core rev: 9f220f61e3e44a650a46ee997b47f1d87b7c4ef0)

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-19 12:21:22 +00:00
Alexander Kanavin
f01ea3700e devtool/standard: correctly escape \
python 3.12 points out that:

SyntaxWarning: invalid escape sequence '\*'

(From OE-Core rev: bafb4b4edb4fb7908fdda272b7b2c2cbdef4728b)

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>
2024-01-09 22:59:28 +00:00
Jamin Lin
64d5db2f89 devtool: modify: fix exception
Root Cause:
initial_revs is an empty dictionary and do not have "." key.

Traceback (most recent call last):
  File "scripts/devtool", line 349, in <module>
    ret = main()
  File "scripts/devtool", line 336, in main
    ret = args.func(args, config, basepath, workspace)
  File "scripts/lib/devtool/standard.py", line 922, in modify
    if not initial_revs["."]:
KeyError: '.'

Solution:
check key exists, then get its value.

(From OE-Core rev: fb0db5c48abb4d56233a175fdd349d18b972e452)

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-07 12:24:57 +00:00
Chen Qi
bd05979aa8 devtool: use straight print in check-upgrade-status output
'devtool check-upgrade-status' is for reporting upgradable
status for recipes. The output should always be printed out. So
we should just use 'print' instead of 'logger.info' as the latter
will be suppressed if '-q' parameter is supplied to devtool.

(From OE-Core rev: 2c7bf9c8a833bec13a1ebabdce30933cbe691108)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-02 22:51:01 +00:00
Clay Chang
53b8ae2679 devtool: deploy: provide max_process to strip_execs
Use oe.utils.get_bb_number_threads to get max_process

(From OE-Core rev: f0056dca0a44c374f1f0c5fccbf66ae88e0b1850)

Signed-off-by: Clay Chang <clayc@hpe.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
venkata pyla
bc8ca0bacc wic: use E2FSPROGS_FAKE_TIME and hash_seed to generate reproducible ext4 images
E2FSPROGS_FAKE_TIME: sets fixed times for the inodes in the file system.
hash_seed: creates reproducible directory indexes in the file system.

Reference commit in e2fsprogs: e1f7100643a46456be107b33098f6034b0835e6d

(From OE-Core rev: bb822ab75de0020572058090439b93cc56bbf7e0)

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-21 10:38:30 +00:00
Tim Orling
9707dc5549 recipetool: add python_maturin support
Add the new python_maturin PEP-517 backend

Add selftest for 'pydantic-core' pypi package.

(From OE-Core rev: 69b679380616a94a631681caa05d9bf7610f9372)

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
Peter Kjellerstedt
53d45455a2 devtool: modify: Handle recipes with a menuconfig task correctly
This avoids the following error when running `devtool modify` on a
recipe that has a menuconfig task, but does not have
KCONFIG_CONFIG_ENABLE_MENUCONFIG set.

  .../temp/run.do_configure.4163366: line 152:
  ${@ oe.types.boolean('${KCONFIG_CONFIG_ENABLE_MENUCONFIG}') }: bad substitution
  WARNING: .../temp/run.do_configure.4163366:152 exit 1 from
  '[ ${@ oe.types.boolean('${KCONFIG_CONFIG_ENABLE_MENUCONFIG}') } = True ]'

(From OE-Core rev: e87e6fa84a0c4b5ac8e736dc62f6e08390ba2436)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-16 13:05:42 +00:00
Tim Orling
78ef0313ee recipetool: pypi: do not clobber SRC_URI checksums
The pypi change:
"85a2a6f68af recipetool: create_buildsys_python: add pypi support"
deleted all the SRC_URI variables, including the SRC_URI checksums.
These are not generated by the pypi.bbclass (how could they be trusted?)

Without the checksum(s), we are vulnerable to a man-in-the-middle attack
and zero checks on the validity of the downloaded tarball from pypi.org.

Fix by only setting S and SRC_URI to None.

(From OE-Core rev: 560181a52111569f7bc57b09139b42510e0d0325)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Peter Kjellerstedt
9a5c1456ba devtool: modify: Make --no-extract work again
This avoids the following error when using --no-extract, introduced in
commit 900129cbdf (devtool: add support for git submodules):

  Traceback (most recent call last):
    File ".../scripts/devtool", line 349, in <module>
      ret = main()
    File ".../scripts/devtool", line 336, in main
      ret = args.func(args, config, basepath, workspace)
    File ".../scripts/lib/devtool/standard.py", line 995, in modify
      for commit in commits[name]:
  KeyError: '.'

(From OE-Core rev: 6a44fb10ef4b90ee24f470362007d56183abc593)

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-12-08 16:58:34 +00:00
Peter Kjellerstedt
dd2fb8f00a devtool: upgrade: Update all existing checksums for the SRC_URI
In addition to updating the sha256sum and removing the md5sum, update
all other existing checksums. If the only existing checksum is md5sum,
then replace it with the default expected checksums (currently only
sha256sum).

(From OE-Core rev: 8ea8827ee49b7f0443b1c4bd47d1344a689d73a3)

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-12-08 16:58:34 +00:00
Peter Kjellerstedt
45d2f8d4bc recipetool: create: Only include the expected SRC_URI checksums
Rather than including all SRC_URI checksums, include the ones that are
expected. These are the same as are output if no checksums are included
when building the recipe.

(From OE-Core rev: c2af83eb5e8573480179b6c0bcce50606b547099)

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-12-08 16:58:34 +00:00
Peter Kjellerstedt
decf6e66df recipetool: create: Improve identification of licenses
Rather than having a static list of crunched MD5 checksums for some of
the most common licenses, calculate it for all common licenses. This
should improve the identification of license text variantions.

(From OE-Core rev: 377f9513dc56e9b8e5f5813c1535be0206756949)

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-12-08 16:58:34 +00:00
Julien Stephan
bc9291c5fd recipetool: appendsrcfile(s): add a mode to update the recipe itself
Add a new option -u/--update-recipe to update the recipe itself instead
of creating/updating a bbappend file

(From OE-Core rev: c9a80f55ed0bf9ce249205d6a9ba670fbb7f59ba)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:50 +00:00
Julien Stephan
29dc0d7315 recipetool: appendsrcfile(s): use params instead of extraline
appendsrc function relies on oe.recipeutils.bbappend_recipe to
copy files and add the corresponding entries in SRC_URI.

Currently, appendsrc function build itself the new SRC_URI entry to add the
correct subdir param, and gives it using the extralines parameter.
This has 2 drawbacks:
- oe.recipeutils.bbappend_recipe can already do this if we specify the
  correct params, so we have duplicate code
- the duplicated code is not fully functional: for example, it doesn't
  take into account the -m/--machine parameter

So fix this by not using extralines but give correctly formatted params.

Also remove the check for already existing entries as
oe.recipeutils.bbappend_recipe already implement it

The new bbappend file now have the SRC_URI entry after the
FILESEXTRAPATHS so fix the selftest.

Update test_recipetool_appendsrcfile_existing_in_src_uri_diff_params
test because recipetool appendsrcfiles used to not add new src_uri entry
if the entry already exist even with different parameters while
oe.recipeutils.bbappend_recipe adds it if parameters are different (and
remove the old entry)

(From OE-Core rev: cd5de8d53849a6f3bb6f82e45fb301e39892c789)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
de5ab8e863 recipetool: appendsrcfile(s): add dry-run mode
Add dry-run mode for recipetool appendsrcfile and appendsrcfiles, with
if necessary, a diff of changes

(From OE-Core rev: 456c726e6b52f4dc57ff605e1cf1687097537002)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Malte Schmidt
29b2bda786 wic: extend empty plugin with options to write zeros to partiton
Adds features to explicitly write zeros to the start of the
partition. This is useful to overwrite old content like
filesystem signatures which may be re-recognized otherwise.

The new features can be enabled with
'--soucreparams="[fill|size=<N>[S|s|K|k|M|G]][,][bs=<N>[S|s|K|k|M|G]]"'
Conflicting or missing options throw errors.

The features are:
- fill
  Fill the entire partition with zeros. Requires '--fixed-size' option
  to be set.
- size=<N>[S|s|K|k|M|G]
  Set the first N bytes of the partition to zero. Default unit is 'K'.
- bs=<N>[S|s|K|k|M|G]
  Write at most N bytes at a time during source file creation.
  Defaults to '1M'. Default unit is 'K'.

(From OE-Core rev: d19d4529e7a2056caeb526fed980cc1df19a5f6e)

Signed-off-by: Malte Schmidt <malte.schmidt@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-12-06 22:55:49 +00:00
Julien Stephan
85a2a6f68a recipetool: create_buildsys_python: add pypi support
Today, we can use devtool/recipetool to create recipes for python projects
using the github url or the direct release tarball of the project, but the
create_buildsys_python plugin doesn't support the pypi class, since we cannot
know from the extracted source if the package is available on pypi or not.

By implementing the new optional process_url callback, we can detect
that the url is a pypi one (i.e 'https://pypi.org/project/<package>')
and retrieve the release tarball location.
Also detect if the url points to a release tarball hosted on
"files.pythonhosted.iorg" (i.e https://files.pythonhosted.org/packages/...)

In both cases, adds the pypi class, remove 'S' and 'SRC_URIxxx'
variables from the created recipe as they will be handled by the pypi class
and add the PYPI_PACKAGE variable

This helps to produce cleaner recipes when package is hosted on pypi.

If the url points to a github url or a release tarball not coming from
"files.pythonhosted.org", the created recipe is the same as before.
One can also use the newly added "--no-pypi" switch to NOT inherit
from pypi class on matching url, to keep legacy behaviour.

To create a recipe for a pypi package, one can now use one of the
new following syntax (using recipetool create / devtool add):

* recipetool create https://pypi.org/project/<package>
* recipetool create https://pypi.org/project/<package>/<version>
* recipetool create https://pypi.org/project/<package> --version <version>

or the old syntax:
* recipetool create https://files.pythonhosted.org/packages/<...>

(From OE-Core rev: 097a43846cd99a7d74d004efc57f583ce78970a4)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
6c06fb0a43 recipetool: create: add new optional process_url callback for plugins
Add a new process_url callback that plugins can optionally implement if
they which to handle url.

Plugins can implement this callback for example, to:
* transform the url
* add special variables using extravalues
* add extra classes
* ...

If a plugin handles the url, it must append 'url' to the handled
list and must return the fetchuri

No functional changes expected for plugins non implementing this
optional callback

(From OE-Core rev: 3e5ce351e7dbe283562bf1db1f2ce3b121c49b53)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
86b9510bd3 recipetool: create: add trailing newlines
create_recipe() function relies on oe.recipeutils.patch_recipe_lines()
which relies on bb.utils.edit_metadata(). edit_metada expect lines to
have trailing newlines, so add it to each lines before calling
patch_recipe_lines, otherwise edit_metadata will not be able to squash
blank line if there are two consecutive blanks after a removal

(From OE-Core rev: 31b27cc76a1b669e2b126c332608fd772c124d69)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
344e10a21b recipetool: create_buildsys_python.py: initialize metadata
In the case pyproject.toml doesn't contains metadatas, the metadata
variable is not initialized and the plugin throws an error and falls back
to another plugin, which is not the desired behaviour. So just ignore
metadata if we don't have them

(From OE-Core rev: 88d15877ba18309c521740d7a9649e14d77189bc)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Kareem Zarka
0a39f1aa09 wic: bootimg-efi: Make kernel image installation configurable
The issue with installing the kernel image to both rootfs
and boot partition is that some systems rely on the kernel image in
rootfs and not in the boot partition.
This leads to duplication of the kernel image, which can cause
unnecessary storage usage.
This patch provides a solution to the problem by adding a new
parameter "install-kernel-into-boot-dir" to the wic kickstart file.
If this parameter is set to 'true', the plugin will install the
kernel image to the boot partition. If the parameter is set to
'false', the plugin will skip installing the kernel image, avoiding
duplication.

(From OE-Core rev: d3599afe5f604ea5afd9411e114934dcb52b2d48)

Signed-off-by: Kareem Zarka <kareem.zarka@huawei.com>
Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-04 11:23:37 +00:00
Julien Stephan
89f1662484 devtool: add support for git submodules
Adding the support of submodules required a lot of changes on the
internal data structures:
* initial_rev/startcommit used as a starting point for looking at new
  / updated commits was replaced by a dictionary where the keys are the
  submodule name ("." for main repo) and the values are the
  initial_rev/startcommit

* the extractPatches function now extracts patch for the main repo and
  for all submodules and stores them in a hierarchical way describing the
    submodule path

* store initial_rev/commit also for all submodules inside the recipe
  bbappend file

* _export_patches now returns dictionaries that contains the 'patchdir'
  parameter (if any). This parameter is used to add the correct
  'patchdir=' parameter on the recipe

Also, recipe can extract a secondary git tree inside the workdir.

By default, at the end of the do_patch function, there is a hook in
devtool that commits everything that was modified to have a clean
repository. It uses the command: "git add .; git commit ..."

The issue here is that, it adds the secondary git tree as a submodule
but in a wrong way. Doing "git add <git dir>" declares a submodule but do
not adds a url associated to it, and all following "git submodule foreach"
commands will fail.

So detect that a git tree was extracted inside S and correctly add it
using "git submodule add <url> <path>", so that it will be considered as a
regular git submodule

(From OE-Core rev: 900129cbdf25297a42ab5dbd02d1adbea405c935)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-01 11:48:25 +00:00
Julien Stephan
17427db136 devtool: tag all submodules
In the case of a repository with submodules, we need to add the
"devtool-base" and "devtool-patched" tag on all submodules in order to
properly detect the added/removed/modified patches

(From OE-Core rev: 241da68805d177d4ec4b302c8a997645cc645286)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-01 11:48:25 +00:00
Julien Stephan
1ae4cc7a11 devtool: finish/update-recipe: restrict mode srcrev to recipes fetched from SCM
When specifying --mode / -m srcrev with devtool finish/update-recipe on
recipes that are not fetched from a SCM repository we get the following
error:

  Traceback (most recent call last):
  [..]
    File "<...>/poky/meta/lib/oe/patch.py", line 49, in runcmd
    raise CmdError(cmd, exitstatus >> 8, "stdout: %s\nstderr: %s" % (stdout, stderr))
oe.patch.CmdError: Command Error: 'sh -c 'git format-patch --no-signature --no-numbered INVALID -o /tmp/oepatchbj7pfmzj -- .'' exited with 0  Output:
stdout:
stderr: fatal: bad revision 'INVALID'

Fix this by adding a check and abort with a proper error message.

(From OE-Core rev: 5b77f60e85d07921ae5e808daa1fd7d8c3dc40ea)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-01 11:48:25 +00:00
Julien Stephan
fcff067407 devtool: fix update-recipe dry-run mode
When running devtool update-recipe with --mode=srcrev AND --append switch
in dry-run, we get the following error:

  Traceback (most recent call last):
  [...]
  Exception: destpath should be set here

Fix this by removing a misplaced else statement in _update_recipe_srcrev

(From OE-Core rev: 85ba125703d5b442133fd7c470b915460ee68ac9)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-30 08:43:04 +00:00
Malte Schmidt
5d12c0a3dc wic: rawcopy: add support for zstd decompression
Add support for zstd decompression in rawcopy plugin. zstd claims
to reach higher, uniform decompression rates.

(From OE-Core rev: 707471b71a417187f1e581d0c540e058825f7242)

Signed-off-by: Malte Schmidt <malte.schmidt@weidmueller.com>
Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-27 22:54:59 +00:00
Lukas Funke
7de36b25d1 recipetool: Add handler to create go recipes
[RP: Replace python 3.9 use of removeprefix()]
(From OE-Core rev: 049afb933f42851d56d2e6522150a32bcccf2a6f)

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-06 16:41:11 +00:00
Lukas Funke
f7f304fa3e recipetool: Ignore *.go files while scanning for licenses
(From OE-Core rev: 1765acc8bdc08e392daa8b77add8b4ce1a9e70b6)

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-06 16:41:11 +00:00
Alexis Lothoré
838b8e78dc scripts/resulttool: group all regressions in regression report
Commit c304fcbe05 introduced a grouping when
listing regressions. This grouping has been added only for ptests. It has
been observed that any other kind of tests could benefit from it. For
example, current regression reports can show the following:

1 regression(s) for oescripts.OEGitproxyTests.test_oegitproxy_proxy_dash
    oescripts.OEGitproxyTests.test_oegitproxy_proxy_dash: PASSED -> SKIPPED
1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_help
    oescripts.OEPybootchartguyTests.test_pybootchartguy_help: PASSED -> SKIPPED
1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_pdf_output
    oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_pdf_output: PASSED -> SKIPPED
1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_png_output
    oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_png_output: PASSED -> SKIPPED
1 regression(s) for oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_svg_output
    oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_svg_output: PASSED -> SKIPPED
[...]

This output is not so useful in its current state and should be grouped per
test type too.
Enable grouping for all kind of tests, to make it llok like the following
in reports:
5 regression(s) for oescripts
    oescripts.OEGitproxyTests.test_oegitproxy_proxy_dash: PASSED -> SKIPPED
    oescripts.OEPybootchartguyTests.test_pybootchartguy_help: PASSED -> SKIPPED
    oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_pdf_output: PASSED -> SKIPPED
    oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_png_output: PASSED -> SKIPPED
    oescripts.OEPybootchartguyTests.test_pybootchartguy_to_generate_build_svg_output: PASSED -> SKIPPED

(From OE-Core rev: 982798ef96e3a32bf15341bdd3bb7c4356709412)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-05 08:44:06 +00:00
Tim Orling
9ffac3fc3d recipetool: add python_hatchling support
One of the newer PEP-517 backends to be added was python_hatchling.bbclass
but it was not included in the recent improvements.

Add selftest for 'jsonschema' pypi package.

(From OE-Core rev: d99b4883b4fee82bc588fd235ba90fedf1550cb8)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-30 08:50:46 +00:00
Alexander Kanavin
2cf13f2513 lib/oe/sstatesig.py: dump locked.sigs.inc only when explicitly asked via -S lockedsigs
This was writing out locked-sigs.inc into cwd with every
'bitbake -S' invocation. When the intent is only to to get task
stamps (-S none), or print the difference between them (-S printdiff),
the file is unnecessary clutter.

A couple of selftests/scripts were however relying on this, so they're
adjusted to explicitly request the file.

eSDK code calls dump_lockedsigs() separately via
oe.copy_buildsystem.generate_locked_sigs() and so isn't affected.

(From OE-Core rev: ad57c3cac2a8d3e60222e3cca0685f582dcea135)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-27 10:53:43 +01:00
Julien Stephan
d4debbf5b7 recipetool/create_buildsys_python: add PEP517 support
Add basic support for PEP517 [1] for the 3 following backends that are
supported by bitbake:
  - setuptools.build_meta
  - poetry.core.masonry.api
  - flit_core.buildapi

If a pyproject.toml file is found, use it to create the recipe,
otherwise fallback to the old setup.py method.

Some projects can declare a minimal pyproject.toml file, and put all
the metadata in setup.py/setup.cfg/requirements.txt .. theses cases
are not handled. If a pyproject.toml file is found, assumes it has all
necessary metadata.

As for the old setup.py method, version numbers for dependencies are not
handled.

Some features may be missing, such as the extra dependencies.

[YOCTO #14737]

[1]: https://peps.python.org/pep-0517/

(From OE-Core rev: c7d8d15b2d0a9ecd210bd247fa0df31d9f458873)

Signed-off-by: Julien Stephan <jstephan@baylibre.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
Julien Stephan
e64e92f2de recipetool/create_buildsys_python: refactor code for futur PEP517 addition
In order to prepare the support for pyproject.toml (PEP517 [1]) enabled
projects, refactor the code and move setup.py specific code into a
specific class in order to allow sharing the PythonRecipeHandler class

No functionnal changes expected

[1]: https://peps.python.org/pep-0517/#source-tree

(From OE-Core rev: 2281e93347da4129062cfb40710df03c87c63168)

Signed-off-by: Julien Stephan <jstephan@baylibre.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
Julien Stephan
be129bd0bc recipetool/create_buildsys_python: prefix created recipes with python3-
By convention, all python recipes start with "python3-" so update
create_buildsys_python to do this

This rule doesn't apply for packages already starting with "python"

Update recipetool's selftest accordingly

(From OE-Core rev: b0d87440e610b80f763d09784d4a90a148bb3e7b)

Signed-off-by: Julien Stephan <jstephan@baylibre.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
Julien Stephan
0021e3573a recipetool/create_buildsys_python: fix license note
License field of setup is not always standardized, so we usually use the
classifier to determine the correct license format to use in the recipe.

A warning note is added above the LICENSE field of the create recipe
in case a license is provided in setup. But when the plugin is called,
"LICENSE =" is not yet present so we can never display this note.
Replace the "LICENSE =" condition with "##LICENSE_PLACEHOLDER##"
to actually be able to display the note message

(From OE-Core rev: b7c26ca2028aa60f740464de85a11a01a531f32e)

Signed-off-by: Julien Stephan <jstephan@baylibre.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
Alexis Lothoré
198110b1b9 scripts/resulttool: make additional info more compact
Since "matched" and "improved" tests are not as important as regressions,
reduce the place they take in the regression report:

- merge "matched" and "improved" tests, while removing the label
- add a single line of additional info per pair

Those changes make the "Matches and improvements" look like the following
sample:

oeselftest_almalinux-9.2_qemux86-64_20230910083156
oeselftest_almalinux-8.8_qemux86-64_20231018010951
    -> +7 test(s) present

oeselftest_almalinux-9.2_qemux86-64_20230911010538
oeselftest_debian-11_qemux86-64_20231017150459

oeselftest_debian-11_qemux86-64_20230910012927
oeselftest_debian-11_qemux86-64_20231017151319
    -> +7 test(s) present
[...]

(From OE-Core rev: 6de4426d9a7da67deed7d3a3918892fb56238ff3)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.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
Alexis Lothoré
faef63eab6 scripts/resulttool: rearrange regressions report order
Regressions reports currently reports matching pairs and improved pairs
first, then regressions.

Change order to print regressions first, which is the most valuable info in
the report, and then print improvements and matches at the bottom.

(From OE-Core rev: 599267467430e70fa4dc8ba6b2a8b126bf6da359)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.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
Alexis Lothoré
c304fcbe05 scripts/resulttool: limit the number of changes displayed per test
Most of the changes list generated in regression reports fall in one
of the two following categories:
- there is only a few (<10) changes listed and the info is
  valuable/relevant
- the list is huge (> 100 ? 1000 ?) and basically tells us that the whole
  tests category suffers the same status (test missing, test failing, test
  skipped, etc)

Prevent those huge, worthless lists by limiting the output for each test
group:
- current default limit is arbitrarily set to 50
- limit can still be overriden with a new "-l"/"--limit" flag, either with
  custom value, or with 0 to print the whole lists of changes
- limit is applied per test family: currently it distinguishes only types
  of ptests, but it can be adapted to other kind of tests

(From OE-Core rev: cec118406f3ad81cb4709f6e6ae1cef65799658e)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.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
André Draszik
c2e094ddfd wic: fix a typo in help output
(From OE-Core rev: 1c35beb935d42e200370b54f9aa3848b940966dd)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-10 12:56:39 +01:00
Marcus Flyckt
561c63e947 devtool/upgrade: check all git config locations
Fixes [YOCTO #15222]

In some situations its more practical to keep git configuration
at `/etc/gitconfig` instead of `$HOME/.gitconfig` (e.g., when mounting
git configuration into a docker container).

This change makes `devtool upgrade` consider any available
git configuration instead of only checking `--global`.

(From OE-Core rev: 30a9f7de45050c8bac49d4b37419cc2e067a75fa)

Signed-off-by: Marcus Flyckt <marcus.flyckt@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-08 13:05:25 +01:00
Chris Laplante
893e17f669 recipetool/create_buildsys_python: use importlib instead of imp
'imp' was deprecated in Python 3.4 and removed in 3.12. The
piece of importlib we use has been around since 3.3.

(From OE-Core rev: 457f0dad87b4e45a53865b5ad2c150215bd74019)

Signed-off-by: Chris Laplante <chris.laplante@agilent.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
Richard Purdie
141707c232 wic: Add console parameters to qemux86 canned-wks
Currently our wic test images boot up without kernel output on the consoles
which means we have no way to debug if anything goes wrong. Add the console
parameters runqemu would have added if the kernel wasn't built into an image
to improve our chances of debugging.

(From OE-Core rev: 63ea1efdaaf1173ef4f2f69b5a3403afef4b556a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-04 23:05:54 +01:00
Daniel Semkowicz
578a627081 wic: bootimg-partition: Fix file name in debug message
Debug message about using custom configuration file includes file name
with incorrect extension. Correct file name to "extlinux.conf".

(From OE-Core rev: dd63e1520454b2d53a48b72eaae126059af9809b)

Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-01 08:12:59 +01:00
Richard Purdie
d4f2f8269c recipetool/devtool: Ensure server knows about changed files
Bitbake has changed to require notification when metadata changes in the middle of tinfoil
sessions. Add the required function calls at the places metadata is changed.

(From OE-Core rev: e5574163ab49a8f51b2b34fd37acfd1cad9b7595)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-18 11:35:38 +01:00
Richard Purdie
9f47346129 devtool/build_sdk: Drop unused imports
Drop some unused imports.

(From OE-Core rev: 432446ef402ff42fe0c90172b77376fa5981524a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-18 08:53:10 +01:00
Alexander Kanavin
63e53fb8b6 build-sysroots: target or native sysroot population need to be selected explicitly
Running them in parallel is prone to races as postinsts from target sysroots
rely on executables from native sysroots which may or may not be fully prepared
yet. This was observed for example here:

https://autobuilder.yoctoproject.org/typhoon/#/builders/146/builds/468/steps/12/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/147/builds/467/steps/12/logs/stdio

(From OE-Core rev: 38d7a2e45b883cf999a86af05bcc0eaa875bb47c)

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-09-09 12:04:55 +01:00
Joshua Watt
93388921ab wic: Add gpt-hybrid partition layout
Add support for formatting a disk with a hybrid MBR & GPT partition
scheme. In this scheme, the primary partitioning method is GPT, but a
valid MBR header is also written than can point to a subset of the GPT
partitions on the disk (any partitions marked with the `--mbr` flag will
be included in this MBR). The primary purpose of this method is to allow
for SoCs that can only find a bootloader in an MBR partition to use GPT
once the bootloader is running. As an example, older versions of the
Raspberry Pi firmware can only parse MBR partitions to find a kernel (or
other bootloader like u-boot), but once those have booted GPT partitions
can be used.

In addition to the partitions annotated with the `--mbr`, a "protective"
GPT partition of type 0xEE is added, as the existence of such a
partition is the indication to tooling that this a hybrid MBR and that
the GPT partition table should be parsed instead.

(From OE-Core rev: e50e4c2a5ada6947b3503ca4d8e9c30d359e8a5d)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-02 11:47:50 +01:00