mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
pxe: add support for per arch and SoC default paths
A pxelinux server setup for "default" menu is typically an x86 binary. This does not work well with a mixed architecture setup. Extend the default search to look for default-<arch>-<soc> and then default-<arch> before falling back to just "default". Signed-off-by: Rob Herring <rob.herring@calxeda.com>
This commit is contained in:
parent
8577fec976
commit
39f985536d
1 changed files with 20 additions and 6 deletions
|
@ -26,6 +26,13 @@
|
||||||
|
|
||||||
#define MAX_TFTP_PATH_LEN 127
|
#define MAX_TFTP_PATH_LEN 127
|
||||||
|
|
||||||
|
const char *pxe_default_paths[] = {
|
||||||
|
"default-" CONFIG_SYS_ARCH "-" CONFIG_SYS_SOC,
|
||||||
|
"default-" CONFIG_SYS_ARCH,
|
||||||
|
"default",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Like getenv, but prints an error if envvar isn't defined in the
|
* Like getenv, but prints an error if envvar isn't defined in the
|
||||||
* environment. It always returns what getenv does, so it can be used in
|
* environment. It always returns what getenv does, so it can be used in
|
||||||
|
@ -339,7 +346,7 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
char *pxefile_addr_str;
|
char *pxefile_addr_str;
|
||||||
unsigned long pxefile_addr_r;
|
unsigned long pxefile_addr_r;
|
||||||
int err;
|
int err, i = 0;
|
||||||
|
|
||||||
do_getfile = do_get_tftp;
|
do_getfile = do_get_tftp;
|
||||||
|
|
||||||
|
@ -360,16 +367,23 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
* Keep trying paths until we successfully get a file we're looking
|
* Keep trying paths until we successfully get a file we're looking
|
||||||
* for.
|
* for.
|
||||||
*/
|
*/
|
||||||
if (pxe_uuid_path((void *)pxefile_addr_r) > 0
|
if (pxe_uuid_path((void *)pxefile_addr_r) > 0 ||
|
||||||
|| pxe_mac_path((void *)pxefile_addr_r) > 0
|
pxe_mac_path((void *)pxefile_addr_r) > 0 ||
|
||||||
|| pxe_ipaddr_paths((void *)pxefile_addr_r) > 0
|
pxe_ipaddr_paths((void *)pxefile_addr_r) > 0) {
|
||||||
|| get_pxelinux_path("default", (void *)pxefile_addr_r) > 0) {
|
|
||||||
|
|
||||||
printf("Config file found\n");
|
printf("Config file found\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (pxe_default_paths[i]) {
|
||||||
|
if (get_pxelinux_path(pxe_default_paths[i],
|
||||||
|
(void *)pxefile_addr_r) > 0) {
|
||||||
|
printf("Config file found\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
printf("Config file not found\n");
|
printf("Config file not found\n");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue