util/ifittool: Fix clearing FIT when setting the pointer
When setting the FIT pointer, the FIT table is only known later in the codeflow. Change-Id: I658f4fffa997d1f7beaf6d6ae37d2885ae602e5c Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63035 Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
dd6b0610e3
commit
8b82c6b91b
|
@ -308,8 +308,6 @@ int main(int argc, char *argv[])
|
|||
ERROR("FIT not found.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (clear_table) {
|
||||
if (fit_clear_table(fit)) {
|
||||
partitioned_file_close(image_file);
|
||||
|
@ -317,6 +315,7 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (op) {
|
||||
case ADD_REGI_OP:
|
||||
|
@ -394,6 +393,15 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
fit = fit_get_table(&bootblock, convert_to_from_top_aligned, topswap_size);
|
||||
|
||||
if (clear_table) {
|
||||
if (fit_clear_table(fit)) {
|
||||
partitioned_file_close(image_file);
|
||||
ERROR("Failed to clear table.\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case DEL_OP:
|
||||
|
|
Loading…
Reference in New Issue