binman: Add support for bintools
authorSimon Glass <sjg@chromium.org>
Mon, 10 Jan 2022 03:13:49 +0000 (20:13 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 25 Jan 2022 19:36:11 +0000 (12:36 -0700)
commit252de6b1f7189062d984b72149ea4d3123a63d8d
tree60c10dce7b90cdfd76ee4ec2fcefefabc7993a10
parent81d6e3f088f799b213b3a4be2b26619c5801e967
binman: Add support for bintools

Binman requires various tools to actually work, such as 'lz4' to compress
data and 'futility' to sign Chrome OS firmware. At present these are
handled in an ad-hoc manner and there is no easy way to find out what
tools are needd to build an image, nor where to obtain them.

Add an implementation of 'bintool', a base class which implements this
functionality. When a bintool is required, it can be requested from this
module, then executed. When the tool is missing, it can provide a way to
obtain it.

Note that this uses Command directly, not the tools.Run() function. This
allows proper handling of missing tools and avoids needing to catch and
re-raise exceptions.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/bintool.py [new file with mode: 0644]