[PATCH RFC 01/10] common: Move host-only logic in image-sig.c to separate file
Simon Glass
sjg at chromium.org
Sat May 15 17:20:10 CEST 2021
Hi Alexandru,
On Fri, 14 May 2021 at 13:46, Alexandru Gagniuc <mr.nuke.me at gmail.com> wrote:
>
> image-sig.c is used to map a hash or crypto algorithm name to a
> handler of that algorithm. There is some similarity between the host
> and target variants, with the differences worked out by #ifdefs. The
> purpose of this change is to remove those ifdefs.
>
> First, copy the file to a host-only version, and remove target
> specific code. Although it looks like we are duplicating code,
> subsequent patches will change the way target algorithms are searched.
> Besides we are only duplicating three string to struct mapping
> functions. This isn't something to fuss about.
> ---
> common/image-sig-host.c | 134 ++++++++++++++++++++++++++++++++++++++++
> tools/Makefile | 2 +-
> 2 files changed, 135 insertions(+), 1 deletion(-)
> create mode 100644 common/image-sig-host.c
Will we never support signing in the board code? So far it is true,
but I wonder if it will remain so, as things get more and more
complicated. For example, we may want to sign the devicetree (somehow)
after fix-ups. The current code structure makes it possible to add
signing if needed. If we decided we wanted to sign on the board, how
would we refactor things with this approach?
If this is host code, can we move it to tools/ ?
Regards,
Simon
More information about the U-Boot
mailing list