]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
pxe: parse initrd file from append string
authorRob Herring <rob.herring@calxeda.com>
Wed, 28 Mar 2012 05:51:37 +0000 (05:51 +0000)
committerWolfgang Denk <wd@denx.de>
Thu, 21 Jun 2012 20:35:34 +0000 (22:35 +0200)
For syslinux, the initrd can be set in the append string as
"initrd=<file>", so try to find it there if we haven't already set the
initrd.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
common/cmd_pxe.c
doc/README.pxe

index 8d2c1e8665e6a23137789dcaa7666eed6ff562e0..0fc863b22a3def669b3ba2057bb528e559717796 100644 (file)
@@ -999,6 +999,7 @@ static int parse_label_menu(char **c, struct pxe_menu *cfg,
 static int parse_label(char **c, struct pxe_menu *cfg)
 {
        struct token t;
+       int len;
        char *s = *c;
        struct pxe_label *label;
        int err;
@@ -1033,10 +1034,22 @@ static int parse_label(char **c, struct pxe_menu *cfg)
 
                case T_APPEND:
                        err = parse_sliteral(c, &label->append);
+                       if (label->initrd)
+                               break;
+                       s = strstr(label->append, "initrd=");
+                       if (!s)
+                               break;
+                       s += 7;
+                       len = (int)(strchr(s, ' ') - s);
+                       label->initrd = malloc(len + 1);
+                       strncpy(label->initrd, s, len);
+                       label->initrd[len] = '\0';
+
                        break;
 
                case T_INITRD:
-                       err = parse_sliteral(c, &label->initrd);
+                       if (!label->initrd)
+                               err = parse_sliteral(c, &label->initrd);
                        break;
 
                case T_LOCALBOOT:
index 95cd9b90dead2a0c2e6fca95a7cbd4d3e1bcfd52..2bbf53d957b1099c62587bb6ef2c803a4be0497d 100644 (file)
@@ -224,9 +224,6 @@ PXELINUX and U-boot's pxe support.
 - U-boot's pxe expects U-boot uimg's as kernels.  Anything that would work
   with the 'bootm' command in U-boot could work with the 'pxe boot' command.
 
-- U-boot's pxe doesn't recognize initrd options in the append command - you
-  must specify initrd files using the initrd command.
-
 - U-boot's pxe only recognizes a single file on the initrd command line.  It
   could be extended to support multiple.