The function definition of fit_check_sign() is guarded by
"#ifdef CONFIG_FIT_SIGNATURE" in "tools/image-host.c". If we try
to build it without CONFIG_FIT_SIGNATURE, we will get an error:
/usr/bin/ld: tools/fit_check_sign.o: in function `main':
fit_check_sign.c:(.text.startup+0x165): undefined reference to `fit_check_sign'
collect2: error: ld returned 1 exit status
Fixes: 9c79c8fe70 ("tools/fit_check_sign: make key optional")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
The symbol TOOLS_IMAGE_PRE_LOAD doesn't depend on TOOLS_LIBCRYPTO.
If we choose to build tools without openssl, rsa_verify_openssl()
will attempt to call the unavailable openssl library functions.
Fixes: 942c8c8e66 ("rsa: Add rsa_verify_openssl() to use openssl for host builds")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Rename the variable and add ENV_ prefix, so that all configuration
options which are related to environment would have an CONFIG_ENV_
prefix. No functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
E Shattow <e@freeshell.de> says:
Make consistent use of lowercase hexadecimal prefix '0x' throughout U-Boot.
There are a few remaining uses of uppercase 'X' to denote hexadecimal prefix
or placeholder in documentation and error messages.
External devicetree-rebasing dts/upstream and the generated code of
xilinx/zynq are ignored for the series.
Link: https://lore.kernel.org/r/20250606224558.1117422-1-e@freeshell.de
Some SoCs require a Trusted Firmware-A (TF-A) AP Trusted ROM (BL1) to
initialize the SoC before U-Boot can run properly. Add an atf-bl1 etype
so we can properly package BL1 into a final binary
Signed-off-by: Bryan Brattlof <bb@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>
Add support for generating STM32 Image V2.0, which is used by STM32MP13xx.
The image header layout is similar to STM32MP15xx STM32 Image V1.0, but is
different enough to justify duplicate functions to generate the v2 image.
This code at least attempts to align the V1 and V2 image handling where
possible.
Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Prevent file descriptor leaks by properly closing 'fd' and 'new_fd'
when fstat() or write() operations fail.
- Added close(fd) before return in open_for_read() if fstat() fails.
- Added close(new_fd) before return in write_image() if write() fails.
- No close needed if open() fails (fd == -1 is invalid).
Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Describe the new subcommands and how they should be used in a normal
workflow.
Note that the naming of branches is very rigid, or 'opinionated' in
marketing terms. Patman can track a single branch for each version of a
series and they must all be named the same, except for the
version-number suffix. Version 1 series have no suffix.
This description is fairly bare-bones but should be enough for some
initial testing and comments.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a command to allow managing the upstream tree. This is very basic
so far, only allowing setting the name and URL. Further work may allow
checking whether series apply cleaning on the upstream tree, etc.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a command to support management of series. These are local branches
which may have been sent to the mailing list, so may appear on the
patchwork server.
The new functionality uses a database, stored in a local file.
Various operations are supported:
- add a new series
- send a series and automatically link it with patchwork
- 'increment' the version, to prepare to send an updated series
- gather review/test tags from patchwork
- check on progress, i.e. patches which are received new tags or
comments
- show comments on patches and cover letters
Signed-off-by: Simon Glass <sjg@chromium.org>
Indicate whether 'git send-email' was actually called, so that we don't
bother waiting for patchwork to receive our series if it wasn't.
The 'git send-email' seems to always return a code of 0 even if nothing
was sent, so we cannot use clues there. Ideally we would watch the
output to determine which patches were sent and which not, but that is
left for another day.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is laborious to type long commands, so add some aliases to speed up
use of patman. For now, allow 'pw' for patchwork and 'st' for status.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a command to allow setting and getting the patchwork project. This
is needed so that patman can use the correct ID when talking to the
patchwork server.
To support testing, allow passing in the test database, patchwork
object and Cseries object. Fake versions can then easily be provided for
certain test cases.
Signed-off-by: Simon Glass <sjg@chromium.org>
Update Series with a way to better manage the Series-links lines in
patches. Use this in the 'status' subcommand instead of the existing
primitive method of expecting a link without a version prefix.
Signed-off-by: Simon Glass <sjg@chromium.org>
This class manages a series, i.e. a group of patches with a possible
cover letter. Add some properties for recording basic patchwork info,
including the database ID.
Signed-off-by: Simon Glass <sjg@chromium.org>
The parsing tests need to be able to try invalid arguments to make sure
that these are handled correctly. Provide a way to return the parsers
being used, as well as to pass in the parsers to use. This feature is
needed in test_series_no_subcmd(), for example.
Signed-off-by: Simon Glass <sjg@chromium.org>
We chose -C as the flag to enable showing comments because -c was used
in 'patman send' to specify the patch count. Now that the 'send' parser
is separated we don't need to do this and it is OK to use the same flag
in a different subcommand.
We want to have a flag for cover-letter comments, so it makes most sense
to have -C for that and -c for patch comments. Update the latter.
Put this in a function since the new 'series' command will add this flag
too.
Signed-off-by: Simon Glass <sjg@chromium.org>
Patman allows defaults for its command-line flags to be read from a
file. The implementation of this does not fully work with subcommands,
since we don't want a default for those.
Also, it relies on being able to parse any sort of cmdline in order to
figure out the options that are available. But in some cases, the
cmdline may not parse, e.g. if there are required options, or
conflicting options.
Add a class which can be safely used to parse any cmdline, since it
allows execution to continue even when errors are obtained. Use this to
determine the defaults, being careful to skip sub/commands.
Another way to handle all of this would be to maintain the defaults
separately and insert them into the parser manually. For now, I'm not
sure which is best.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add various new requests to the Patchwork class, so we can obtain the
required information. This includes cover letters and comments.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add support to the status module for reading and supporting cover
letters, including comments. Plumb this through to the patchwork module.
The actual support in the latter is not yet integrated.
Signed-off-by: Simon Glass <sjg@chromium.org>
For recording series information, patman needs a database. Add a module
which uses sqlite3 for this. It has a basic schema, enough to support a
series subcommand.
Signed-off-by: Simon Glass <sjg@chromium.org>
The func_test file is quite large. In order to allow new tests to be
added to a separate file, move the common test code into a separate
class, to be inherited by other classes.
Drop unnecessary imports in func_test
Signed-off-by: Simon Glass <sjg@chromium.org>
Add functions for checking a branch, showing a commit, etc. to support
the new functionality.
Git version 2.34.1 ignores --stat if --quiet is given, so adjust the
args so that this performs as expected.
Signed-off-by: Simon Glass <sjg@chromium.org>
When running tests where the .git directory is not owned by the current
user, various warnings are produced and the tests fail. This happens in
CI.
For patman itself, modify the gitutil.get_top_level() function to return
None in this case. Ensure that the warning is not shown, since it creates
about 1000 lines of output.
For checkpatch, the same warning is produced even though --no-tree is
given. Suppress that as well.
Signed-off-by: Simon Glass <sjg@chromium.org>
Correct various pylint warnings in this file.
The remaining ones are three functions with too many arguments (R0913
and R0918) and use of global (W0603).
Signed-off-by: Simon Glass <sjg@chromium.org>
In some cases we want to collect all lines in the commit message so that
the commit can be recreated with the same message as before, or perhaps
with light filtering.
Add support for this.
Series-to: u-boot
Cover-letter:
patman: Minor improvements to prepare for series handling
This series includes a number of internal improvements to patman:
- Tidy-up of parsing
- Adjust how tests create the git tree
- Support for creating patches in a different git directory
- Faster determination of the upstream branch
- Ability to collect the body of a commit message as a series of lines
END
Signed-off-by: Simon Glass <sjg@chromium.org>
This is the help for the whole of patman, so move it to the start of the
control function, rather than being inside 'patman send'.
Signed-off-by: Simon Glass <sjg@chromium.org>
Most of the arguments for the main parser are actually arguments for the
'send' parser. Move them there, in a separate function.
Fix a pylint warning for -D and the imports while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simplify the main parser by moving subparser code into separate
functions. Fix a few pylint warnings while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tests may want to parse their own arguments. Refactor the parser code to
support this and allow settings to receive arguments as well.
Signed-off-by: Simon Glass <sjg@chromium.org>
Correct some pylint warnings in this file. Make use of the existing
asyncio event loop, instead of creating a new one, since this also
destroys it afterwards, making it unavailable for tests which want to
share an event loop. Use tools.write_file() to avoid a warning about
encoding.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present the branch information is dropped when writing the
configuration. It is easier to get git to set up the config anyway, so
update the test to do this.
Signed-off-by: Simon Glass <sjg@chromium.org>
The test starts with the HEAD pointing to the wrong place, so that the
created files appear to be deleted. Fix this by resetting the tree
before tests start. Add a check that the tree is clean.
Update pygit2 so that the enums are available.
Rather than hard-coding these values in the sample patches, use
variables so that we can refer to these in tests.
Signed-off-by: Simon Glass <sjg@chromium.org>
In tests, the 'git' directory is a subdirectory of the temporary
directory. Rename it to '.git' so that git will automatically find it
when git operations are done in the temporary directory. Set up the
config before the first git operation, so that this works correctly.
Signed-off-by: Simon Glass <sjg@chromium.org>
The variables 'lines' is used to hold a list of output lines within a
test, but also to hold an iterator through those lines. Use 'itr' for
the latter, to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
Support specifying the git-directory when creating and sending patches.
This will allow better testing of this functionality, since we can use a
test directory.
For count_commits_to_branch() support an end commit while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>