]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
scripts/runqemu: raise an error when bitbake was not found
authorRichard Grünert <r.gruenert@pironex.com>
Wed, 27 Aug 2025 06:49:40 +0000 (08:49 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 9 Oct 2025 09:27:02 +0000 (10:27 +0100)
commit0c10a78796fbdfaa5be4a824c0c9f5cb97c88046
tree5dc88884ba89ed5448e761f639e95df125e0c6a2
parentb931f74442e9f2fba95600ba056a5bd898c23b5a
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>
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>
scripts/runqemu