[U-Boot] [PATCH 8/9] mkenvimage: Really set the redundant byte when applicable

David Wagner david.wagner at free-electrons.com
Wed Nov 23 21:28:17 CET 2011


Signed-off-by: David Wagner <david.wagner at free-electrons.com>
---
 tools/mkenvimage.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
index 8d84c85..fa6eb6e 100644
--- a/tools/mkenvimage.c
+++ b/tools/mkenvimage.c
@@ -257,7 +257,9 @@ int main(int argc, char **argv)
 	crc = crc32(0, envptr, envsize);
 	targetendian_crc = bigendian ? cpu_to_be32(crc) : cpu_to_le32(crc);
 
-	memcpy(dataptr, &targetendian_crc, sizeof(uint32_t));
+	memcpy(dataptr, &targetendian_crc, sizeof(targetendian_crc));
+	if (redundant)
+		*(dataptr + sizeof(targetendian_crc)) = 1;
 
 	bin_fd = creat(bin_filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
 	if (bin_fd == -1) {
-- 
1.7.7.3



More information about the U-Boot mailing list