[openwrt/openwrt] firmware-utils/ptgen: fix partition guid and name

LEDE Commits lede-commits at lists.infradead.org
Wed Mar 3 01:01:11 GMT 2021


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/4a078bd1354eaa2bba109d411218820e03b2e1de

commit 4a078bd1354eaa2bba109d411218820e03b2e1de
Author: Oskari Lemmela <oskari at lemmela.net>
AuthorDate: Tue Mar 2 21:42:07 2021 +0200

    firmware-utils/ptgen: fix partition guid and name
    
    guid and name function should be called before storing
    partition info.
    
    Signed-off-by: Oskari Lemmela <oskari at lemmela.net>
---
 tools/firmware-utils/src/ptgen.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c
index a55f2e7a14..d50c12b714 100644
--- a/tools/firmware-utils/src/ptgen.c
+++ b/tools/firmware-utils/src/ptgen.c
@@ -529,7 +529,8 @@ static guid_t type_to_guid_and_name(unsigned char type, char **name)
 
 	switch (type) {
 		case 0xef:
-			*name = "EFI System Partition";
+			if(*name == NULL)
+				*name = "EFI System Partition";
 			guid = GUID_PARTITION_SYSTEM;
 			break;
 		case 0x83:
@@ -586,6 +587,7 @@ int main (int argc, char **argv)
 				*(p++) = 0;
 				parts[part].start = to_kbytes(p);
 			}
+			part_guid = type_to_guid_and_name(type, &name);
 			parts[part].size = to_kbytes(optarg);
 			parts[part].required = required;
 			parts[part].name = name;
@@ -598,7 +600,6 @@ int main (int argc, char **argv)
 			 */
 			name = NULL;
 			required = 0;
-			part_guid = type_to_guid_and_name(type, &name);
 			break;
 		case 'N':
 			name = optarg;



More information about the lede-commits mailing list