Commit Graph

25 Commits

Author SHA1 Message Date
Simon Glass
3a801fde21 scripts: Provide a way to use custom firmware
Update both build-efi and build-scripts to allow a -c option to provide
custom firmware. This makes the scripts more generally useful.

Drop the existing -c for --spice since it conflicts and is also is bit
hard to remember.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 06:09:52 -07:00
Simon Glass
2c415606fd scripts: Support --bootcmd more generally
Add -b as a short alias for --bootcmd to build_helper so it is available
in both build-qemu and build-efi

Move the fw_cfg bootcmd logic to build_helper as well.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-25 18:19:23 +01:00
Simon Glass
4669ad3785 scripts: Update build-efi/qemu to support disabling pager
The pager can interfere with tests and there is a lab test which uses
the build-efi script. Add an option to disable the pager so that the
labgrid test can request that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-23 12:22:45 -06:00
Simon Glass
c6883b8a71 scripts: Add an option for the build directory
When running in CI it is better to specify the build directory rather
than provide a device. Add a --build-dir option.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-12 13:41:05 -06:00
Simon Glass
7c63cdd830 scripts: Correct virtio-sci typo
Fix a small typo in the help.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 16:53:16 -06:00
Simon Glass
4470f4f729 scripts: build-qemu: Move virtiofsd code into the helper
Move this code into the helper so that build-efi can use it too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
2a6a7e9716 scripts: build-qemu: Move qemu program-name to the helper
Put this in the helper so that we can (later) have it show the correct
error when the virtiofs daemon fails.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
a783a7ea64 scripts: build-qemu: Move memory size to the helper
Move this field to the helper so we can (later) have it set up the
virtiofs daemon.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
68ec2401ad scripts: Adjust EFI script to support an OS
At present the OS disk conflicts with the boot disk used to hold the
app (or payload). Number the OS disk after that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 14:47:39 -06:00
Simon Glass
f7a683d3f3 scripts: Adjust EFI script to support a root disk
At present the root disk conflicts with the boot disk used to hold the
app (or payload). Use virtio for this disk and number the others after
that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-05 11:49:30 -06:00
Simon Glass
3cf8c74bb7 scripts: Always use the RNG device with QEMU
There is no harm in always having this device enabled, thus reducing the
number of script arguments. Enable RNG always.

Series-to: concept
Series-version: 2
Series-changes: 2
- Use /dev/urandom instead, dropping the now-unnecessary arguments

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-07-30 13:42:18 +12:00
Simon Glass
cbc27536ff scripts: build-qemu: Support a random-number generator
Add a --rand option to enable access to /dev/random from QEMU.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-10 07:26:51 +02:00
Simon Glass
1492937d63 scripts: Allow -d to specify multiple disks in build_helper
Sometimes it is useful to provide several disks to QEMU. Update the -d
flag to support this. It can be used like this:

   scripts/build-qemu -d root.img mmc6.img -r

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-09 23:11:32 +02:00
Simon Glass
b3d8820e98 scripts: Support a root disk connected via virtio-scsi
Sometimes it is useful to use SCSI instead of the plain virtio. Add a
-S option to connect the root disk via SCSI.

Drop the -S for --sct-seq since it is a less common option.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-02 12:34:59 -06:00
Simon Glass
65d7446e31 scripts: Move root-disk processing to helper
The build-efi and build-qemu scripts have common code to set up the root
disk. Move it to build_helper to avoid duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-02 12:34:59 -06:00
Simon Glass
fcc852c0f0 scripts: Move OS selection into the helper
Both scripts allow booting from an ISO containing an OS, so move this
handling into the common helper.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:25:33 -06:00
Simon Glass
e2e338d4f1 scripts: Move bitness and os_arch to helper
These two concepts are used in both scripts, so move them to the helper.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:14:58 -06:00
Simon Glass
f8de2c4048 scripts: Move some QEMU-arg building into build_helper
Providing a kernel, initrd and related options are useful in the EFI app
too, so move them into the common code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:14:58 -06:00
Simon Glass
686ee0523a scripts: build-efi: Use -a instead of -A
It seems better to specify the arch rather than using somewhat cryptic
flags. The build-qemu scripts uses -a (for Architecture) so do the same
for build-efi

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-06-30 14:14:58 -06:00
Simon Glass
c44dd6832c scripts: Move common arguments into build_helper.py
The two main QEMU scripts (build-efi and build-qemu) share some common
arguments, so put them in the common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:14:57 -06:00
Simon Glass
c9832707e3 scripts: Drop unwanted Stage() function from build_helper
This was brought in from another script by mistake but isn't needed.
Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:14:57 -06:00
Simon Glass
b3743e7120 scripts: build-qemu: Fix message when creating config file
The message is missing an f-string specifier. Add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-12 19:43:54 +00:00
Simon Glass
b7d6edfd69 scripts: Convert the build-qemu script to Python
Convert this to Python and make use of the build_helpers module. Update
that module to remove old options and improve the ordering of options.

The script doubles in size, part of which is being a lot more friendly
with virtiofsd problems, as well as adding a verbose mode.

Update the documentation as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-15 07:54:38 +02:00
Simon Glass
3a6ba29bd2 scripts: Create a common settings file for QEMU scripts
Move the settings into a common file so they can be used by all tools.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-15 06:35:37 +02:00
Simon Glass
9b5decd807 scripts: Convert the build-efi script to avoid sudo
Make use of the mk_fs() function to avoid needing to use sudo to mount
the loopback partition. This makes the script a little more friendly for
those nervous about sudo in their tools.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-15 06:35:37 +02:00