#define MAX_TFTP_PATH_LEN 127
-
/*
* 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
return -ENOENT;
}
-
-
/*
* As in pxelinux, paths to files referenced from files we retrieve are
* relative to the location of bootfile. get_relfile takes such a path and
if (argc != 1)
return CMD_RET_USAGE;
-
pxefile_addr_str = from_env("pxefile_addr_r");
if (!pxefile_addr_str)
*/
static int label_localboot(struct pxe_label *label)
{
- char *localcmd, *dupcmd;
- int ret;
+ char *localcmd;
localcmd = from_env("localcmd");
if (!localcmd)
return -ENOENT;
- /*
- * dup the command to avoid any issues with the version of it existing
- * in the environment changing during the execution of the command.
- */
- dupcmd = strdup(localcmd);
-
- if (!dupcmd)
- return -ENOMEM;
-
if (label->append)
setenv("bootargs", label->append);
- printf("running: %s\n", dupcmd);
+ debug("running: %s\n", localcmd);
- ret = run_command(dupcmd, 0);
-
- free(dupcmd);
-
- return ret;
+ return run_command_list(localcmd, strlen(localcmd), 0);
}
/*