[U-Boot] [PATCHv5 7/7] mkenvimage: Really set the redundant byte when applicable

David Wagner david.wagner at free-electrons.com
Sat Jan 14 00:27:40 CET 2012


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 ddd4515..e148f89 100644
--- a/tools/mkenvimage.c
+++ b/tools/mkenvimage.c
@@ -285,7 +285,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;
 
 	if (!bin_filename || strcmp(bin_filename, "-") == 0) {
 		bin_fd = STDOUT_FILENO;
-- 
1.7.5.4



More information about the U-Boot mailing list