summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2025-03-24Merge tag 'v2025.04-rc5' into nextTom Rini
Prepare v2025.04-rc5
2025-03-18dumpimage: fix handling of StarFive SPL too longHeinrich Schuchardt
The header of the StarFive U-Boot SPL file u-boot-spl.normal.out has a field indicating the payload size. When copying U-Boot SPL from a partition the copied file might be too long. Currently in this situation a misleading error message 'Incorrect CRC32' is written. We must use the payload size and not the file size when calculating the CRC32. Write a warning if the file is too long indicating the correct size. This enables the user to truncate the file accordingly. Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-03-18qconfig: Correct unhashable-type error with --scan-sourceSimon Glass
This gives an error with newer Python version, so fix it. Signed-off-by: Simon Glass <[email protected]>
2025-03-13tools: add HOSTCFLAGS from openssl pkg-configRaymond Mao
HOSTCFLAGS of some tools components (image-host, rsa-sign and ecdsa-libcrypto) depend on the directory where openssl is installed. Add them via pkg-config. This fixes a potential build failure in tools when openssl in installed in varied directories. Signed-off-by: Raymond Mao <[email protected]> Reviewed-by: Peter Robinson <[email protected]>
2025-03-13Dockerfile: Add missing 'rm -rf /tmp/coreboot-24.08'Tom Rini
We had missed removing the coreboot directory once done, fix this. Signed-off-by: Tom Rini <[email protected]>
2025-03-12Merge patch series "binman: build_from_git: Add argument specifying branch"Tom Rini
This series from Leonard Anderweit <[email protected]> provides some improvements to the binman tool and i.MX specific tooling then makes use of it. Link: https://lore.kernel.org/r/[email protected]
2025-03-12binman: cst: Build from sourceLeonard Anderweit
Build the imx code singing tool from source instead of relying on the distro to provide the tool. Use the debian/unstable branch because the default branch is outdated. The binary is supposed to be build with docker, work around that by selecting the correct Makefile directly. Also append the description and add a link to documentation. Signed-off-by: Leonard Anderweit <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2025-03-12binman: build_from_git: Add optional make path inside git repoLeonard Anderweit
Add optional argument make_path to build_from git. The new argument allows specifying the path to a Makefile in case it is not in the root of the git repo. Also adjust the corresponding test. Signed-off-by: Leonard Anderweit <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2025-03-12binman: build_from_git: Add argument specifying branchLeonard Anderweit
Add optional argument git_branch to build_from_git. The new argument allows specifying which branch of the repo to use. Signed-off-by: Leonard Anderweit <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2025-03-10Merge tag 'v2025.04-rc4' into nextTom Rini
This uses Heinrich's merge of lib/efi_loader/efi_net.c which results in no changes.
2025-03-04Merge patch series "tools: Minor clean-ups for the command library"Tom Rini
Simon Glass <[email protected]> says: This series adds comments and fixes pylint warnings in the command library. It also introduces a new, simpler way of running a single command. Link: https://lore.kernel.org/r/[email protected]
2025-03-04u_boot_pylib: Add a function to run a single commandSimon Glass
Add a helper to avoid needing to use a list within a list for this simple case. Update existing users of runpipe() to use this where possible. Signed-off-by: Simon Glass <[email protected]>
2025-03-04u_boot_pylib: Fix pylint warnings in commandSimon Glass
This file has a lot of warnings. Before adding any more features, fix those which are straightforward to resolve. Signed-off-by: Simon Glass <[email protected]>
2025-03-04u_boot_pylib: Add an exception-class for errorsSimon Glass
Throwing an Exception is not very friendly since it is the top-level class of all exceptions. Declare a new class instead. Signed-off-by: Simon Glass <[email protected]>
2025-03-04u_boot_pylib: Correct case for test_resultSimon Glass
This should be in capitals and defined at the start of the file. Update it. Signed-off-by: Simon Glass <[email protected]>
2025-03-04binman: Honour the skip-at-start property more faithfullySimon Glass
A discussion on the mailing list about dealing with block offsets and binman symbols made me think that something is wrong with how Binman deals with the skip-at-start property. The feature was originally designed to handle x86 ROMs, which are mapped at the top of the address space. That seemed too specific, whereas skipping some space at the start seemed more generally useful. It has proved useful. For example, rockchip images start at block 64, so a skip-at-start of 0x8000 deals with this. But it doesn't actually work correctly, since the image_pos value does not give the actual position on the media. Fix this and update the documentation, moving it into the 'section' section. Signed-off-by: Simon Glass <[email protected]>
2025-03-04binman: Rename Entry.end_4gbSimon Glass
The property is named end_at_4gb so name the variable the same, to avoid confusion. Signed-off-by: Simon Glass <[email protected]>
2025-02-28Merge patch series "rsa: Add rsa_verify_openssl() to use openssl for host ↵Tom Rini
builds" Paul HENRYS <[email protected]> says: This serie of patches adds a new tool to authenticate files signed with a preload header. This tool is also used in the tests to actually verify the authenticity of the file signed with such a preload header. Link: https://lore.kernel.org/r/[email protected]
2025-02-28binman: Authenticate the image when testing the preload signaturePaul HENRYS
Use preload_check_sign to authenticate the generated image when testing the preload signature in testPreLoad(). Signed-off-by: Paul HENRYS <[email protected]>
2025-02-28tools: Add preload_check_sign to authenticate images with a pre-loadPaul HENRYS
preload_check_sign is added so that it can be used to authenticate images signed with the pre-load signature supported by binman and U-Boot. It could also be used to test the signature in binman tests signing images with the pre-load. Signed-off-by: Paul HENRYS <[email protected]>
2025-02-28image: Add an inline declaration of unmap_sysmem()Paul HENRYS
Add an empty inline declaration when compiling tools for a host where unmap_sysmem() is not defined. Signed-off-by: Paul HENRYS <[email protected]>
2025-02-28rsa: Add rsa_verify_openssl() to use openssl for host buildsPaul HENRYS
rsa_verify_openssl() is used in lib/rsa/rsa-verify.c to authenticate data when building host tools. Signed-off-by: Paul HENRYS <[email protected]>
2025-02-27tools: imx8mimage: Fix potential memory leakMaks Mishin
Dynamic memory, referenced by 'line', is allocated at imx8mimage.c:187 by calling function 'getline' and lost at imx8mimage.c:210. Signed-off-by: Maks Mishin <[email protected]>
2025-02-27tools: imx8image: Fix potential memory leakMaks Mishin
Dynamic memory, referenced by 'line', is allocated at imx8image.c:270 by calling function 'getline' and lost at imx8image.c:294. Signed-off-by: Maks Mishin <[email protected]>
2025-02-27tools: imximage: Fix potential memory leakMaks Mishin
Dynamic memory, referenced by 'line', is allocated at imximage.c:761 by calling function 'getline' and lost at imximage.c:793. Signed-off-by: Maks Mishin <[email protected]>
2025-02-24Merge tag 'v2025.04-rc3' into nextTom Rini
Prepare v2025.04-rc3
2025-02-24Revert "Merge patch series "Add preload_check_sign tool""Tom Rini
This reverts commit c8750efe02c20725388dd4279896aaf306acfad4, reversing changes made to 8c6cf8aeea7e57ca686de8b765e4baf3a7ef1fa7. Unfortunately these changes do not build on macOS hosts. Signed-off-by: Tom Rini <[email protected]>
2025-02-21buildman: Update tests for newer filelock moduleSimon Glass
Recent versions of this module call time.perf_counter() so add a patch for this also. Signed-off-by: Simon Glass <[email protected]> Reported-by: Tom Rini <[email protected]>
2025-02-21Merge patch series "Add preload_check_sign tool"Tom Rini
Paul HENRYS <[email protected]> says: This serie of patches adds a new tool to authenticate files signed with a preload header. This tool is also used in the tests to actually verify the authenticity of the file signed with such a preload header. Link: https://lore.kernel.org/r/[email protected]
2025-02-21binman: Authenticate the image when testing the preload signaturePaul HENRYS
Use preload_check_sign to authenticate the generated image when testing the preload signature in testPreLoad(). Signed-off-by: Paul HENRYS <[email protected]>
2025-02-21tools: Add preload_check_sign to authenticate images with a pre-loadPaul HENRYS
preload_check_sign is added so that it can be used to authenticate images signed with the pre-load signature supported by binman and U-Boot. It could also be used to test the signature in binman tests signing images with the pre-load. Signed-off-by: Paul HENRYS <[email protected]>
2025-02-21image: Add an inline declaration of unmap_sysmem()Paul HENRYS
Add an empty inline declaration when compiling tools for a host where unmap_sysmem() is not defined. Signed-off-by: Paul HENRYS <[email protected]>
2025-02-21rsa: Add rsa_verify_openssl() to use openssl for host buildsPaul HENRYS
rsa_verify_openssl() is used in lib/rsa/rsa-verify.c to authenticate data when building host tools. Signed-off-by: Paul HENRYS <[email protected]>
2025-02-21tools: Fix pylint 3.3.4 errorsSimon Glass
This newer pylint produces errors about variables possibly being used before being set. Adjust the code to pass these checks. Signed-off-by: Simon Glass <[email protected]> Reported-by: Tom Rini <[email protected]>
2025-02-21tools/patman: Don't call a non-existent suiteTom Rini
With a newer pylint we get a warning that gitutil.RunTests does not exist, so remove the line. Signed-off-by: Tom Rini <[email protected]>
2025-02-21tools: binman: ti_board_cfg: Fix pylint error over 'br'Tom Rini
With a newer pylint, we get a warning that 'br' could be used before assignment. Fix this by declaring br first as an empty bytearray. Reviewed-by: Neha Malcom Francis <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2025-02-21binman: Switch to setuptoolsTom Rini
With the distutils module having been removed with Python 3.12, switch to using setuptools instead. Signed-off-by: Tom Rini <[email protected]>
2025-02-21dtoc: Switch to setuptoolsTom Rini
With the distutils module having been removed with Python 3.12, switch to using setuptools instead. Signed-off-by: Tom Rini <[email protected]>
2025-02-18tools: Fix potential null-deref with result of strtok_rMaks Mishin
Return value of a function 'strtok_r' is dereferenced at kwbimage.c:1655 without checking for NULL, but it is usually checked for this function. Signed-off-by: Maks Mishin <[email protected]>
2025-02-18tools: use cryptographically safe RNGHeinrich Schuchardt
The PRNG implementing the random() function only has 2^31 states and therefore is unsafe to use for cryptography. Use arc4random() instead. Fixes: cc34f04efd63 ("tools: image-host.c: use random instead of rand") Addresses-Coverity-ID: 312953 Calling risky function Signed-off-by: Heinrich Schuchardt <[email protected]>
2025-02-17u_boot_pylib: Move gitutil into the librarySimon Glass
Move this file into U-Boot's Python library, so that it is no-longer part of patman. This makes a start on: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/35 Signed-off-by: Simon Glass <[email protected]>
2025-02-14Merge patch series "Rework requirements.txt files"Tom Rini
Tom Rini <[email protected]> says: A challenge we've run in to is making it easier for more people to use various python tools that we include in the tree. Part of the problem is that when we have a requirements.txt file, aside from the doc one we share with the kernel, I created it using "pip freeze". And while this might have been a best (or at least OK) practice at the time, that's no longer the case and is why our files have so many things in them. What this series does is create multiple files, one per project/tool and then has CI install them as needed. There's a few places here where this means that we update the requirements as well, but we keep a few big things where they are currently. This is because updating them introduces problems of their own and delaing with that would best be a follow up series. I've put this through GitLab and Azure to make sure everything is still going fine on both platforms. Link: https://lore.kernel.org/r/[email protected]
2025-02-14Dockerfile: Update for having more requirements.txt filesTom Rini
Now that we have more requirements.txt files we need to grab all of them for creating our cache. Also, we do longer should install python3-pyelftools on the host as it's not used. Signed-off-by: Tom Rini <[email protected]>
2025-02-14python: Recreate test/py and tools/buildman requirements.txt filesTom Rini
Use the "pipreqs" tool to re-create these files, with a few manual corrections. We still need to include pytest-xdist which the tool does not detect. We also for now don't upgrade most of the required tools as that creates problems with various tests, which should be resolved independently. Signed-off-by: Tom Rini <[email protected]>
2025-02-14python: Create requirements.txt files for each "project"Tom Rini
Rather than have a requirements.txt file that's shared between multiple python projects within U-Boot, create one for each using "pipreqs". Signed-off-by: Tom Rini <[email protected]>
2025-02-11tools: proftool: Fix potential memory leaksMaks Mishin
Dynamic memory, referenced by 'line', is allocated by calling function 'calloc' and lost when the function terminates with code -1. Signed-off-by: Maks Mishin <[email protected]>
2025-02-11tools: ublimage: Fix memory leak in parse_cfg_file()Maks Mishin
Dynamic memory, referenced by 'line', is allocated at ublimage.c:159 by calling function 'getline' and lost at ublimage.c:184. Signed-off-by: Maks Mishin <[email protected]>
2025-02-11tools: fix NULL_AFTER_DEREF in image-host.cAnton Moryakov
Report of the static analyzer: 1. NULL_AFTER_DEREF Pointer 'str', which is dereferenced at image-host.c:688 by calling function 'strdup', is compared to a NULL value at image-host.c:691. 2. NULL_AFTER_DEREF Pointer 'list', which is dereferenced at image-host.c:689, is compared to a NULL value at image-host.c:691. Corrections explained: 1. Checking for NULL before using pointers: The if (!list || !str) check is now performed before calling strdup and realloc, which prevents null pointer dereferences. 2. Checking the result of strdup: strdup can return NULL if memory allocation fails. This also needs to be checked. 3. Checking the result of realloc: If realloc returns NULL, then memory has not been allocated and dup must be freed to avoid memory leaks. Triggers found by static analyzer Svace. Signed-off-by: Anton Moryakov <[email protected]>
2025-02-10tools: mkenvimage: List -V parameter in help textMarek Vasut
The -V version parameter is missing in the optional list of parameters in help text. Add it. Signed-off-by: Marek Vasut <[email protected]>
2025-02-03lib: Allow crc16 code to be droppedSimon Glass
This code is not necessarily needed in VPL, even if SPL uses it, so adjust the rules to allow it to be dropped. Do the same for the hash API. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>