cbfstool: prefer fmap data over cbfs master header if it exists

Up to now, if both fmap and a master header existed, the master header
was used. Now, use the master header only if no fmap is found.

Change-Id: Iafbf2c9dc325597e23a9780b495549b5d912e9ad
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/11629
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Patrick Georgi
2015-09-11 18:34:39 +02:00
committed by Patrick Georgi
parent 6dd99fcafe
commit 2f953d304e
4 changed files with 14 additions and 46 deletions

View File

@@ -881,12 +881,6 @@ static int cbfs_copy(void)
return cbfs_copy_instance(&image, param.copyoffset, param.size);
}
static bool cbfs_is_legacy_format(struct buffer *buffer)
{
// Legacy CBFSes are those containing the deprecated CBFS master header.
return cbfs_find_header(buffer->data, buffer->size, -1);
}
static const struct command commands[] = {
{"add", "H:r:f:n:t:c:b:a:vh?", cbfs_add, true, true},
{"add-flat-binary", "H:r:f:n:l:e:c:b:vh?", cbfs_add_flat_binary, true,
@@ -1250,8 +1244,7 @@ int main(int argc, char **argv)
}
} else {
param.image_file =
partitioned_file_reopen(image_name,
cbfs_is_legacy_format);
partitioned_file_reopen(image_name);
}
if (!param.image_file)
return 1;