unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob a24519d2f447c184e0a9a8269d3f954dd7581a5f 1507 bytes (raw)
name: gnu/packages/patches/u-boot-fix-mkimage-header-verification.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 
From da8dc3e61bab213b322eafeffa2802585508f288 Mon Sep 17 00:00:00 2001
From: Jordan Hand <jordanhand22@gmail.com>
Date: Tue, 9 Apr 2019 10:36:09 -0700
Subject: [PATCH] fdt: Fix mkimage list to try every header type
Origin: https://patchwork.ozlabs.org/patch/1082572/

Signed-off-by: Jordan Hand <jorhand@microsoft.com>
---
 tools/mkimage.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/tools/mkimage.c b/tools/mkimage.c
index 2899adff81..d1e1a6743d 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -403,14 +403,21 @@ int main(int argc, char **argv)
 			exit (EXIT_FAILURE);
 		}
 
-		/*
-		 * scan through mkimage registry for all supported image types
-		 * and verify the input image file header for match
-		 * Print the image information for matched image type
-		 * Returns the error code if not matched
-		 */
-		retval = imagetool_verify_print_header_by_type(ptr, &sbuf,
-				tparams, &params);
+		if (params.fflag) {
+			/*
+			 * Verifies the header format based on the expected header for image
+			 * type in tparams
+			 */
+			retval = imagetool_verify_print_header_by_type(ptr, &sbuf,
+					tparams, &params);
+		} else {
+			/**
+			 * When listing the image, we are not given the image type. Simply check all
+			 * image types to find one that matches our header
+			 */
+			retval = imagetool_verify_print_header(ptr, &sbuf,
+					tparams, &params);
+		}
 
 		(void) munmap((void *)ptr, sbuf.st_size);
 		(void) close (ifd);
-- 
2.20.1


debug log:

solving a24519d2f4 ...
found a24519d2f4 in https://yhetil.org/guix-patches/87h8b6ia13.fsf@ponder/

applying [1/1] https://yhetil.org/guix-patches/87h8b6ia13.fsf@ponder/
diff --git a/gnu/packages/patches/u-boot-fix-mkimage-header-verification.patch b/gnu/packages/patches/u-boot-fix-mkimage-header-verification.patch
new file mode 100644
index 0000000000..a24519d2f4

1:23: space before tab in indent.
 			exit (EXIT_FAILURE);
1:24: space before tab in indent.
 		}
1:25: trailing whitespace.
 
1:49: trailing whitespace.
 
1:50: space before tab in indent.
 		(void) munmap((void *)ptr, sbuf.st_size);
Checking patch gnu/packages/patches/u-boot-fix-mkimage-header-verification.patch...
Applied patch gnu/packages/patches/u-boot-fix-mkimage-header-verification.patch cleanly.
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.

index at:
100644 a24519d2f447c184e0a9a8269d3f954dd7581a5f	gnu/packages/patches/u-boot-fix-mkimage-header-verification.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).