pxelinux and syslinux differ in their handling of absolute paths in menu
files. A pxelinux path is aways prepended with the bootfile path while
syslinux allows for absolute paths. u-boot was always treating a leading
/ as an absolute path breaking some pxelinux setups. Fix this by adding
a flag to distinguish pxelinux vs. syslinux behavior.
Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
NULL
};
+static bool is_pxe;
+
/*
* 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
char *bootfile, *last_slash;
size_t path_len = 0;
- if (file_path[0] == '/')
+ /* Only syslinux allows absolute paths */
+ if (file_path[0] == '/' && !is_pxe)
goto ret;
bootfile = from_env("bootfile");
if (argc < 2)
return CMD_RET_USAGE;
+ is_pxe = true;
+
/* drop initial "pxe" arg */
argc--;
argv++;
char *filename;
int prompt = 0;
+ is_pxe = false;
+
if (strstr(argv[1], "-p")) {
prompt = 1;
argc--;