aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/btool
AgeCommit message (Collapse)AuthorFilesLines
2023-11-02binman: openssl: x509: ti_secure_rom: Add support for bootcore_optsNeha Malcom Francis1-2/+4
According to the TRMs of K3 platform of devices, the ROM boot image format specifies a "Core Options Field" that provides the capability to set the boot core in lockstep when set to 0 or to split mode when set to 2. Add support for providing the same from the binman DTS. Also modify existing test case for ensuring future coverage. Signed-off-by: Neha Malcom Francis <n-francis@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-13btool: mkeficapsule: Add support for EFI empty capsule generationSughosh Ganu1-0/+26
Add a method to the mkeficapsule bintool to generate empty capsules. These are capsules needed for the FWU A/B update feature. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-13binman: bintool: Change make target arg type from string to listLukas Funke3-3/+3
The argument type of `build_from_git` was changed from string to list in d71e7116997f14097735f04cc7847f0a68dbc485. This commit adapts the argument type of all bintools using this function. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2023-08-29btool: mkeficapsule: Add a bintool for EFI capsule generationSughosh Ganu1-0/+101
Add a bintool for generating EFI capsules. This calls the mkeficapsule tool which generates the capsules. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-05binman: btool: Add Xilinx Bootgen btoolLukas Funke1-0/+137
Add the Xilinx Bootgen as bintool. Xilinx Bootgen is used to create bootable SPL (FSBL in Xilinx terms) images for Zynq/ZynqMP devices. The btool creates a signed version of the SPL. Additionally to signing the key source for the decryption engine can be passend to the boot image. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
2023-07-24binman: btool: Add fdt_add_pubkey as btoolLukas Funke1-0/+67
Add btool which calls 'fdt_add_pubkey' Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-21binman: ti-secure: Add support for TI signingNeha Malcom Francis1-0/+244
The ti-secure entry contains certificate for binaries that will be loaded or booted by system firmware whereas the ti-secure-rom entry contains certificate for binaries that will be booted by ROM. Support for both these types of certificates is necessary for booting of K3 devices. Reviewed-by: Simon Glass <sjg@chromium.org> [vigneshr@ti.com: fixed inconsist cert generation by multiple packing] Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2023-03-08binman: Support generation of x509 certificatesSimon Glass1-0/+94
And a new entry type which supports generation of x509 certificates. This uses a new 'openssl' btool with just one operation so far. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08patman: Move library functions into a library directorySimon Glass2-2/+2
The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-26binman: Add support for align argument to mkimage toolJonas Karlman1-1/+4
Add support to indicate what alignment to use for the FIT and its external data. Pass the alignment to mkimage via the -B flag. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-22Revert "binman: btool: gzip: fix packer name so that binary can be found"Quentin Schulz1-1/+1
This reverts commit daa2da754afe1bac777f6cb0f05233e0de7b325d. This commit is not needed anymore since the btool_ prefix is automatically stripped by bintool. Cc: Quentin Schulz <foss+uboot@0leil.net> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-22binman: bintool: remove btool_ prefix from btool namesQuentin Schulz1-1/+1
The binary is looked on the system by the suffix of the packer class. This means binman was looking for btool_gzip on the system and not gzip. Since a btool can have its btool_ prefix missing but its module and binary presence on the system appropriately found, there's no need to actually keep this prefix after listing all possible btools, so let's remove it. This fixes gzip btool by letting Bintool.find_bintool_class handle the missing prefix and still return the correct class which is then init with gzip name instead of btool_gzip. Additionally, there was an issue with the cached module global variable. The variable only stores the module and not the associated class name when calling find_bintool_class. This means that when caching the module on the first call to find_bintool_class, class_name would be set to Bintoolbtool_gzip but the module_name gzip only, adding the module in the gzip key in the module dictionary. When hitting the cache on next calls, the gzip key would be found, so its value (the module) is used. However the default class_name (Bintoolgzip) is used, failing the getattr call. Instead, let's enforce the same class name: Bintool<packer>, whatever the filename it is contained in. Cc: Quentin Schulz <foss+uboot@0leil.net> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-21binman: Get futility by building itSimon Glass1-4/+13
A binary download is not great, since it depends on libraries being present in the system. Build futility from source instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-01binman: bintool: bzip2: fix version function on non-Debian-based systemsQuentin Schulz1-1/+1
Upstream bzip2 1.0.x actually is stuck when running bzip2 -V and redirecting the output. This is fixed in Debian for about a decade already in https://git.launchpad.net/ubuntu/+source/bzip2/tree/debian/patches/20-legacy.patch?h=ubuntu/jammy and in bzip2 1.1.x (no release yet, see https://gitlab.com/bzip2/bzip2/-/commit/65179284ceddc43e6388bf4ed8c2d85cf16e1b2f ). Fedora notably does not have such a patch. Since bzip2 --help actually prints the version number too, let's use it instead so that binman works fine on (hopefully) all distributions. Fixes: 45aa2798008c ("binman: Add bzip2 bintool") Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-01binman: btool: futility: use Bintool.versionQuentin Schulz1-12/+1
Bintool.version can now be passed the binary argument to return the version text, so there's no need to override it in futility anymore. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-01binman: btool: fiptool: use Bintool.versionQuentin Schulz1-10/+1
Bintool.version can now be passed the binary argument to return the version text, so there's no need to override it in fiptool anymore. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-01binman: btool: mkimage: use Bintool.versionQuentin Schulz1-16/+2
Bintool.version already contains everything required to get the version out of mkimage binary so let's not override it with its own implementation. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-01binman: btool: lz4: use Bintool.versionQuentin Schulz1-13/+1
Bintool.version already contains everything required to get the version out of lz4 binary so let's not override it with its own implementation. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-01binman: btool: gzip: fix packer name so that binary can be foundQuentin Schulz1-1/+1
The binary is looked on the system by the suffix of the packer class. This means binman was looking for btool_gzip on the system and not gzip. Therefore, let's pass "gzip" as the name so that it can be found and used. Fixes: 0f369d79925a ("binman: Add gzip bintool") Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add zstd bintoolStefan Herbrechtsmeier1-0/+30
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 Herbrechtsmeier1-0/+31
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 Herbrechtsmeier1-0/+30
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 Herbrechtsmeier1-0/+31
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 Herbrechtsmeier1-0/+30
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-04-06binman: Correct Chromium OS entry typesSimon Glass1-2/+2
The conversion to bintools broke the invocation of the utility, since the arguments are not correct. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in tools.pySimon Glass2-12/+12
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for lzma_aloneSimon Glass1-0/+126
Add a Bintool for this, which is used to compress and decompress data. It supports the features needed by binman as well as installing via the lzma-alone package. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for lz4Simon Glass1-0/+140
Add a Bintool for this, which is used to compress and decompress data. It supports the features needed by binman as well as installing via the lz4 package. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for mkimageSimon Glass1-0/+80
Add a Bintool for this, which is used to build images for use by U-Boot. It supports the features needed by binman as well as installing via the u-boot-tools packages. Although this is built in the U-Boot tree, it is still useful to install a binary on the system. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for ifwitoolSimon Glass1-0/+166
Add a Bintool for this, which is used to build Intel IFWI images. It supports the features needed by the tests as well as downloading a binary from Google Drive. Although this is built in the U-Boot tree, it is not currently included with u-boot-tools, so it may be useful to install a binary on the system. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for futilitySimon Glass1-0/+178
Add a Bintool for this, which is used to sign Chrome OS images and build the Google Binary Block (GBB). It supports the features needed by binman as well as fetching a binary from Google Drive. Building it from source is possible but is left for another time, as it requires at least one other library. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for fiptoolSimon Glass1-0/+123
Add a Bintool for this, which is used to run FIP tests. It supports the features needed by the tests as well as building a binary from the git tree. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for cbfstoolSimon Glass1-0/+219
Add a Bintool for this, which is used to run CBFS tests. It supports the features needed by the tests as well as fetching a binary from Google Drive. Building it from source is very slow since it is not separately supported by the coreboot build system and it builds an entire gcc toolchain before starting. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add tests for bintoolSimon Glass1-0/+36
Add tests to cover the bintool functionality. Signed-off-by: Simon Glass <sjg@chromium.org>