aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2022-08-31tools: mkimage: fix build with recent LibreSSLMark Kettenis
LibreSSL 3.5.0 and later (also shipped as part of OpenBSD 7.1 and and later) have an opaque RSA object and do provide the RSA_get0_* functions that OpenSSL provides. Fixes: 2ecc354b8e46 ("tools: mkimage: fix build with LibreSSL") Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
2022-08-26binman: Sort tests and rework test-file numbersStefan Herbrechtsmeier
Tests should be in order of the test-file numbers. Sort the tests according to the test-file numbers and rework the test-file numbers to eliminate duplicate numbers. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-26binman: Document how to handle dependent imagesSimon Glass
Binman does not support this properly at present. Add documentation about it including a work-around. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-26binman: Mention split-elf in the main docsSimon Glass
Since we are talking about ATF, add mention of this new feature too. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-26patman: Tidy up unnecessary blank lines and numbersSimon Glass
Quite a few blank lines are not needed here. Drop these and use the # mechanism to number paragraphs. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-26patman: Fix version tableSimon Glass
One of the changes to the version table was made by mistake. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-22Merge tag 'dm-pull-20aug22' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dm binman fixes for various things binman clean-up of compression and addition of utilities
2022-08-22CI: Move to Ubuntu 2022.04 "Jammy" for CI baseTom Rini
- We now have a new enough sbsigntools in the distro, stop building. - Use the 20220801 tag for Jammy. - Move to pygit2 1.9.2 (current version) as the old one doesn't build on "Jammy". - Add the working directory to the list of safe directories for git. - Move to pytest 6.2.5 to address other issues. - This move exposed a number of minor issues in the existing scripts we used within CI to perform the jobs themselves. The most notable changes here involve using 'set +e / set -e' to enforce when we should or should not make non-zero buildman status be a fatal error. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add zstd bintoolStefan Herbrechtsmeier
Add zstd bintool to binman to support on-the-fly compression. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add xz bintoolStefan Herbrechtsmeier
Add xz bintool to binman to support on-the-fly compression. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add lzop bintoolStefan Herbrechtsmeier
Add lzop bintool to binman to support on-the-fly compression. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add gzip bintoolStefan Herbrechtsmeier
Add gzip bintool to binman to support on-the-fly compression of Linux kernel images and FPGA bitstreams. The SPL basic fitImage implementation supports only gzip decompression. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org> Rename the module and support this, since gzip.py is a system module: Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add bzip2 bintoolStefan Herbrechtsmeier
Add bzip2 bintool to binman to support on-the-fly compression. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add BintoolPacker class to bintoolStefan Herbrechtsmeier
Add a bintools base class for packers which compression / decompression entry contents. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org> Dropped dead/untested code in version(): Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add compression testsStefan Herbrechtsmeier
Add common test functions to test all supported compressions. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Support missing compression toolsStefan Herbrechtsmeier
Handle missing compression tools by returning empty data and record missing bintool. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Move compression bintool management into entry classStefan Herbrechtsmeier
Move management of the bintool to compress and decompress data into the entry class and add the bintool to the list of required bintools. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Select compression bintools in cbfs_util classStefan Herbrechtsmeier
Select the lz4 and lzma_alone bintools in cbfs_util class to centralize the supported compression algorithm evaluation inside the class and over multiple classes. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Move compression bintools creation into test setupStefan Herbrechtsmeier
Move compression bintools (packer) creation into test setup to reuse bintool objects between tests. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org> Put comp_util import back in, since it is still needed here: Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Remove obsolete compressed data header handlingStefan Herbrechtsmeier
Remove the obsolete compressed data header handling from the utilities to compress and decompress data. The header is uncommon, not supported by U-Boot and incompatible with external compressed artifacts. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Disable compressed data headerStefan Herbrechtsmeier
Disable the compressed data header of the utilities to compress and decompress data. The header is uncommon, not supported by U-Boot and incompatible with external compressed artifacts. The header was introduced as part of commit eb0f4a4cb402 ("binman: Support replacing data in a cbfs") to allow device tree entries to be larger than the compressed contents. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add length header attribute to dtb entryStefan Herbrechtsmeier
Add an optional length header attribute to the device tree blob entry class based on the compressed data header from the utilities to compress and decompress data. If needed the header could be enabled with the following attribute beside the compress attribute: prepend = "length"; The header was introduced as part of commit eb0f4a4cb402 ("binman: Support replacing data in a cbfs") to allow device tree entries to be larger than the compressed contents. Regarding the commit "this is necessary to cope with a compressed device tree being updated in such a way that it shrinks after the entry size is already set (an obscure case)". This case need to be fixed without influence any compressed data by itself. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add DecompressData function to entry classStefan Herbrechtsmeier
Add a DecompressData function to entry class to allow override in child classes and to centralize the compress and decompress in a single class. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Check only section data in multi section testStefan Herbrechtsmeier
Check only section data instead of the rest of the image in multi section test. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Collect bintools before usageStefan Herbrechtsmeier
Collect and thereby initialize bintools before any usage but after generation of entries. This is needed to handle bintools for compress and decompress like other bintools. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Forward AddBintools calls to base classStefan Herbrechtsmeier
Forward AddBintools calls to base class to collect bintools of base class. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Forward AddBintools calls to sub entries in cbfs_utilStefan Herbrechtsmeier
Forward AddBintools calls to sub entries in cbfs_util to collect bintools of sub entries. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Avoid duplicates in bintool listsStefan Herbrechtsmeier
Avoid duplicate entries in the list of bintools used by the image and the list of missing bintools. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Skip elf tests if python elftools is not availableStefan Herbrechtsmeier
Skip tests which requires python elftools if the tool is not available. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Allow collection to use entries from other sectionsSimon Glass
At present the collections etype only works with entries in the same section. This can be limiting, since in some cases the data may be inside a subsection, e.g. if there are alignment constraints. Add a function to find the entries in an etype and have it search recursively. Make use of this for mkimage also. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Allow passing entries using -nSimon Glass
Also control over what goes in the file passed with -n using a separate imagename subnode. This can include a section or any other entry type. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Allow the image name to be the data fileSimon Glass
Some image types use the -n parameter to pass in the data file. Add support for this, with a new property. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Improve mkimage documentationSimon Glass
Expand this a little to make things clearer. Also drop the invalid entry arg. Series-changes 2 - Make it clear that -d data is concatenated/collected by binman - Fix mulitple typoe - Reword a sentence for grammar Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Avoid use of expected failureSimon Glass
The testReplaceSectionSimple() test is the only one which expects failure. It looks odd in the output and takes time to glance at it to see that all is in fact well. Also it does not check that the right exception is generated. Use the more common (in binman) approach of checking for an exception. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Adjust mkimage etype node readingSimon Glass
Since this is implemented as a section, it should really be split into several functions, one to read the node and one to read the entries. Do this so that it matches how Entry_section works. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add a way to check for missing propertiesSimon Glass
Some new entries are likely to have required properties. Support this in a standard way, with a list of required properties which can be set up by base classes. Check for missing properties when the entry is read. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Fix up the entry-docs for Entry_pre_loadSimon Glass
This has got out of sync and needs a line wrap. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20patman: Don't buffer test output with a single testSimon Glass
When a single test is run we don't need to buffer the test output. This has the unfortunate side effect of suppressing test output, in particular the binman output directory normally printed with the -X option. This is a huge problem since it blocks debugging of tests. We don't actually know how many tests will be run when we set up the suite, so as a work-around, assume that test_name being specified indicates that there is likely only one. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20patman: Put the coverage command-line lastSimon Glass
Put this at the end so it is easier to copy it from the terminal. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Put fake files in a subdirectorySimon Glass
At present fake files from a previous build appear to be real files for a subsequent build, since they sit in the output directory. This can cause problems, since binman may need to parse the file, e.g. with the Intel description.bin files. Fix this by putting them in a 'binman-fake' subdirectory. Keep a track of the fake filename so we only create it once. Subsequent builds will still see that the file is missing and mark it as fake. Update a few tests to check the behaviour. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20arm: k3: Correct an awk warningSimon Glass
The k3_gen_x509_cert.sh script produced this warning on gitlab and also on my machine, e.g. with j7200_evm_r5: awk: cmd. line:1: warning: regexp escape sequence `\ ' is not a known regexp operator There is no need to escape spaces, so drop the backslashes. Also split the line so it is a more reasonable length. This script should really be deleted and binman used instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20tools: mkeficapsule: use pkg-config for each lib separatHeiko Thiery
Call pkg-config for each library individually. This improves fallback handling. Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Fixes: 31a7688cbe0e ("tools: mkeficapsule: use pkg-config to get -luuid and -lgnutls") Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-08-13binman: Add more documentation about binman usageSimon Glass
This is an attempt to answer the comments provided by Xavier [1]. [1] https://lore.kernel.org/all/Yulcol7HpTHtjXTX@begut/ Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-08-13binman: Add rST references for binman entry typesSimon Glass
Add references in the documentation for each entry type, so we can refer to them from other documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-13patman: Add documentation to doc/Simon Glass
Link to patman's documentation from the doc/ directory so that it appears in the 'make htmldocs' output. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-08-09dtoc: Correct remaining pylint problems in test_fdtSimon Glass
Fix various camel-case and other naming problems. Update the pylint base file to avoid regressions. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-09test_fdt: Convert to use argparseSimon Glass
Drop the deprecated OptionParser. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-09dtoc: Move main program into its own functionSimon Glass
Use a function for the main program so everything there doesn't look like a global variable to pylint. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-09dtoc: Fix fdt test coverageSimon Glass
Fix a bug that the --processes option was ignored, thus resulting in no test coverage information being generated. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 42ae363ddd9 ("dtoc: Update fdt tests to use test_util")
2022-08-09dtoc: Tidy up fdt_tests RunTests()Simon Glass
Pass the options args in rather than using the global variables. Use snake case, fix up comments and use a ternary operator to make pylint happy. Signed-off-by: Simon Glass <sjg@chromium.org>