pxe: Clean up the use of bootfile
authorSimon Glass <sjg@chromium.org>
Thu, 14 Oct 2021 18:48:04 +0000 (12:48 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 12 Nov 2021 00:02:28 +0000 (19:02 -0500)
commit12df842ee324a7e188a643bfee6fe08f28127b26
treecb34fdc5fbc3f5941141fcc3a8e830369aa35e60
parent9e62e7ca543ea94a46f30053262f67202e2435f4
pxe: Clean up the use of bootfile

The 'bootfile' environment variable is read in the bowels of pxe_util to
provide a directory to which all loaded files are relative.

This is not obvious from the API to PXE and it is strange to make the
caller set an environment variable rather than pass this as a parameter.

The code is also convoluted, which this feature implemented by
get_bootfile_path().

Update the API to improve this. Unfortunately this means that
pxe_setup_ctx() can fail, so add error checking.

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>
boot/pxe_utils.c
cmd/pxe.c
cmd/sysboot.c
include/pxe_utils.h