From 6bb6ed9467926aa45fd0004df3693d5bc7b72dc0 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Wed, 8 Mar 2023 14:58:51 -0700 Subject: 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 Change-Id: I3a83e52d081a5909d54eacc575dd2b40b09e4038 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73656 Tested-by: build bot (Jenkins) Reviewed-by: Jason Glenesk --- util/amdfwtool/data_parse.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'util/amdfwtool') diff --git a/util/amdfwtool/data_parse.c b/util/amdfwtool/data_parse.c index aa4732f2e5..50f844fa67 100644 --- a/util/amdfwtool/data_parse.c +++ b/util/amdfwtool/data_parse.c @@ -655,8 +655,12 @@ 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); path_filename = malloc(MAX_LINE_SIZE * 2 + 2); - snprintf(path_filename, MAX_LINE_SIZE * 2 + 2, "%.*s/%.*s", - MAX_LINE_SIZE, dir, MAX_LINE_SIZE, fn); + 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", + MAX_LINE_SIZE, dir, MAX_LINE_SIZE, fn); if (find_register_fw_filename_psp_dir( fw_type_str, path_filename, ch_lvl, cb_config) == 0) { -- cgit v1.2.3