Commit Graph

3962 Commits

Author SHA1 Message Date
Yoann Congal
20c60e5ae3 oe-setup-layers: make "path" optional
Layer names and path are often redundant. Allow users to omit the path
key when it is equal to the layer name by using the layer name as a
default value for its path.

For example, from layers.example.json:
  "sources": {
      "meta-alex": {
          "path": "meta-alex"
      },
      "meta-intel": {
          "path": "meta-intel"
      },
      "poky": {
          "path": "poky"
      }
  },

Update the schema to stop requiring "path" and remove it in example for
"meta-intel".

(From OE-Core rev: 7f36f0526fae5a81f9bc02e16cc849a2b1ea5797)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-11-03 17:40:41 +00:00
Steffen Greber
e8f38f022e wic: add wic tests and support setting GPT diskid
Also extend implementation to allow defining the diskid for GPT partitions.

Add unit tests for wic.py to cover new setting.

(From OE-Core rev: 0d5da9477703212d3cfb63828c5c38afdb162e43)

Signed-off-by: Steffen Greber <sgreber@lilafast.org>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-30 11:06:28 +00:00
Khem Raj
fd1f5f958a devtool/ide_sdk: Fix help message syntax
(From OE-Core rev: 161cc3742e5a787beabfa6748547d93037185725)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-27 17:20:42 +00:00
Daniel Turull
6a2a827e9c improve_kernel_cve_report: add option to read debugsources.zstd
Adding option to be able to import debugsources.zstd directly.
The linux-yocto-debugsources.zstd is generated in every build and
does not require any additional configuration.

In contrast, SPDX_INCLUDE_COMPILED_SOURCES needs to be explicitly
added and increases build time.

(From OE-Core rev: c84a8958f30bbb982656ddcbe7476f6f81e1a6fb)

Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-27 17:20:42 +00:00
Johannes Schneider
2a695b15aa devtool: un-/deploy-target: put deploylist into destdir
When deploying on devices with a RO root-filesystem, devtool would
fail on writing to the hard-coded "deploylist_path = '/.devtool'"

Since devtool already supports deploying to a different root-prefix
with: hostname[:destdir], we can make use of this guaranteed RW
location to place the deployment-list there.

Add the destdir parameter to the _prepare_remote_script function, to
construct the deploylist_path from it. For the 'undeploy' the same
host:destdir splitting logic is used as in 'deploy'.

Now it is possible to modify and build a recipe 'foo-bar' with
devtool, and have its ./image content deployed through:
$build> devtool deploy foo-bar target:/opt/development-overlay
Or removed again with:
$build> devtool undeploy foo-bar target:/opt/development-overlay

(From OE-Core rev: 216a4c4a4ee58222127c830ac56126bdbb95308d)

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-27 17:20:42 +00:00
Steffen Greber
213d298940 wic: add option to specify the diskid
This adds a feature to specify the disk ID when creating a disk with
the wic tool. This is useful when using the DOS partition scheme and
booting with root=PARTUUID=<partuuid>. In DOS partitions, the partition
ID is <diskid>-<partition-number>, so it makes sense to let the user
define the disk ID.

You can specify it in the kickstart file using the --diskid argument
to the bootloader command. The value can be given in decimal or
hexadecimal format (e.g. 3735928559 or 0xdeadbeef). If omitted, the
previous behaviour does not change.

(From OE-Core rev: a31453fd52e0a52f3fa02cb9ae0878ea3782c2b7)

Signed-off-by: Steffen Greber <sgreber@lilafast.org>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-27 11:37:43 +00:00
Aleksandar Nikolic
adfee36276 scripts/install-buildtools: Update to 5.2.3
Update to the 5.2.3 release of the 5.2 series for buildtools

(From OE-Core rev: 4352f866b1a85107bba42a1557cbdc78bac34dba)

Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-09 10:58:07 +01:00
Richard Grünert
57d97d5970 scripts/runqemu: raise an error when bitbake was not found
Running 'scrupts/runqemu' without bitbake in PATH causes the
following error:

```
Traceback (most recent call last):
  File "/home/rg/temp_stuff/oe_2/./scripts/runqemu", line 1807, in main
    config.check_args()
    ~~~~~~~~~~~~~~~~~^^
  File "/home/rg/temp_stuff/oe_2/./scripts/runqemu", line 624, in check_args
    s = re.search('^DEPLOY_DIR_IMAGE="(.*)"', self.bitbake_e, re.M)
  File "/usr/lib/python3.13/re/__init__.py", line 177, in search
    return _compile(pattern, flags).search(string)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'
```

This patch adds a more helpful error message to inform the user that
bitbake was not found, e.g. because oe-init-build-env was not sourced.

This is an example of the new error message after the patch:

```
runqemu - ERROR - In order for this script to dynamically infer paths
 kernels or filesystem images, you either need bitbake in your PATH
 or to source oe-init-build-env before running this script.

 Dynamic path inference can be avoided by passing a *.qemuboot.conf to
 runqemu, i.e. `runqemu /path/to/my-image-name.qemuboot.conf`

 Bitbake is needed to run 'bitbake -e', but it is not found in PATH. Please source the bitbake build environment.
```

CC: Richard Purdie <richard.purdie@linuxfoundation.org>
CC: Alexander Kanavin <alex.kanavin@gmail.com>

(From OE-Core rev: 0c10a78796fbdfaa5be4a824c0c9f5cb97c88046)

Signed-off-by: Richard Grünert <r.gruenert@pironex.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-09 10:58:07 +01:00
Alexander Kanavin
21466040c3 scripts/runqemu: remove the code block that works around the missing bitbake environment
As confirmed by the previous patch this code path is never taken
and can be removed.

(From OE-Core rev: b931f74442e9f2fba95600ba056a5bd898c23b5a)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-09 10:58:07 +01:00
Alexander Kanavin
cb2567ad96 runqemu: ensure that bitbake environment is either returned, or an exception is raised
This eliminates the other remaining code path where environment getter
returns 'nothing'. This and the previous patch were tested in a-full,
and no errors occurred [1], which means the code paths that make
use of the function returning nothing are never actually executed
and can be cleaned up (in the following patch).

The rationale is that if environment getter cannot obtain the environment,
it should report that and not sweep the issue under the carpet;
it's up to the caller to handle that situation, or make pre-emptive
checks that avoid calling the environment getter when it is bound to fail.

[1] https://lists.openembedded.org/g/openembedded-core/message/223651

(From OE-Core rev: 8197be4dd336be2f8a646916223922da61c5b9b1)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-09 10:58:07 +01:00
Pierre-Loup GOSSE
c6f78e7d50 wic: extra partition plugin
The extra_partition plugin allows populating an extra partition with
files listed in the new IMAGE_EXTRA_PARTITION_FILES variable. The
implementation is similar to the bootimg_partition plugin.

This plugin provides an easy way to install files that are not part of
the rootfs, from the deploy directory.

(From OE-Core rev: 3892912bd7e047a3b122ae910ac5fbd5a85117b8)

Signed-off-by: Pierre-Loup GOSSE <pierre-loup.gosse@smile.fr>
Reviewed-by: Yoann CONGAL <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-06 23:15:59 +01:00
Adrian Freihofer
e9acea56bd devtool: ide_sdk: pass BITBAKEDIR to oe-init-build-env
This fixes an issue where the generated install_and_deploy script is
unable to find the bitbake directory when run outside of the build
environment. This happens if the oe-selftest suite runs in a bitbake
environment that is bootstrapped by bitbake-setup.

oe-selftest -r devtool.DevtoolIdeSdkTests.test_devtool_ide_sdk_none_qemu

AssertionError: Command '.../build-st/workspace/ide-sdk/cmake-example/
  scripts/install_and_deploy_cmake-example-cortexa57' returned non-zero exit status 1:
Error: The bitbake directory (/tmp/devtoolqakq7kzgeo/bitbake) does not exist!
  Please ensure a copy of bitbake exists at this location or specify an
  alternative path on the command line
. /tmp/devtoolqakq7kzgeo/core-copy/oe-init-build-env
  /home/adrian/bitbake-builds/poky-master-poky-with-sstate-distro_poky-altcfg-machine_qemuarm64/build-st
  failed

Another reason this issue occurs with oe-selftests is that devtool
tests assume the full poky git repository is available. The setUpModule
function clones layer repositories, which for poky includes bitbake.
However, when using separate git repositories for bitbake and
openembedded-core, the bitbake directory is not preserved during layer
copying. While copying layers to allow modification during tests makes
sense, copying bitbake is less beneficial. Referring to the original
bitbake location is preferable, but cleaning up the devtool tests is
not part of this change.

(From OE-Core rev: 602802754485631f4e49bc844e473bc3ba7d38a4)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-06 23:15:59 +01:00
Adrian Freihofer
4688d95518 devtool: ide-sdk: use /bin/sh instead of /bin/bash
When generating the install and deploy script for IDEs, use /bin/sh
instead of /bin/bash. While this is not addressing a known issue,
using the more portable /bin/sh shell is preferable and avoids
requiring bash to be installed.

(From OE-Core rev: 7db8dd3631d3fcd112631761d8aa12886213273c)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-06 23:15:59 +01:00
Adrian Freihofer
12049eb12c devtool: ide_sdk: trivial alphabetical reorder
(From OE-Core rev: 4623a1decfbcda82731670785e6c5a60c4cadef9)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-06 23:15:59 +01:00
Yoann Congal
a9266fa905 oe-setup-build: fix dash support
Being minimalist, dash does not support the (non-POSIX) feature of
passing an argument while sourcing a script. Like in
  . <some path>/oe-init-build-env <build dir>

With dash, one must instead use:
  cd <some path>
  set <build dir>       # puts <build dir> in $1
  . ./oe-init-build-env # can only be called from its directory in dash

oe-setup-build generate a sourcable "init-build-env" script, this script
must use the above snippet to be used in dash.

(From OE-Core rev: 35c90011824845b40066b7747b256f1cd31b0dba)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-01 10:52:54 +01:00
thomas.witte@liebherr.com
e88854c2de runqemu: add erofs filesystem types
runqemu does not recognize erofs, erofs-lz4, and erofs-lz4hc as filesystem types. Add them to start from an erofs filesystem without needing the full path.

(From OE-Core rev: 8d5654d21c021964794c84f594748f376c2b39fc)

Signed-off-by: Thomas Witte <thomas.witte@liebherr.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-22 22:09:48 +01:00
Trevor Woerner
fd740c664a patchtest.README: update selftest section
Update the "Running Patchtest Selftest to include a cmdline example of
runing the selftest.

(From OE-Core rev: 5b2153c8467657ffe490c6b10a260b63d93f3296)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-22 22:09:48 +01:00
Trevor Woerner
141a6f905d patchtest.README: update host mode section
Update the "Host Mode" section to provide more detail and exact steps
assuming the user is using a previously- or just-installed patchtest
following the steps outlined in the "Installation" section above in the
same document.

(From OE-Core rev: 29402e3fdf161b348ba6c01d3994bdf96a9e3d95)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-22 22:09:48 +01:00
Trevor Woerner
9cfbed3d27 patchtest.README: expand obtaining patches
Expand the section on how to obtain patches with more methods, expanded
explanations, and detailed steps. The suggested set of methods include:
b4, git-pw, "git format-patch", and MUA programs.

(From OE-Core rev: 9779bbfc047f62adedbdb5592389668220f7080e)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-22 22:09:48 +01:00
Trevor Woerner
ed8544941b patchtest.README: update installation instructions
Update the installation instructions to demonstrate using a Python
virtual environment to install the patchtest module dependencies. Also
provide example #exactsteps. Using a virtual environment is considered a
best practice for Python programs, but also makes the git-pw tool
available in the user's PATH automatically.

(From OE-Core rev: 82d5797c2bc40f0465e57dbc745f3ccccfed1067)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-22 22:09:48 +01:00
Trevor Woerner
cd493181d7 patchtest.README: update name and location or patchtest layer
The patchtest layer's name and location have changed from:
  patchtest
  https://git.yoctoproject.org/patchtest
to:
  meta-patchtest
  https://git.yoctoproject.org/meta-patchtest

Update any references of the old name and repository to the new ones.

(From OE-Core rev: 166e52103d17c9eeec3666967c2580008f992481)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-22 22:09:48 +01:00
Trevor Woerner
45c7810b4f patchtest.README: trivial fixes
Fix two small, trivial issues in the README.

(From OE-Core rev: 645d8a927b679a33d6a81aca2ae0ce1be84ad65d)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-22 22:09:48 +01:00
Chris Laplante
5c4a0dbcac devtool: __init__: simplify replace_from_file
Mostly just remove some useless helper functions

(From OE-Core rev: b27b1083f59cf0a268e9b141568119f257002d13)

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-09-18 11:16:42 +01:00
Chris Laplante
bde1f02b3f devtool: __init__: small cleanups
+ Remove unused exec_fakeroot method, which wouldn't
  work anyway since it doesn't pass kwargs correctly.

+ Fix a None comparison

(From OE-Core rev: bff3a3d9f8fa695fa05d91419d995de4c8009d9b)

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-09-18 11:16:42 +01:00
Chris Laplante
e96eb61680 devtool: __init__: cleanup imports, including a missing 'import errno'
(From OE-Core rev: 9be824a14ea61ea97d717d25058231f9f09f07a0)

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-09-18 11:16:42 +01:00
Ross Burton
a32f0fc0b7 wic: add --extra-space back for compatibility
The --extra-space argument was renamed to --extra-filesystem-space to
be clear what space is being added to, but this breaks existing wic
files.

Add back --extra-space as an alias for --extra-file-system-space so that
existing wks files don't fail.

[1] oe-core 39d10137b86 ("wic: rename wks flag --extra-space to --extra-filesystem-space")

(From OE-Core rev: 1d2a714fbe96fa3115fafb1d4d29667b6ae4a881)

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>
2025-09-15 17:57:23 +01:00
Jose Quaresma
7882955c3b yocto-check-layer: show the distro used
It is good to know which distribution is being used, because it is not the same
whether we are using the poky or openembedded-core+bitbake repository.

The default distribution of bitbake is the nodistro while the other is poky.
The nodistro and poky produce different results when used to check the compatibility
of a layer so it is important to inform about the distro in use.

(From OE-Core rev: bcc74229e6d5a716a9f65546665a42478295dece)

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-11 11:31:57 +01:00
Trevor Woerner
3e07b2e323 wic: partition.py: fix help string
The help suggests invoking 'wic help source-plugins' for information on how to
add a new plugin, this results in:

	usage: wic help [-h] {plugins,overview,kickstart,create,ls,cp,rm,write,list} ...
	wic help: error: argument help_topic: invalid choice: 'source-plugins' (choose from 'plugins', 'overview', 'kickstart', 'create', 'ls', 'cp', 'rm', 'write', 'list')

The proper command is 'wic help plugins'.

(From OE-Core rev: 7e5c7633a3cb7f1718f40ba63ecc30bb8ea07928)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-11 11:31:55 +01:00
Pierre-Loup GOSSE
468bcd1950 wic: rename wks flag --extra-space to --extra-filesystem-space
Makes a clear distinction with --extra-partition-space flag.

(From OE-Core rev: 39d10137b86ebb6d1f20c36ae50a7771e6c76251)

Signed-off-by: Pierre-Loup GOSSE <pierre-loup.gosse@smile.fr>

CC: Alexander Kanavin <alex.kanavin@gmail.com>
CC: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-08 18:02:39 +01:00
Pierre-Loup GOSSE
21d98bd960 wic: add --extra-partition-space option to set unused space
By default, the content of the partition is filled by the filesystem
without leaving any unused free space. The --extra-space flag adds
extra space to the filesystem size, not to the partition.

Unused free space after the filesystem can be useful for some cases,
such as encrypting a partition at runtime.
With --extra-partition-space 32M, we ensure that the last 32M of the
partition is unused: this space does not contain filesystem data and
can store the LUKS2 header.

The implementation sets a difference between the partition and
filesystem size:
  - With --fixed-size, the extra part space is removed from the
    filesystem size.
  - Otherwise (with or without --size flag), the extra part space is
    added to the partition size.

(From OE-Core rev: 22fd1702aedf40257aa53963b62b5ef1bbd2818a)

Signed-off-by: Pierre-Loup GOSSE <pierre-loup.gosse@smile.fr>

CC: Alexander Kanavin <alex.kanavin@gmail.com>
CC: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-08 18:02:39 +01:00
Christian Lindeberg
a25eb24eed recipetool/create_go: Tidy up a bit
There is no need for a temporary Go module cache after moving generation
of module dependency include files to go-mod-update-modules.bbclass.

(From OE-Core rev: 376ce22b3ba5286eda54d9f9bb1c4cd7f54ff9e7)

Signed-off-by: Christian Lindeberg <christian.lindeberg@axis.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-09-08 18:02:39 +01:00
Diego Sueiro
fb4ebd6053 wic: Fix --overhead-factor and --extra-space checks
If --overhead-factor and --extra-space are passed with =FOO the
check fails. Fix this by checking parsed.overhead_factor and
parsed.extra_space instead.

(From OE-Core rev: 46c24b67d4e9d28e7216a7394090d807cf879fa7)

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-25 17:47:21 +01:00
Vincent Davis Jr
c74dfd8f81 bootimg_pcbios: add help and usage comments
Adds comments underneath class declaration
defining plugin usage and potential
optional variables to set.

(From OE-Core rev: 6a8c350f595255b6febfdbc5af668286ccb973df)

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-14 10:31:11 +01:00
Vincent Davis Jr
a495fec1bf bootimg_pcbios: include grub as an optional bootloader
Commit adds in support for installation of both
grub and syslinux using newly added grub functions.

Due to the bootimg_biosplusefi source_params['loader']
had to be named source_params['loader-bios'] so not
to create conflict in the wics plugin.

Commits also adds ability to set and or not set
source_params. If source_params set check
for both
	* syslinux
	* grub

if not set default to using syslinux as bootloader.

(From OE-Core rev: 5caf6fe32aa4655f46fb7b490a22778c59b2efc0)

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-14 10:31:11 +01:00
Vincent Davis Jr
7f522461d2 bootimg_pcbios: add funcs to configure booting with grub
Functions added, but not executed during
wic image creation include:

_get_staging_libdir
	* Finds target lib directory if for some
	  reason STAGING_LIBDIR isn't set.

_do_configure_grub
	* Will search for a grub configuration passed via
	  bootloader --configfile. If not found build a
	  default one which searches for partition that
	  contains the given the kernel name via grub
	  search module.

_do_prepare_grub
	1. Sets default values for GRUB_MKIMAGE_FORMAT_PC
	   and GRUB_PREFIX_PATH if none specified. Both
	   variables are required by grub-mkimage.
	   * GRUB_MKIMAGE_FORMAT_PC is used to define
	     target platform.
	   * GRUB_PREFIX_PATH is used to define which
	     directory grub config and modules are going
	     to reside in.
	2. Generates grub config to embed into core.img.
	   This config is used to search for partition
	   containing grub config.
	3. Creates a custom core.img or grub stage 1.5
	   with an embedded grub config.
	4. Copies all the target built grub modules into
	   GRUB_PREFIX_PATH directory.
	5. Creates boot partition

_do_install_grub
	1. dd target platform specific boot.img to the first
	   0-440 bytes of the resulting wic image. dd grub
	   stage 1 to wic image. If this wics plugin is used
	   with GPT as partition table format and grub selected
	   as bootloader it's more than likely for grub hybrid
	   booting because bootimg_efi plugin should and more
	   than likely will be used in that case. So, boot.img
	   may be dd regardless if partition table format is
	   GPT or MBR.
	2. dd custom core.img (grub stage 1.5) with embedded
	   configuration to the resulting wic image starting
	   at byte 512 up to sizeof(core.img).
	3. Both boot.img and core.img are required for legacy
	   bios boot. See grub Wiki for more details on
	   boot.img and core.img.

	   https://en.wikipedia.org/wiki/GNU_GRUB

Commit also imports python modules required by the
above implemented functions.

(From OE-Core rev: 27c56962f47303cf49a4cf641e85239e4d7779b5)

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-14 10:31:11 +01:00
Vincent Davis Jr
8b64e77f00 bootimg_pcbios: cleanup prepare and install syslinux funcs
This commit:

1. Removes unrequired function params from
   	* _do_prepare_syslinux
   	* _do_install_syslinux
   Reason is that they aren't required by
   the function.
2. Moves finding of resulting wic image
   back into do_install_disk task. As
   the same code may be leverage to install
   other bootloaders to the resulting disk.

(From OE-Core rev: 27e3fc1ef5304278254d2288ffc99e1757dd4053)

Signed-off-by: Vincent Davis Jr. <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-14 10:31:11 +01:00
Vincent Davis Jr
a51e188be3 bootimg_pcbios: cleanup _do_configure_syslinux function
This commit:

1. Removes all unrequired function parameters.
   The part parameter was kept due to it's potential
   future usage in _do_configure_syslinux function.
   part.fstype specifically may be used with the
   rootfstype kernel paramater.

2. Sets a default timeout to 500 if bootloader --timeout
   not specified. To avoid 'None' being placed
   as the value in resulting configuartion file.
3. Sets a default kernel parameter string if
   bootloader --append not specified. This also
   helps avoid 'None' being places as the value
   in resulting configuration file.
4. Replace all instances of

   cr_workdir, "/hdd/boot"

   with variable

   hdddir

   as it's set at the top of the function. No,
   need to re-implement what the variable is
   already defined to store.

(From OE-Core rev: 5e17a1cf73d0542e0c7ec9333aaf20bbc45df8de)

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-14 10:31:11 +01:00
Vincent Davis Jr
2bcf99792b bootimg_pcbios: seperate bootloader config creation
Most bootloaders that will be included in this
wics plugin will require a configuration file
to define kernel params, execute custom
modules, or enable the ability to select
one of multiple boot entries.

Create a seperate generic function to facilitate
finding if a bootloader config file passed through
bootloader --configfile flag. So, that other functions
that are used to create/install a bootloader boot
configuration file can leverage the function.

(From OE-Core rev: 7944e29eb6ab7b80ad3847686dd780100623b196)

Signed-off-by: Vincent Davis Jr. <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-14 10:31:11 +01:00
Vincent Davis Jr
eb3df0324a bootimg_pcbios: move syslinux funcs to end of file
This commit moves the seperated syslinux creation
functions from their current position to end of
file in the order

	1. _do_configure_syslinux
	2. _do_prepare_syslinux
	3. _do_install_syslinux

This is to prepare for inclusion of other
bootloaders. It also makes reading
through the wics plugin much easier if
you group bootloader specific partition
creation functions together and place them
at the bottom of the file versus leaving
them in their current position.

(From OE-Core rev: 9034dd23e4240536a37a2290f2f2dd48d9bddd29)

Signed-off-by: Vincent Davis Jr. <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-14 10:31:11 +01:00
Vincent Davis Jr
336a252dbb bootimg_pcbios: move syslinux install into seperate functions
Current oe-core bootimg_pcbios wics plugin
only supports installing syslinux directly
into the resulting wic image.

This commit seperates syslinux installation from
class BootimgPcbiosPlugin(SourcePlugin) override
functions in preparation of supporting the installation
of other bootloaders to the resulting wics plugin
such as:
	* grub
	* extlinux

Being moved now to make it easier to include
future bootloaders.

(From OE-Core rev: 78addc3a7c2f036e8932305368acd6090937b62d)

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-14 10:31:11 +01:00
Tobias Pistora
4c7b000732 devtool: fix upgrade for recipes with git submodules
Fixes [YOCTO #15943]

Fixes invalid path argument while calling "git rev-list" from submodule folders.
Replaced the local __run() wrapper function with _run() at "git rev-list" command calls.

(From OE-Core rev: c1839a24f08a87984d475d23f37a7c923d424267)

Signed-off-by: Tobias Pistora <pistora.tobias@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-14 10:31:10 +01:00
Libo Chen
b36799ea7d runqemu: fix special characters bug
Fix the bug in runqemu that happens when the file path contains
the specific words such as 'vmlinux', e.g. /home/frank/vmlinux.

runqemu - ERROR - wic doesn't need kernel

(From OE-Core rev: 3c186fe7741adecb0887e36c8a9164a58fc16437)

Signed-off-by: Libo Chen <libo.chen.cn@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-07 12:11:16 +01:00
Yoann Congal
938abd7c30 runqemu: refactor a duplicated cleanup statement
Refactor using a "finally:" instead of a duplicated statement inside and
outside of the try/except block.

(From OE-Core rev: c92399c355d1333eff37ea799832a8890acd0d74)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-07 12:11:16 +01:00
Yoann Congal
b4eacbf7c1 runqemu: use "zstd -o" to preserve sparse images
wic images can be sparse. Using "zstd -o" preserves the sparse state of
the image and should decrease decompression time.

Suggested-by: Adrian Freihofer <adrian.freihofer@gmail.com>
(From OE-Core rev: 27d156d85f13131ea4c5d766ddaa2d18b88d7577)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-07 12:11:16 +01:00
Richard Purdie
23174f6494 scripts/runqemu: Update the fstypes list with newly supported compressed images types
Update the interal list of types within runqemu with the newly added
compression formats it supports.

This fixes autodetection of qemuboot file locations.

(From OE-Core rev: 46b9a1c74df00f76f7c19b5ed27e6a569aaabb5e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-06 22:32:41 +01:00
Yoann Congal
b034dcc314 runqemu: print snapshot mode state in console
With snapshot enabled, no change on rootfs will be saved after qemu
shutdown. Since this is not what a user might expect, print the snapshot
mode state and its consequence in console at runqemu start.

(From OE-Core rev: 57fe8538a87ff1f69f274d9692f038caed6cb5cd)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-06 22:32:41 +01:00
Yoann Congal
60676f12f2 runqemu: accept vmtypes and wictypes for rootfs paths extensions
When using a .wic.zst image, its fstype is detected by default as
".zst" which prevent booting correctly.

Fix this by adding wictypes (and vmtypes while at it) to the list of
known fstypes. After this fix, the initial fstype is correctly ".wic.zst".

(From OE-Core rev: 26b0922977d1bfcf47bbccf624be86e9e2b8815a)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-06 22:32:41 +01:00
Lamine REHAHLIA
820a6edcec runqemu: Add support for running compressed .zst rootfs images
Enhance runqemu to detect and decompress .zst-compressed rootfs images
(e.g. ext4.zst, wic.zst) automatically. If a decompressed image already
exists in the original directory, it will be reused to avoid overwriting
build artifacts. Otherwise, the image is decompressed and removed after
the QEMU session ends.

This allows runqemu to be used seamlessly with compressed image formats
generated by the build system or during releases.

Note: support for .zst images is only available when snapshot mode is
enabled

IMPORTANT:
This patch assumes that the original directory of the .zst-compressed
image is writable. If, for some reason, the path passed from CI or
another system to the script is read-only, the decompression step will
fail when trying to write the uncompressed image to the same directory.

(From OE-Core rev: e069fe2480c871c649b83f6278564a553cc3dd58)

Signed-off-by: Lamine REHAHLIA <lamine.rehahlia@smile.fr>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-08-06 22:32:41 +01:00
Aleksandar Nikolic
4070d8ec2a scripts/install-buildtools: Update to 5.2.2
Update to the 5.2.2 release of the 5.2 series for buildtools

(From OE-Core rev: 9a79f2b1b81a27e740d7e5e59d07a38da12faf7d)

Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-28 17:37:02 +01:00
Ross Burton
9eb9f13198 pybootchartgui: account for network stats when calculating extents
We could take into account the network device statistics when calculating
the size of the image, otherwise charts will be truncated.

(From OE-Core rev: 52806c2555d02d4a12e7419520a2aba05f7aaa06)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-07-28 14:51:50 +01:00