Commit Graph

369 Commits

Author SHA1 Message Date
Norman Feske
6e2a7e979e tool/run/log/serial: be quiet by default
As the initial output of picocom is hardly ever needed, disable it by
default to reduce the log noise. Whenever needed, the output can still
be enabled by specifying the run tool's --log-serial-cmd.
2024-11-20 08:58:39 +01:00
Norman Feske
7fb702a0d9 tool/run: exit gracefully if depot/create failed
With --depot-auto-update enabled, the run tool calls the depot/create
tool, which in principle may fail. In this case, print a diagnostic info
instead of a backtrace.

Issue #5379
2024-11-20 08:55:49 +01:00
Alexander Boettcher
b4ff720ea4 tool/run: support ipxe via UEFI boot on foc & sel4 2024-10-07 15:54:59 +02:00
Johannes Schlatow
16b863fc6e tool/run: use xmlcatalog for xsd file paths
With libxml2 >= 2.13, the `-path` argument can no longer be used for
setting search paths for xsd files. Instead, we use an XML catalog to
replace genode:// URIs with absolute paths.

Fixes #5248
2024-06-20 12:56:20 +02:00
Norman Feske
8943a3e949 Remove '_drv' suffix
Issue #4420
2024-06-20 12:54:30 +02:00
Alexander Boettcher
a3a84b25e8 image: support shim usage for uefi and disk
Fixes #5230
2024-06-20 12:54:29 +02:00
Alexander Boettcher
97544ed7a9 nova: support iommu enabling per intel/amd
separately.  The "iommu" option is now split up into "iommu_intel" and
"iommu_amd" and thereby can be disabled easily if required for one of the CPU
vendors.

Fixes #5206
2024-05-29 09:18:11 +02:00
Alexander Boettcher
b33afb24d7 nova: adjust to cmdline changes of kernel
- no need to explicitly switch off vga anymore
- use vPID for VMs which improves TLB usage if multiple vCPUs on same
  pCPU is used, which happens to happen on Sculpt.
- support for mwait by nova kernel, which is off by default

Issue #5206
2024-05-29 09:18:11 +02:00
Renato Carvalho
8c7e90f7f2 tool/run: fix corner case in exit override
The run tool overrides the 'exit'-procedure to make sure that a loaded
run_power_off procedure is always executed. However, a failing
run_power_off lead to false-positives: 'make run/...' exited with 0 even
tough the run script was not even executed because of a failed
power-on/off cycle. In this case, if the run_power_off is the exit code
producer, the new exit definition does not finish as intended. As a
result, the first exit code is re-written, and errors are not propagated
accordingly.

The solution is to catch possible errors from power-off within the exit
procedure.

Fixes genodelabs#5102
2024-04-29 08:00:30 +02:00
Norman Feske
dcd4578585 run: rename hw boot/image.elf -> boot/image-hw.elf
This disambiguates the boot images installed for base-hw from those
installed for base-nova.

Note that the image.elf file for other kernels (i.e., NOVA) is not
named image-<kernel>.elf at this point because this would prevent the
update from a pre-24.04 Sculpt system to a later one as the grub.cfg
is not touched by the old update mechanism. So after a system update,
grub would keep loading the last installed image.elf.

Issue #5182
2024-04-19 08:54:21 +02:00
Christian Helmuth
0b63bb91b6 run/nova: cleanup hypervisor binary handling
With the following changes, the hypervisor binary from bin/ as well as
from depot archives is taken as is and not unnecessarily turned inside
out.

- Remove objcopy -O elf32-i386 as our grub boots 64-bit binaries
  very well
- Remove strip as bin/hypervisor is already stripped
2024-02-28 16:31:45 +01:00
Christian Prochaska
6aba9b1b9a tool/run/depot.inc: allow depot user in used_apis
Issue #5092
2024-02-26 08:31:05 +01:00
Norman Feske
5ae0dab6c5 mk: remove implicit build of shared libraries
This patch removes the implicit build of all shared libraries a target
depends on. Targets only depend on the respective ABIs instead. This
alleviates the need to locally build complex shared libraries (think of
Qt) when developing applications. Instead, application developers can
use binary depot archives.

The implementation splits the mk/lib.mk file into three files:
- mk/a.mk   for building one static library (.lib.a)
- mk/so.mk  for building one shared object  (.lib.so)
- mk/abi.mk for building one ABI stub       (.abi.so)

Furthermore, the commit moves messages and the collection of build
artifacts to var/libdeps, triggers the build of kernel-specific
ld-<kernel>.lib.so, and prunes the lib-dependency tree at ABIs.

Fixes #5061
2023-11-28 14:44:29 +01:00
Norman Feske
5410ecf9ad run: check consistency of build_boot_image args 2023-11-28 14:44:29 +01:00
Stefan Kalkowski
040cf2eb2a tool/run/image/uefi: make silent sgdisk
Fix genodelabs/genode#5051
2023-11-28 14:24:26 +01:00
Tomasz Gajewski
02753b3c2c tool/run: fixed tftp support in boot_dir/hw
Changes needed after merging `uboot` and `uboot_fit` modules into a
single module.

Additionally `image.elf` file is removed when either `image.itb` or
`uImage` is created, so it cannot be processed when `image/uboot` module
is loaded. Therefore `image.elf` processing is done conditionally now.

Fixes #5037
2023-11-28 14:24:23 +01:00
Josef Söntgen
d6da06913e tool/run/boot_dir/hw: fix iPXE boot 2023-07-14 12:06:32 +02:00
Christian Helmuth
fb1d66b254 Remove timestamp from image.elf.gz
Issue #4956
2023-07-14 12:06:32 +02:00
Christian Helmuth
18c00e58cc tool: remove sel4 x86_32/pc and imx7-sabre artifacts
Issue #4918
2023-07-14 12:06:32 +02:00
Alexander Boettcher
ceaa02230e qemu: set default cpu model for x86_64 explicitly
With the update to sel4 and the gcc 12, assembly instructions are generated
and used, like POPCNT. The instruction is available on our native hardware,
but not emulated by the default cpu model necessarily, which leads to
undefined opcode exceptions (Qemu 4.2.1 && seL4). Additionally, the features
of the default Qemu cpu model may vary between Qemu releases and makes it
harder to correlate effects.
2023-06-16 11:24:25 +02:00
Alexander Boettcher
d92bd3afee sel4: update to 12.1.0 release
Fixes #4910
2023-05-30 12:13:33 +02:00
Alexander Boettcher
475bcfc2b9 qemu: use EPYC as model for AMD SVM virtualization
"-cpu phenom" does not support all CPU instructions necessary with
gcc 12 toolchain update issuing more SSSE3, e.g. pshufb.

Additionally, remove good/bad Qemu version check of outdated versions.

Issue genodelabs/genode-world#329
2023-05-30 12:03:32 +02:00
Christian Prochaska
1e1df21a94 Remove stale Xen support
Fixes #4859
2023-05-30 12:03:29 +02:00
Alexander Boettcher
8f5fe6dfe1 tool/run/load/ipxe: use installed_command
to find lighttpd if it is installed in /usr/sbin
2023-05-30 12:03:28 +02:00
Christian Helmuth
182ba3a931 run/load/ipxe: prevent error on kill_spawned
... if the run script exits early.
2023-03-13 14:32:37 +01:00
Alexander Boettcher
76828f25c5 tool: bender with optional 'serial' UART discovery
By default, bender will not report any serial findings anymore, if not
explicitly asked for with the 'serial' option. Without this option, an
invalid ioport is reported, so that neither the kernel nor Genode core
will make serial output.
2023-02-27 08:22:47 +01:00
Norman Feske
11ff774f72 tool/run/image/disk: find resize2fs in /usr/sbin
This patch adjusts the run/image/disk plugin to search for resize2fs in
/usr/sbin, which is not included in the PATH variable on Debian by
default.

Issue #4746
2023-02-27 08:22:46 +01:00
Alexander Boettcher
208547e3af tool/grub2: factor out common part
to avoid divergence

Issue #4741
2023-02-27 08:22:46 +01:00
Alexander Boettcher
c3843cd0d6 image/disk: factor out common boot parts
to avoid divergence

Issue #4741
2023-02-27 08:22:46 +01:00
Alexander Boettcher
eb354be20d image/uefi: factor out common boot parts
to avoid divergence.

Issue #4741
2023-02-27 08:22:46 +01:00
Alexander Boettcher
93e26cae35 grub2: add small default font
Issue #4741
2023-02-27 08:20:46 +01:00
Norman Feske
a7a5c5ce54 run/image/uboot: move uImage to boot/
This patch changes the 'run_image' function to replace a boot/image.elf
file by the corresponding boot/uImage file.

Issue #4730
2023-01-24 12:07:32 +01:00
Norman Feske
41ebf3bd94 run: remove argument from 'run_image' function
The argument is superfluous because only run/image/uboot evaluated it
anyway, and the argument is always boot/image.elf. With this change, the
official semantics of run_image become: "replace the boot/image.elf file
by platform-specific file(s) at boot/ that can actually be booted".

Issue #4730
2023-01-24 12:07:32 +01:00
Christian Helmuth
ed9a8299b2 run/image/uboot: merge with uboot_fit
Both modules were quite similar except the the name of the FIT image
(image.itb) and the mkimage command line. FIT images are now produced by
the following RUN_OPT.

  RUN_OPT += --include image/uboot --image-uboot-fit

Issue #4693
2022-12-02 11:08:59 +01:00
Norman Feske
a9383dfa79 run/image/uboot: use gzip --fast by default
By making the use of gzip's '--best' option configurable and disabling it
by default, this patch noticably reduces the built-test cycle from 15 to
10 seconds when integrating the Sculpt system image for the PinePhone.

Fixes #4693
2022-12-02 11:08:58 +01:00
Alexander Boettcher
7a5eab9541 grub2: make ISO bootable on hardware
With "grub2: update to newer grub2 2.06 version" a regression slipped in
which makes the ISO not bootable on real hardware. The commit reverts to
the previous behaviour, to load the GRUB2 modules after boot later one by
one in the ISO format case.

Fixes #4647
2022-11-17 08:00:34 +01:00
Christian Helmuth
57f510d67f run/load/ipxe: spawn lighttpd on demand
An installed lighttpd HTTP server can now optionally be started to serve
the boot image with the follow run options.

--load-ipxe-lighttpd             run lighttpd automatically (default: off)
--load-ipxe-lighttpd-port <port> TCP port to run lighttpd on (default: 8080)
2022-10-12 12:09:34 +02:00
Martin Stein
ede007c2dd Bender: Intel HWP mode configurable via RUN_OPT
The updated Bender version is configurable regarding the mode in which to run
the Intel HWP plugin. This can now be controlled via the new run option
'--bender-intel-hwp-mode' (only when running on NOVA). The option knows 4 valid
values 'off', 'performance', 'balanced', and 'power_saving'. When running on
NOVA, the default value applied by the run tool is 'performance'. when running
on any other kernel, the default value of Bender ('off') is used. Therefore,
when not setting the new '--bender-intel-hwp-mode' flag, the behavior is the
same as before this commit.

Fixes #4224
2022-09-19 14:00:34 +02:00
Norman Feske
7be98166ee run: improve 'build_boot_image [build_artifacts]'
This patch make the use of the result of the 'build_artifacts' function
as input for 'build_boot_image' more robust. Since 'build_artifacts'
obtains binary names from the progress.log, the names of core,
ld.lib.so, and the timer correspond to the kernel-specific names.

However, 'build_boot_image' expects the kernel-agnostic names as
arguments. Kernel-specific files need special treatment when integrated
in the boot image: the kernel-specific file is copied and renamed to the
kernel-agnostic name. Without this patch, the kernel-specific file is
copied as is (e.g., ld-nova.lib.so). So the name of the ROM module is
wrong. This patch resets the kernel-specific names to the generic names
so that the special-case handling comes into effect.
2022-09-19 14:00:32 +02:00
Norman Feske
dd9e12601e Remove pseudo targets for building shared libs
Thanks to the change "build: support library builds via lib/<libname>",
shared libraries can now be built directly by the build system.

Issue #4599
2022-09-19 14:00:32 +02:00
Norman Feske
c560285d88 build: support library builds via lib/<libname>
This patch adds special handling for lib/<libname> arguments to the
build system, which supersedes the former LIB=<libname> mechanism.
Whereas the old mechanism was limited to a single library, the new
convention allows multiple library arguments, similar to regular
targets. The change brings the two immediate benefits.

First, the streamlining of library and target arguments allows for the
building of libraries via the 'build' command of the run tool.

Second, it alleviates the need for pseudo target.mk files for building
shared libraries that have no direct dependencies, in particular VFS
plugins.

Since this change eases the explicit creation of shared libraries
from run scripts, we may reconsider the automatic implicit building
of shared libraries driven by targets. E.g., while developing a Qt
application, a run script could import the Qt libraries from the
depot and combine those with the developed (fresh built) target without
triggering the build of the Qt libraries in the build directory.

When issueing 'make' without arguments, all targets are built. This
patch applies this behavior to libraries as well, thereby removing the
need for the base/src/lib/target.mk pseudo target as used by the CI
tools to build all libraries.

Note that target.mk files located under src/lib/ are no longer
reachable. Therefore, all run scripts that used to trigger the
build of a shared library via a pseudo target must be adapted.
E.g., 'build lib/vfs/tap' must be replaced by 'build lib/vfs_tap'.

With this patch, the LIB=<libname> option is no longer supported.

Fixes #4599
2022-09-19 13:59:28 +02:00
Sebastian Sumpf
b5c780993c board: Rename virt_qemu to virt_qemu_<arch>
Instead of having a generic "virt_qemu" board use "virt_qemu_<arch>" in
order to have a clean distinction between boards. Current supported
boards are "virt_qemu_arm_v7a", "virt_qemu_arm_v8a", and
"virt_qemu_riscv".

issue #4034
2022-08-17 12:03:26 +02:00
Alexander Boettcher
97d7d4b49d grub2: update to newer grub2 2.06 version
In UEFI case the lower RAM will not be used for internal allocation, which
should prevent overrides in the former legacy BDA (first page).

Issue #4426
2022-08-10 13:33:00 +02:00
Christian Helmuth
427f3bb634 run/load/ipxe: support ISO and UEFI images
Patch by Roman Iten and Pirmin Duss.
2022-08-10 13:32:59 +02:00
Christian Helmuth
18c5f1e90d tool/run: improve disk image size automatic
Set disk size to 1.5 times the run folder size and shrinked later to
real content.

Thanks to Roland for the patch.
2022-04-13 08:08:00 +02:00
Christian Helmuth
7f0403c8c1 tool/run: multiple attempt for AMT SOL connection
Some devices do not answer connection attempts timely, which leads
amtterm to time out (after 60s). Using multiple attempts in 500 ms
intervals results in timely connection and complete boot logs.

Issue #4429
2022-04-13 08:08:00 +02:00
Christian Helmuth
42fed1a16c tool/run: retry with optional timeout utility
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
2723614d58 tool/run: restrict close to amtterm spawn_id
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
fec5c03612 tool/run: option to skip AMT SOL availability test
Issue #4429
2022-04-13 08:07:58 +02:00
Norman Feske
14b93c5ff3 run: handle empty create_tar_from_depot_binaries
This patch works around 'tar' erroring out when faced with an empty list
of files:

  tar: Cowardly refusing to create an empty archive

This can happen when using sculpt.run for a scenario with only a runtime
but no deploy or launcher configuration.

Issue #4369
2022-02-15 16:13:54 +01:00