diff options
Diffstat (limited to 'ubi-utils/src/reader.c')
-rw-r--r-- | ubi-utils/src/reader.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ubi-utils/src/reader.c b/ubi-utils/src/reader.c index 5de06d5..975caa1 100644 --- a/ubi-utils/src/reader.c +++ b/ubi-utils/src/reader.c @@ -29,10 +29,11 @@ #include <stdlib.h> #include <errno.h> -#include "config.h" #include "bootenv.h" #include "reader.h" +#define __unused __attribute__((unused)) + /* @FIXME hard coded offsets right now - get them from Artem? */ #define NAND2048_DEFAULT_VID_HDR_OFF 1984 #define NAND512_DEFAULT_VID_HDR_OFF 448 @@ -152,6 +153,12 @@ read_pfi_raw(pfi_header pfi_hd, FILE* fp_pfi __unused, pfi_raw_t* pfi_raw, goto err; } + rc = pfi_header_getnumber(pfi_hd, "crc", &(res->crc)); + if (rc != 0) { + EBUF_PFI("Cannot read 'crc' from PFI."); + goto err; + } + rc = pfi_header_getstring(pfi_hd, "raw_starts", tmp_str, PFI_KEYWORD_LEN); if (rc != 0) { @@ -212,6 +219,12 @@ read_pfi_ubi(pfi_header pfi_hd, FILE* fp_pfi __unused, pfi_ubi_t* pfi_ubi, goto err; } + rc = pfi_header_getnumber(pfi_hd, "crc", &(res->crc)); + if (rc != 0) { + EBUF_PFI("Cannot read 'crc' from PFI."); + goto err; + } + rc = pfi_header_getstring(pfi_hd, "ubi_ids", tmp_str, PFI_KEYWORD_LEN); if (rc != 0) { EBUF_PFI("Cannot read 'ubi_ids' from PFI."); |