Change the indent field in fit_print_ctx from a string pointer to an int
number of spaces to indent.
Set the initial indent value to 3 to match IMAGE_INDENT_STRING
Drop indentation from the debug() calls since these are not visible to
users.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Move the indent string into struct fit_print_ctx so it is available to
the printing functions. This avoids having to pass it as a separate
parameter.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Create a struct fit_print_ctx to hold the FIT pointer and pass it to all
printing functions instead of passing the FIT pointer directly. This
provides a foundation for adding additional context in the future.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
There is enough code here that it makes sense to put it in its own file.
Create a new fit_print.c file, before undertaking future refactoring.
Printing is only included in the main build if CONFIG_FIT_PRINT is
enabled, although it is always included in the tools build.
Add static inlines for existing callers.
Make a few small code-style adjustments, including fixing checkpatch
warnings about over-use of brackets.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Remove the unused third parameter (len) from fit_get_name(). All uses of
this function pass NULL for this parameter.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
The debug() macro in mkimage.h expands to nothing when MKIMAGE_DEBUG
is not defined. This causes the compiler to warn about unused variables
that are only referenced in debug() statements.
Fix this using the same approach as the debug_cond() macro.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Add cryptsetup to the CI Docker image to enable LUKS encryption tests.
This is needed to create test images.
Signed-off-by: Simon Glass <sjg@chromium.org>
Install a Rust toolchain in the CI image so that it is possible to build
the Rust examples.
Co-developed-by: Claude <noreply@anthropic.com>
Co-developed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
At this point there's problems rebuilding coreboot-24.08 without manual
intervention. Let us upgrade to a newer version.
Signed-off-by: Tom Rini <trini@konsulko.com>
Archived series currently cause an error when autolink is attempted. Add
a check to avoid this.
Series-to: u-boot
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:458284
The name 'x86a' must be parsed as a branch name, not as versio 86 of
branch 'x'. Correct the regex and add a test for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Sometimes series don't have a cover letter. Add a --use-commit option to
easily use the first commit's subject instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Sometimes it is useful to include archived series in the progress report
so you can see all the work completed. Add a flag for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Sometimes it is useful to include archived series in the listing so you
can see which series could potentially be unarchived. Add a flag for
this.
Add a --include-archived option to the 'series ls' command for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function is needed by 'patman status', meaning that it must import
cser_helper which needs pygit2
Move it to patchstream so that pygit2 is not needed for the
'patman status' command.
Signed-off-by: Simon Glass <sjg@chromium.org>
If pygit2 does not exist, patman refuses to work at all, but most
subcommands don't need it. Move the imports to resolve this.
Signed-off-by: Simon Glass <sjg@chromium.org>
If CROSS_COMPILE is set in the environment passed to buildman,
testMakeEnvironment() fails. Fix this by removing the variable before
starting the test.
Signed-off-by: Simon Glass <sjg@chromium.org>
If CPP is set (e.g. to 'gcc -E') buildman currently gives an error. Add
a little more logic to handle this case.
Signed-off-by: Simon Glass <sjg@chromium.org>
If DTC happens to be set in the environment provided to buildman itself,
this test currently fails. Fix it by removing any DTC variable before
starting the test.
Signed-off-by: Simon Glass <sjg@chromium.org>
In some cases latin1 encoding may be used in source files. If
'high-ascii' are used, patman may report an error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in
position 1051: invalid continuation byte
Fix this by replacing these characters. This may cause the patch to fail
to apply, but at least it can be checked.
Signed-off-by: Simon Glass <sjg@chromium.org>
Since there is now a new server at patchwork.u-boot.org allow using this
if selected in the ~/.patman file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Support creation of a load-only FIT (where there is no OS), with a new
--load-only option. Allow FITs to be created without an OS image.
Update the auto-generated FIT description to make this clear.
Signed-off-by: Simon Glass <sjg@chromium.org>
When using '-f auto', mkimage automatically creates a FIT given the
images. For devicetree files, FIT expects that the compatible string
from each is copied to its corresponding configuration node.
Implement this in mkimage, so far only for uncompressed devicetrees.
This requires a few more fields in struct content_info, so take this
opportunity to comment it properly.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function does not actually use the 'name' argument. Drop it and use
FIT_DATA_PROP instead, to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
Adjust the build logic to automatically deal with adding config
fragments to an existing board, to fully support the -X option.
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide a new -X option which uses any available .buildman files to
augment the list of boards supported by U-Boot with 'extended boards',
which consist of a base board with one or more config fragments.
Signed-off-by: Simon Glass <sjg@chromium.org>
Provided a convenient function for buildman to use, which builds the
database if needed, then returns it.
Signed-off-by: Simon Glass <sjg@chromium.org>
It might better to use separate arguments for each item, but for now,
document which args are used by Slot, Slots and move_config()
Signed-off-by: Simon Glass <sjg@chromium.org>
This function does not actually build the database; it just adds a board
to the datbase. Rename it to do_add_to_db() to reflect that.
Signed-off-by: Simon Glass <sjg@chromium.org>
The qconfig tool has the ability to search for CONFIGs used by boards.
Refactor the code slightly so that buildman obtain the database.
Signed-off-by: Simon Glass <sjg@chromium.org>
We wish to support .buildman files in the config/ directory which can
associate boards with config fragments. Add a parser for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
It has become more common to use config fragments to extend or adjust
the functionality of boards in U-Boot.
Add some documentation for how to use this with buildman.
Signed-off-by: Simon Glass <sjg@chromium.org>
Check that configuration fragments provided to buildman as comma-
separated list are passed on to the make command of the builder.
In the %_defconfig: target of scripts/kconfig/Makefile the defconfig
file and the fragments are combined via the gcc preprocessor.
Modeling this step in the buildman testbench without invoking the actual
Makefile would not provide better test coverage.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Currently we are no able to build with configuration fragments in our CI.
With this patch buildman gets a new argument --fragments for passing a
comma-separated list of configuration fragments to add to the board
defconfigs, e.g.
tools/buildman/buildman \
-o build \
-k qemu-riscv64_smode \
--fragments acpi.config
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Support creation of a load-only FIT (where there is no OS), with a new
--load-only option. Allow FITs to be created without an OS image.
Update the auto-generated FIT description to make this clear.
Signed-off-by: Simon Glass <sjg@chromium.org>
When using '-f auto', mkimage automatically creates a FIT given the
images. For devicetree files, FIT expects that the compatible string
from each is copied to its corresponding configuration node.
Implement this in mkimage, so far only for uncompressed devicetrees.
This requires a few more fields in struct content_info, so take this
opportunity to comment it properly.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function does not actually use the 'name' argument. Drop it and use
FIT_DATA_PROP instead, to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
This is not correct when building a kernel FIT, since it adds a second
loadable in addition to the kernel.
There may in fact be a bug in SPL FIT, in which case that should be
fixed, rather than adding an invalid loadable to the FIT.
This reverts commit cabde449b9.
Series-to: concept
Series-cc: heinrich
Cover-letter:
mkimage: Start to tidy up mkimage and friends
The current mkimage code is a bit messy:
- the main() function is very long
- two similarly named structs are used throughout: the first
(struct image_tool_params) is not actually just parameters, the second
(struct image_type_params) is confusingly similar
- quite a bit of FIT processing happens right at the start of main(),
which can be hard to follow
- the program calls exit() from many different places
This series renames the main structures, avoiding using the common
'params' word. It breaks up part of main() into separate functions and
starts the process of exiting in one place.
It also reverts a patch which causes an invalid 'loadables' property to
be added with '-f auto'.
More remains to be done, but this is a start.
END
For listing an image, or processing an existing FIT, an initial code
path is used, then the program exits.
Move this into its own function so it is clear that this is an
early-return path.
Signed-off-by: Simon Glass <sjg@chromium.org>
The run_mkimage() function is long and complicated. Make a start by
moving some initial checks out into their own check_params() function.
Also move the FIT-processing into a new process_fit() function.
Signed-off-by: Simon Glass <sjg@chromium.org>