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

@ -165,8 +165,7 @@ partitioned_file_t *partitioned_file_create(const char *filename,
return file;
}
partitioned_file_t *partitioned_file_reopen(const char *filename,
partitioned_file_flat_decider_t flat_override)
partitioned_file_t *partitioned_file_reopen(const char *filename)
{
assert(filename);
@ -174,11 +173,6 @@ partitioned_file_t *partitioned_file_reopen(const char *filename,
if (!file)
return NULL;
if (flat_override && flat_override(&file->buffer)) {
INFO("Opening image as a flat file in response to explicit request\n");
return file;
}
long fmap_region_offset = fmap_find((const uint8_t *)file->buffer.data,
file->buffer.size);
if (fmap_region_offset < 0) {
@ -365,10 +359,3 @@ static bool select_parents_of(const struct fmap_area *parent, const void *arg)
}
const partitioned_file_fmap_selector_t partitioned_file_fmap_select_parents_of =
select_parents_of;
static bool open_as_flat(unused struct buffer *buffer)
{
return true;
}
const partitioned_file_flat_decider_t partitioned_file_open_as_flat =
open_as_flat;