]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_pxe.c
Add run_command_list() to run a list of commands
[u-boot] / common / cmd_pxe.c
index 77a7dd17ac1d595b4baa77bec92d251050427654..6b31deab5bea493000996ceb057eff336fde3b20 100644 (file)
@@ -554,33 +554,19 @@ static void label_print(void *data)
  */
 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);
-
-       ret = run_command(dupcmd, 0);
+       debug("running: %s\n", localcmd);
 
-       free(dupcmd);
-
-       return ret;
+       return run_command_list(localcmd, strlen(localcmd), 0);
 }
 
 /*