aboutsummaryrefslogtreecommitdiff
path: root/tools/mkimage.c
diff options
context:
space:
mode:
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>2021-02-19 12:45:17 -0600
committerTom Rini <trini@konsulko.com>2021-04-14 15:23:01 -0400
commit36bfcb62b3e7b846d0b693828df54a0d58e07511 (patch)
tree03d50859acde65af4076bd5565c71e3ae765a3c7 /tools/mkimage.c
parentfb6532ec6c0c247dc204f65cb298d0865f7eaf3b (diff)
downloadu-boot-36bfcb62b3e7b846d0b693828df54a0d58e07511.zip
u-boot-36bfcb62b3e7b846d0b693828df54a0d58e07511.tar.gz
u-boot-36bfcb62b3e7b846d0b693828df54a0d58e07511.tar.bz2
mkimage: Add a 'keyfile' argument for image signing
It's not always desirable to use 'keydir' and some ad-hoc heuristics to get the filename of the signing key. More often, just passing the filename is the simpler, easier, and logical thing to do. Since mkimage doesn't use long options, we're slowly running out of letters. I've chosen '-G' because it was available. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/mkimage.c')
-rw-r--r--tools/mkimage.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c
index 68d5206..cc7b242 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -108,6 +108,7 @@ static void usage(const char *msg)
"Signing / verified boot options: [-k keydir] [-K dtb] [ -c <comment>] [-p addr] [-r] [-N engine]\n"
" -k => set directory containing private keys\n"
" -K => write public keys to this .dtb file\n"
+ " -G => use this signing key (in lieu of -k)\n"
" -c => add comment in signature node\n"
" -F => re-sign existing FIT image\n"
" -p => place external data at a static position\n"
@@ -151,7 +152,7 @@ static void process_args(int argc, char **argv)
int opt;
while ((opt = getopt(argc, argv,
- "a:A:b:B:c:C:d:D:e:Ef:Fk:i:K:ln:N:p:O:rR:qstT:vVx")) != -1) {
+ "a:A:b:B:c:C:d:D:e:Ef:FG:k:i:K:ln:N:p:O:rR:qstT:vVx")) != -1) {
switch (opt) {
case 'a':
params.addr = strtoull(optarg, &ptr, 16);
@@ -226,6 +227,9 @@ static void process_args(int argc, char **argv)
params.type = IH_TYPE_FLATDT;
params.fflag = 1;
break;
+ case 'G':
+ params.keyfile = optarg;
+ break;
case 'i':
params.fit_ramdisk = optarg;
break;