Return value of function 'lseek', called at pblimage.c:211,
is not checked, but it is usually checked for this function.
This trigger was found using the Svace static analyzer.
Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
When setting the time on the MAX31343, the time is not updated
for one second, and reading the time in this interval will give
the old time. Wait one second after writing so that the date
command will show the correct time when setting the clock.
Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Cc: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
An invalid calculation made setting years 2100-2199 impossible.
Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Cc: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
Documentation:
* describe creating a pflash file for qemu-system-riscv64
UEFI:
* correct logging StartImage()
* use LOGC_EFI consistently
* reduce UEFI size if HAS_BOARD_SIZE_LIMIT=y
* Update efi_run_image() to accept image and device path
* Add a version of efi_binary_run() with more parameters
* Move the fallback code from efi_run_image()
* Pass in the required parameters from EFI bootmeth
* bootmeth_efi: Support PXE booting
Other:
* Enable log filtering by function name
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAmeWCwgACgkQhO4vgnE3
U0u7qRAAusk/HO9ICJRm/BPnOsRim8dB58kZ/WTTzmxAIpLST4FKXGtvv+SHCJNA
l/zFQ0Tijeh4mrEKurNvJWQ2LDMRDDO5czSfQG4OjfEq1RISASuIkI31yTKi9bZn
AmvTkotg0XR7SbUQxdCBN1MCxecvPVrfASor1OGb64NN1EXdJybAhtAZ9XUEH/VX
1tOnkSFXzFqVkNVlC0o1vanTRlV8VfAWHFE/pxiZzbsAca2ZGxht82d2WFios+Ri
PAVnAhUEFWId49N62slFq6jqBbCwbKVeA5/2L7ntvZY1BxugIEw0qaCmSiTlWAFE
J1lrjUUrvH0bJLdGBZcSWLneXqEcQCnlLTMl42YPfvCyxXcdbEDoiVlkMpMVgmfd
10dJVzsaumbTsQus/UIFDY5b2aUp4n9peULS1iSc5KLIpS2xPmY6trOwNvFi6GXU
Z4QF9mHNn6zfN3rFfw8IpyqN2n7ixVQdbgdhkaYyTUoLmwt9Y5oMfbbJ9uP2U38H
GnXDRoMWSq50u3q/y7KwB989yA9OjNfijKy5cuR2MaHtRL+FNlvpK9kvRHh6n2pz
CZfSqvCZP/35WwSqGoxMa96zDmQrMTXr1Cjgo2l+Jutwv+sx7ZTtiasYWul5ovWQ
GMO2NCFgHP25AYuY6rYYg5JmP1S85z7Y5Tcmy7Onb/3cuyzqGrk=
=cFni
-----END PGP SIGNATURE-----
Merge tag 'efi-2025-04-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-04-rc1-2
Documentation:
* describe creating a pflash file for qemu-system-riscv64
UEFI:
* correct logging StartImage()
* use LOGC_EFI consistently
* reduce UEFI size if HAS_BOARD_SIZE_LIMIT=y
* Update efi_run_image() to accept image and device path
* Add a version of efi_binary_run() with more parameters
* Move the fallback code from efi_run_image()
* Pass in the required parameters from EFI bootmeth
* bootmeth_efi: Support PXE booting
Other:
* Enable log filtering by function name
Rather than setting up the global variables and then making the call,
pass them into function directly. This cleans up the code and makes it
all a bit easier to understand.
Signed-off-by: Simon Glass <sjg@chromium.org>
This code is only needed if an invalid image/device path is passed in.
Move the code out to a caller where this can be dealt with. The normal
flow will provide these parameters.
Signed-off-by: Simon Glass <sjg@chromium.org>
This uses a few global variables at present. With the bootflow we have
the required parameters, so add a function which accepts these. Update
the existing function to call the new one with the globals.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Provide these globals as parameters to this function, on the way to
making it possible to start an image without relying on the globals.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
U-Boot can be executed in place from a flash device.
Describe how this can be emulated on RISC-V QEMU.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
If a board has a strict size limit, disable
* Unicode capitalization and
* HII protocols
by default to reduce the image size.
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
The log category should be LOGC_EFI all over the EFI sub-system.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Up to now we could only use log level, category, and file for filtering.
Allow filtering on a list of functions.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Function log_has_file() is not used externally. Make it static.
Rename the function to log_has_member() as we can reuse for filtering
other strings.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
When logging running an image, e.g. `bootefi hello` the indent is not
correctly reset.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
I have one of these boards loaded with Ubuntu 24.10 (64-bit). Add an
entry for it so that it can be used for testing.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-By: Heinrich Schuchardt <xypron.glpk@gmx.de>
Buildman has always treated the lack of a toolchain as an infrastructure
problem rather than a build failure.
However the logic for this is not correct, since it does not write a
'done' file in this case.
As a result, one of two things can happen.
1. If a previous build ran in the same (output) directory, the outcome
of *that* build is recorded as the outcome of this one
2. Otherwise, no outcome is recorded
Obviously this inconsistency is not ideal. While (2) is rare, it can be
very confusing as the build sort-of fails but does not produce any
summary output with 'buildman -s'
Overall it seems better to attribute a toolchain issue to the boards
that it affects. This results in clear failures which can be examined,
no matter what happened in the .bm-work directory previously.
So write a 'done' file for each build when a toolchain is missing.
The end result of this patch is to make missing toolchains much more
obvious. It should be things a bit easier for novice users.
Signed-off-by: Simon Glass <sjg@chromium.org>
This is not actually used but its presence suggests that it is the
filename for the board database. Drop it to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
This script can fail if there is no toolchain available for the board.
At present this is not handled very nicely, in that only the error
output is reported. It is much more useful to see everything, so
combine stdout and stderr and report them both.
Signed-off-by: Simon Glass <sjg@chromium.org>
The u-boot-test-getrole script runs before the normal environment
variables have been set up. This is unavoidable since the script is
providing necessary information to test.py
This means that U_BOOT_SOURCE_DIR is not set in the environment.
As a result, Labgrid uses its default source path, configured in its
environment variable. While this may happen to work, it is not correct.
Also, it causes problems when running from Gitlab, where the runner may
not have access to that source path.
Provide the required source path in U_BOOT_SOURCE_DIR so that Labgrid
does the right thing.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: bf89a8f1fc ("test: Introduce the concept of a role")
[1] https://patchwork.ozlabs.org/project/uboot/patch/20241211131858.520639-1-sjg@chromium.org/
Simon Glass <sjg@chromium.org> says:
The current method of running unit tests relies on subcommands of the
ut command. Only the code in each subcommand knows how to find the tests
related to that subcomand.
This is not ideal and we now have quite a few subcommands which do
nothing but locate the relevant tests in a linker list, then call a
common function to run them.
This series adds a list of test suites, so that these subcommands can be
removed.
An issue with 'ut all' is that it doesn't record how many tests failed
overall, so it is necessary to examine copious amounts of output to look
for failures. This series adds a new 'total' feature allow recording the
total number of failed tests.
To help with 'ut all' a new pytest is created which runs it (as well as
'ut info') and makes sure that all is well. Due to the 'ut all' failures
this does not pass, so the test is disabled for now. It is here because
it provides security against misnaming a test suite and causing it not
to run.
Future work may:
- get 'ut all' passing
- enable test_suite() in CL, to ensure that 'ut all' keeps passing
- record duration of each suite
- allow running the tests in random order to tease out dependencies
- tweak the output to remove common prefixes
- getting rid of bootstd, optee and seame 'ut' subcommands
Link: https://lore.kernel.org/r/20250120212613.516664-1-sjg@chromium.org
Rather than having the help in the longhelp, put it in the suite info
so 'ut info -s' can show it. This is tidier, particular due to the
removal of #ifdefs
This means that the help text is present in the image (although not
displayed with 'ut info -s') so the image-size increases. But with
UNIT_TEST enabled, we expect large images so this doesn't seem
important.
Signed-off-by: Simon Glass <sjg@chromium.org>
Put the suites in order by name, for easier code-maintenance. This also
helps find test results for a particular swuit in the 'ut all' output.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a function to show the stats, so we can decide when to print it.
This slightly adjusts the output, so that any 'test not found' message
appears on its own line after all other output.
The 'failures' message now appears in lower case so update pytest
accordingly.
Signed-off-by: Simon Glass <sjg@chromium.org>
This is useful information and is not always the same as the 'count' arg
to ut_run_list() so add it as a separate stat.
Signed-off-by: Simon Glass <sjg@chromium.org>
Use a struct to hold the stats, since we also want to have the same
stats for all runs as we have for each suite.
Signed-off-by: Simon Glass <sjg@chromium.org>
Update this function to access a unit-test state, so that the caller can
collect results from running multiple suites.
Signed-off-by: Simon Glass <sjg@chromium.org>
This is not needed anymore. If a test suite is not built, then it will
have no linker-list entries. So we can just check for that and know that
the suite is not present.
This allows removal of the #ifdefs and the need to keep them in sync
with the associated Makefile rules, which has actually failed, since the
help does not match what commands are actually present.
Signed-off-by: Simon Glass <sjg@chromium.org>
The 'info' test is not a real test. With the new suite array we can drop
this and the associated special-case code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Use the new suite-runner to run these tests instead.
It is not clear that these actually work, since they are not enabled on
sandbox for some reason.
Signed-off-by: Simon Glass <sjg@chromium.org>
Use the new suite-runner to run these tests instead.
It is not clear that these actually work, since they are not enabled on
sandbox for some reason.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>