aboutsummaryrefslogtreecommitdiff
path: root/cmd/sysboot.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-10-14 12:48:03 -0600
committerTom Rini <trini@konsulko.com>2021-11-11 19:02:27 -0500
commit9e62e7ca543ea94a46f30053262f67202e2435f4 (patch)
tree9488e089c17fb5836b8a3157e8fee5dbe26cb097 /cmd/sysboot.c
parent929860bfbb3bb3d1bed1f5cbb8af8fbe8e5460a7 (diff)
downloadu-boot-9e62e7ca543ea94a46f30053262f67202e2435f4.zip
u-boot-9e62e7ca543ea94a46f30053262f67202e2435f4.tar.gz
u-boot-9e62e7ca543ea94a46f30053262f67202e2435f4.tar.bz2
pxe: Move common parsing coding into pxe_util
Both the syslinux and pxe commands use essentially the same code to parse and run extlinux.conf files. Move this into a common function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'cmd/sysboot.c')
-rw-r--r--cmd/sysboot.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/cmd/sysboot.c b/cmd/sysboot.c
index b81255e..7ee14df 100644
--- a/cmd/sysboot.c
+++ b/cmd/sysboot.c
@@ -60,10 +60,10 @@ static int do_sysboot(struct cmd_tbl *cmdtp, int flag, int argc,
{
unsigned long pxefile_addr_r;
struct pxe_context ctx;
- struct pxe_menu *cfg;
char *pxefile_addr_str;
char *filename;
int prompt = 0;
+ int ret;
if (argc > 1 && strstr(argv[1], "-p")) {
prompt = 1;
@@ -113,19 +113,9 @@ static int do_sysboot(struct cmd_tbl *cmdtp, int flag, int argc,
return 1;
}
- cfg = parse_pxefile(&ctx, pxefile_addr_r);
-
- if (!cfg) {
- printf("Error parsing config file\n");
- return 1;
- }
-
- if (prompt)
- cfg->prompt = 1;
-
- handle_pxe_menu(&ctx, cfg);
-
- destroy_pxe_menu(cfg);
+ ret = pxe_process(&ctx, pxefile_addr_r, prompt);
+ if (ret)
+ return CMD_RET_FAILURE;
return 0;
}