aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/mtd/src/fis.c
diff options
context:
space:
mode:
authorDaniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>2018-08-31 18:14:24 -0700
committerPetr Štetiar <ynezz@true.cz>2019-07-17 22:59:29 +0200
commitfd104daa2f818d39d9b53476f7e099fc481ce783 (patch)
tree9fd93e8e13eeaee6802d3e280cf08149286affa8 /package/system/mtd/src/fis.c
parent261df949faad6dda43454868628f79265e9cc5e7 (diff)
downloadupstream-fd104daa2f818d39d9b53476f7e099fc481ce783.tar.gz
upstream-fd104daa2f818d39d9b53476f7e099fc481ce783.tar.bz2
upstream-fd104daa2f818d39d9b53476f7e099fc481ce783.zip
mtd: add CRC signature to RedBoot partition map
The code for calculating the CRC32 signatures for RedBoot FIS partitions was already included, but for unknown reasons, it was never invoked. Some bootloaders enforce checking these for loaded kernels, so they should be written. This patch does so. Tested-by: Brian Gonyer <bgonyer@gmail.com> Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
Diffstat (limited to 'package/system/mtd/src/fis.c')
-rw-r--r--package/system/mtd/src/fis.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/package/system/mtd/src/fis.c b/package/system/mtd/src/fis.c
index b50411cfeb..e314c10258 100644
--- a/package/system/mtd/src/fis.c
+++ b/package/system/mtd/src/fis.c
@@ -243,14 +243,14 @@ fis_remap(struct fis_part *old, int n_old, struct fis_part *new, int n_new)
memset(desc, 0, sizeof(struct fis_image_desc));
memcpy(desc->hdr.name, part->name, sizeof(desc->hdr.name));
desc->crc.desc = 0;
- desc->crc.file = 0;
+ desc->crc.file = part->crc;
desc->hdr.flash_base = offset;
desc->hdr.mem_base = part->loadaddr;
desc->hdr.entry_point = part->loadaddr;
desc->hdr.size = (part->size > 0) ? part->size : size;
- desc->hdr.data_length = desc->hdr.size;
-
+ desc->hdr.data_length = (part->length > 0) ? part->length :
+ desc->hdr.size;
offset += desc->hdr.size;
size -= desc->hdr.size;
}