util/amdfwtool: Update config parser to accept full paths
This allows individual components to be placed in a location other than what is specified by the FIRMWARE_LOCATION line. Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: I3a83e52d081a5909d54eacc575dd2b40b09e4038 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73656 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jason Glenesk <jason.glenesk@gmail.com>
This commit is contained in:
		
				
					committed by
					
						
						Martin L Roth
					
				
			
			
				
	
			
			
			
						parent
						
							a18b8b44d7
						
					
				
				
					commit
					6bb6ed9467
				
			@@ -655,6 +655,10 @@ static uint8_t process_one_line(char *oneline, regmatch_t *match, char *dir,
 | 
				
			|||||||
	ch_lvl = get_level_from_config(oneline, ch_lvl_index, cb_config);
 | 
						ch_lvl = get_level_from_config(oneline, ch_lvl_index, cb_config);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	path_filename = malloc(MAX_LINE_SIZE * 2 + 2);
 | 
						path_filename = malloc(MAX_LINE_SIZE * 2 + 2);
 | 
				
			||||||
 | 
						if (strchr(fn, '/'))
 | 
				
			||||||
 | 
							snprintf(path_filename, MAX_LINE_SIZE * 2 + 2, "%.*s",
 | 
				
			||||||
 | 
									MAX_LINE_SIZE, fn);
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
		snprintf(path_filename, MAX_LINE_SIZE * 2 + 2, "%.*s/%.*s",
 | 
							snprintf(path_filename, MAX_LINE_SIZE * 2 + 2, "%.*s/%.*s",
 | 
				
			||||||
				MAX_LINE_SIZE, dir, MAX_LINE_SIZE, fn);
 | 
									MAX_LINE_SIZE, dir, MAX_LINE_SIZE, fn);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user