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@lemmela.net>
This commit is contained in:
		 Oskari Lemmela
					Oskari Lemmela
				
			
				
					committed by
					
						 Daniel Golle
						Daniel Golle
					
				
			
			
				
	
			
			
			 Daniel Golle
						Daniel Golle
					
				
			
						parent
						
							46c411e0b3
						
					
				
				
					commit
					4a078bd135
				
			| @@ -529,6 +529,7 @@ static guid_t type_to_guid_and_name(unsigned char type, char **name) | |||||||
|  |  | ||||||
| 	switch (type) { | 	switch (type) { | ||||||
| 		case 0xef: | 		case 0xef: | ||||||
|  | 			if(*name == NULL) | ||||||
| 				*name = "EFI System Partition"; | 				*name = "EFI System Partition"; | ||||||
| 			guid = GUID_PARTITION_SYSTEM; | 			guid = GUID_PARTITION_SYSTEM; | ||||||
| 			break; | 			break; | ||||||
| @@ -586,6 +587,7 @@ int main (int argc, char **argv) | |||||||
| 				*(p++) = 0; | 				*(p++) = 0; | ||||||
| 				parts[part].start = to_kbytes(p); | 				parts[part].start = to_kbytes(p); | ||||||
| 			} | 			} | ||||||
|  | 			part_guid = type_to_guid_and_name(type, &name); | ||||||
| 			parts[part].size = to_kbytes(optarg); | 			parts[part].size = to_kbytes(optarg); | ||||||
| 			parts[part].required = required; | 			parts[part].required = required; | ||||||
| 			parts[part].name = name; | 			parts[part].name = name; | ||||||
| @@ -598,7 +600,6 @@ int main (int argc, char **argv) | |||||||
| 			 */ | 			 */ | ||||||
| 			name = NULL; | 			name = NULL; | ||||||
| 			required = 0; | 			required = 0; | ||||||
| 			part_guid = type_to_guid_and_name(type, &name); |  | ||||||
| 			break; | 			break; | ||||||
| 		case 'N': | 		case 'N': | ||||||
| 			name = optarg; | 			name = optarg; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user