]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/lib/legacy_parse.c: Add support for "nd" disk.
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 27 Oct 2013 00:50:31 +0000 (02:50 +0200)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 27 Oct 2013 00:50:31 +0000 (02:50 +0200)
ChangeLog
grub-core/lib/legacy_parse.c

index 96ca86802677d02838da660fba5fd27c100a57ad..ae588168af3b3d390cc9efbe8800469008179f47 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-10-27  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/lib/legacy_parse.c: Add support for "nd" disk.
+
 2013-10-26  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Consolidate cpuid code.
index ddfaec4b0057bcba5071003478a7ed5cd087e895..af7c9846fd993b4947a13695a73f4381be56ed45 100644 (file)
@@ -70,7 +70,7 @@ static struct legacy_command legacy_commands[] =
      "Print the blocklist notation of the file FILE."},
     {"boot", "boot\n", NULL, 0, 0, {}, 0, 0,
      "Boot the OS/chain-loader which has been loaded."},
-    {"bootp", "net_bootp; net_ls_addr; if [ x%s = x--with-configfile ]; then "
+    {"bootp", "net_bootp; net_ls_addr; echo $\"" N_("Default server is ${net_default_server}") "\"; if [ x%s = x--with-configfile ]; then "
      "if net_get_dhcp_option configfile_name pxe 150 string; then "
      "configfile $configfile_name; fi; fi\n", NULL, 0, 1,
      {TYPE_WITH_CONFIGFILE_OPTION}, FLAG_IGNORE_REST, "[--with-configfile]",
@@ -385,6 +385,29 @@ adjust_file (const char *in, grub_size_t len)
     if (*ptr == '\'' || *ptr == '\\')
       overhead++;
   comma = ptr;
+  if (*comma == ')' && comma - in == 3
+      && in[1] == 'n' && in[2] == 'd')
+    {
+      rest = comma + 1;
+      for (ptr = rest; ptr < in + len && *ptr; ptr++)
+       if (*ptr == '\'' || *ptr == '\\')
+         overhead++;
+
+      ret = grub_malloc (ptr - in + overhead + 15);
+      if (!ret)
+       return NULL;
+
+      outptr = grub_stpcpy (ret, "(tftp)");;
+      for (ptr = rest; ptr < in + len; ptr++)
+       {
+         if (*ptr == '\'' || *ptr == '\\')
+           *outptr++ = '\\';
+
+         *outptr++ = *ptr;
+       }
+      *outptr = 0;
+      return ret;
+    }
   if (*comma != ',')
     return grub_legacy_escape (in, len);
   part = grub_strtoull (comma + 1, (char **) &rest, 0);
@@ -398,7 +421,7 @@ adjust_file (const char *in, grub_size_t len)
       overhead++;
 
   /* 35 is enough for any 2 numbers.  */
-  ret = grub_malloc (ptr - in + overhead + 35);
+  ret = grub_malloc (ptr - in + overhead + 35 + 5);
   if (!ret)
     return NULL;