mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-24 16:57:21 +00:00
dump_fmap: Find correct FMAP structure by checking version.
Firmware images reading its own FMAP structure may have FMAP signature in code and cause dump_fmap to parse incorrectly. Since currently there is only one major version for FMAP (and the structure defined in fmap.h also applies only to current version), we can improve that by checking major version number to skip signatures in firmware code. BUG=chromium:236347 TEST=emerge vboot_reference; dump_fmap /build/daisy/firmware/image.bin # success BRANCH=none Change-Id: I1d8f49bb88357e7a3a945fbdba9d9a7c4e177ac4 Reviewed-on: https://gerrit.chromium.org/gerrit/59362 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#define FMAP_SIGNATURE "__FMAP__"
|
||||
#define FMAP_SIGNATURE_SIZE 8
|
||||
#define FMAP_SEARCH_STRIDE 4
|
||||
#define FMAP_VER_MAJOR 1
|
||||
typedef struct _FmapHeader {
|
||||
char fmap_signature[FMAP_SIGNATURE_SIZE]; /* avoiding endian issues */
|
||||
uint8_t fmap_ver_major;
|
||||
|
||||
Reference in New Issue
Block a user