diff options
author | Drake Dowsett <dowsett@de.ibm.com> | 2006-11-06 16:54:10 +0100 |
---|---|---|
committer | Frank Haverkamp <haver@vnet.ibm.com> | 2006-11-06 16:54:10 +0100 |
commit | 31b015fc08a13a5b63245808f7d1a49eadd8193a (patch) | |
tree | 6ab4ce9a35f18e7b53c95c5cb8063cc55e54615d /ubi-utils/src/reader.c | |
parent | 6918e0320c89bc892a6c5d2c6792e5d058e40a6e (diff) |
[MTD] UBI: pfiflash needs to flash raw sections and check CRC
Flashing of raw partitions should be possible now.
CRC checking of pfi files before flashing the content was added.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
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."); |