diff options
author | Anton Leontiev <aleontiev@elvees.com> | 2019-09-03 10:52:24 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-12-01 10:33:37 -0500 |
commit | db3667413d99b8ec1b1e7e9b34c20a8883ec413d (patch) | |
tree | 8ea99df48dead14c53508e3ae454baddaa2767e6 /cmd | |
parent | 0719bf42931033c3109ecc6357e8adb567cb637b (diff) |
cmd: pxe: Use internal FDT if retrieving from FDTDIR fails
As FDTDIR label doesn't specify exact file to be loaded, it should
not fail if no file exists in the directory. In this case try to boot
with internal FDT if it exists.
Signed-off-by: Anton Leontiev <aleontiev@elvees.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/pxe_utils.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c index 8716e782f6a..235522f4bbc 100644 --- a/cmd/pxe_utils.c +++ b/cmd/pxe_utils.c @@ -451,11 +451,14 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label) /* * fdt usage is optional: - * It handles the following scenarios. All scenarios are exclusive + * It handles the following scenarios. * - * Scenario 1: If fdt_addr_r specified and "fdt" label is defined in - * pxe file, retrieve fdt blob from server. Pass fdt_addr_r to bootm, - * and adjust argc appropriately. + * Scenario 1: If fdt_addr_r specified and "fdt" or "fdtdir" label is + * defined in pxe file, retrieve fdt blob from server. Pass fdt_addr_r to + * bootm, and adjust argc appropriately. + * + * If retrieve fails and no exact fdt blob is specified in pxe file with + * "fdt" label, try Scenario 2. * * Scenario 2: If there is an fdt_addr specified, pass it along to * bootm, and adjust argc appropriately. @@ -521,9 +524,13 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label) free(fdtfilefree); if (err < 0) { - printf("Skipping %s for failure retrieving fdt\n", - label->name); - goto cleanup; + bootm_argv[3] = NULL; + + if (label->fdt) { + printf("Skipping %s for failure retrieving FDT\n", + label->name); + goto cleanup; + } } } else { bootm_argv[3] = NULL; |