Module Name:    src
Committed By:   ryo
Date:           Sat Feb  8 13:27:01 UTC 2020

Modified Files:
        src/usr.bin/mkubootimage: mkubootimage.c

Log Message:
arm64_image_header->image_size must be included size of arm64_image_header.

with -u option, image_size should be binary (file) size (header included).
without -u option, image_size should be binary (file) size + header size.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/mkubootimage/mkubootimage.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/mkubootimage/mkubootimage.c
diff -u src/usr.bin/mkubootimage/mkubootimage.c:1.29 src/usr.bin/mkubootimage/mkubootimage.c:1.30
--- src/usr.bin/mkubootimage/mkubootimage.c:1.29	Wed Jan  1 11:48:36 2020
+++ src/usr.bin/mkubootimage/mkubootimage.c	Sat Feb  8 13:27:00 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: mkubootimage.c,v 1.29 2020/01/01 11:48:36 martin Exp $ */
+/* $NetBSD: mkubootimage.c,v 1.30 2020/02/08 13:27:00 ryo Exp $ */
 
 /*-
  * Copyright (c) 2010 Jared D. McNeill <[email protected]>
@@ -30,7 +30,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mkubootimage.c,v 1.29 2020/01/01 11:48:36 martin Exp $");
+__RCSID("$NetBSD: mkubootimage.c,v 1.30 2020/02/08 13:27:00 ryo Exp $");
 
 #include <sys/mman.h>
 #include <sys/stat.h>
@@ -389,7 +389,7 @@ generate_header_arm64(struct arm64_image
 #endif
 
 	const uint64_t dsize = update_image ?
-	   (uint64_t)st.st_size - sizeof(*hdr) : (uint64_t)st.st_size;
+	    (uint64_t)st.st_size : (uint64_t)st.st_size + sizeof(*hdr);
 
 	memset(hdr, 0, sizeof(*hdr));
 	hdr->code0 = htole32(ARM64_CODE0);

Reply via email to