]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2003-10-19 Yoshinori OKUJI <okuji@enbug.org>
authorokuji <okuji@localhost>
Sun, 19 Oct 2003 16:06:24 +0000 (16:06 +0000)
committerokuji <okuji@localhost>
Sun, 19 Oct 2003 16:06:24 +0000 (16:06 +0000)
From KB Sriram <mail_kb@yahoo.com>:
* stage2/disk_io.c (set_device) [SUPPORT_NETBOOT]: Added support
for a completion of a network device.
(print_completions): Likewise.

AUTHORS
ChangeLog
THANKS
stage2/disk_io.c

diff --git a/AUTHORS b/AUTHORS
index 517459ba4b2ae0b355b8ceb78302c9118f39c4d4..c34182e9b63436db18323475815a28de41ae0560 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -45,3 +45,6 @@ Jason Thomas added Linux DAC960 support and support for hiding/unhiding
 logical partitions, and did a significant bugfix for the terminal stuff.
 
 Tilmann Bubeck added support for vt100-incompatible terminals.
+
+KB Sriram added a better detection of FAT filesystem and fixed a
+network device completion.
index f485dd016c6896768a7900f51c71c770789fe270..97b9e3a8b1580954bdd19d46d2be4b82ae9d9d38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-10-19  Yoshinori OKUJI  <okuji@enbug.org>
+
+       From KB Sriram <mail_kb@yahoo.com>:
+       * stage2/disk_io.c (set_device) [SUPPORT_NETBOOT]: Added support
+       for a completion of a network device.
+       (print_completions): Likewise.
+
 2003-10-10  Robert Millan  <robertmh@gnu.org>
 
        * config.{guess,sub}: Update from official source (CVS).
diff --git a/THANKS b/THANKS
index 314d2e8e3693fd861f29957dbfe2b6651cc58603..a4987ce890ec9b90a7b3826c4fb15e497cc15b26 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -63,6 +63,7 @@ Julien Bordet <julien.bordet@int-evry.fr>
 Julien Perrot <julien.perrot@iie.cnam.fr>
 Kalle Olavi Niemitalo <tosi@ees2.oulu.fi>
 Karsten Scheibler <karsten.scheibler@student.uni-halle.de>
+KB Sriram <mail_kb@yahoo.com>
 Khimenko Victor <grub@khim.sch57.msk.ru>
 Klaus Reichl <klaus.reichl@alcatel.at>
 Kristoffer Branemyr <ztion@swipnet.se>
@@ -87,6 +88,7 @@ Per Lundberg <plundis@byggdok.se>
 Peter Astrand <altic@lysator.liu.se>
 Ralf Medow <ralf.medow@t-online.de>
 Ramon van Handel <vhandel@chem.vu.nl>
+Robert Millan  <robertmh@gnu.org>
 Roderich Schupp <rsch@ExperTeam.de>
 Rogelio M. Serrano Jr. <rogelio@victorio.com>
 Serguei Tzukanov <tzukanov@narod.ru>
index 0e54a0209260986a0fe5122b8a8f8c4a9ba3c77c..b75c18c4815da0cbed2ac0d6f2fd44ea96900abf 100644 (file)
@@ -1,7 +1,7 @@
 /* disk_io.c - implement abstract BIOS disk input and output */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 1999,2000,2001,2002  Free Software Foundation, Inc.
+ *  Copyright (C) 1999,2000,2001,2002,2003  Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -948,8 +948,12 @@ set_device (char *device)
       if (*device != ',' && *device != ')')
        {
          char ch = *device;
-
-         if (*device == 'f' || *device == 'h' || *device == 'n')
+#ifdef SUPPORT_NETBOOT
+         if (*device == 'f' || *device == 'h' ||
+             (*device == 'n' && network_ready))
+#else
+         if (*device == 'f' || *device == 'h')
+#endif /* SUPPORT_NETBOOT */
            {
              /* user has given '([fhn]', check for resp. add 'd' and
                 let disk_choice handle what disks we have */
@@ -964,13 +968,20 @@ set_device (char *device)
                return device + 2;
            }
 
-         if ((*device == 'f' || *device == 'h' || *device == 'n')
+#ifdef SUPPORT_NETBOOT
+         if ((*device == 'f' || *device == 'h' ||
+              (*device == 'n' && network_ready))
+#else
+         if ((*device == 'f' || *device == 'h')
+#endif /* SUPPORT_NETBOOT */
              && (device += 2, (*(device - 1) != 'd')))
            errnum = ERR_NUMBER_PARSING;
 
-         if (ch == 'n')
+#ifdef SUPPORT_NETBOOT
+         if (ch == 'n' && network_ready)
            current_drive = NETWORK_DRIVE;
          else
+#endif /* SUPPORT_NETBOOT */
            {
              safe_parse_maxint (&device, (int *) &current_drive);
              
@@ -1326,26 +1337,33 @@ print_completions (int is_filename, int is_completion)
              if (! is_completion)
                grub_printf (" Possible disks are: ");
 
-             for (i = (ptr && (*(ptr-2) == 'h' && *(ptr-1) == 'd') ? 1 : 0);
-                  i < (ptr && (*(ptr-2) == 'f' && *(ptr-1) == 'd') ? 1 : 2);
-                  i++)
+#ifdef SUPPORT_NETBOOT
+             if (!ptr || *(ptr-1) != 'd' || *(ptr-2) != 'n')
+#endif /* SUPPORT_NETBOOT */
                {
-                 for (j = 0; j < 8; j++)
+                 for (i = (ptr && (*(ptr-1) == 'd' && *(ptr-2) == 'h') ? 1:0);
+                      i < (ptr && (*(ptr-1) == 'd' && *(ptr-2) == 'f') ? 1:2);
+                      i++)
                    {
-                     disk_no = (i * 0x80) + j;
-                     if ((disk_choice || disk_no == current_drive)
-                         && ! get_diskinfo (disk_no, &geom))
+                     for (j = 0; j < 8; j++)
                        {
-                         char dev_name[8];
+                         disk_no = (i * 0x80) + j;
+                         if ((disk_choice || disk_no == current_drive)
+                             && ! get_diskinfo (disk_no, &geom))
+                           {
+                             char dev_name[8];
 
-                         grub_sprintf (dev_name, "%cd%d", i ? 'h' : 'f', j);
-                         print_a_completion (dev_name);
+                             grub_sprintf (dev_name, "%cd%d", i ? 'h':'f', j);
+                             print_a_completion (dev_name);
+                           }
                        }
                    }
                }
-
 # ifdef SUPPORT_NETBOOT
-             if (network_ready)
+             if (network_ready &&
+                 (disk_choice || NETWORK_DRIVE == current_drive) &&
+                 (!ptr || *(ptr-1) == '(' ||
+                  (*(ptr-1) == 'd' && *(ptr-2) == 'n')))
                print_a_completion ("nd");
 # endif /* SUPPORT_NETBOOT */