mkimage: fix generation of FIT image
Commit 7a439cadcf
broke generation of SPL
loadable FIT images (CONFIG_SPL_LOAD_FIT).
Fix it by removing the unnecessary storage of expected image type. This was a
left over of the previous implementation. It is not longer necessary since the
mkimage -b switch always has one parameter.
Tested-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Andreas Bießmann <andreas@biessmann.org>
utp
parent
a6e7b7744e
commit
8edeac86db
|
@ -133,10 +133,8 @@ static void process_args(int argc, char **argv)
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int type = IH_TYPE_INVALID;
|
int type = IH_TYPE_INVALID;
|
||||||
char *datafile = NULL;
|
char *datafile = NULL;
|
||||||
int expecting;
|
|
||||||
int opt;
|
int opt;
|
||||||
|
|
||||||
expecting = IH_TYPE_COUNT; /* Unknown */
|
|
||||||
while ((opt = getopt(argc, argv,
|
while ((opt = getopt(argc, argv,
|
||||||
"a:A:b:cC:d:D:e:Ef:Fk:K:ln:O:rR:sT:vVx")) != -1) {
|
"a:A:b:cC:d:D:e:Ef:Fk:K:ln:O:rR:sT:vVx")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
|
@ -154,8 +152,7 @@ static void process_args(int argc, char **argv)
|
||||||
usage("Invalid architecture");
|
usage("Invalid architecture");
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
expecting = IH_TYPE_FLATDT;
|
if (add_content(IH_TYPE_FLATDT, optarg)) {
|
||||||
if (add_content(expecting, optarg)) {
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s: Out of memory adding content '%s'",
|
"%s: Out of memory adding content '%s'",
|
||||||
params.cmdname, optarg);
|
params.cmdname, optarg);
|
||||||
|
@ -238,7 +235,6 @@ static void process_args(int argc, char **argv)
|
||||||
show_image_types();
|
show_image_types();
|
||||||
usage("Invalid image type");
|
usage("Invalid image type");
|
||||||
}
|
}
|
||||||
expecting = type;
|
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
params.vflag++;
|
params.vflag++;
|
||||||
|
@ -254,7 +250,8 @@ static void process_args(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (optind < argc && expecting == type)
|
/* The last parameter is expected to be the imagefile */
|
||||||
|
if (optind < argc)
|
||||||
params.imagefile = argv[optind];
|
params.imagefile = argv[optind];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue