diff --git a/AUTHORS b/AUTHORS index 517459ba4..c34182e9b 100644 --- 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. diff --git a/ChangeLog b/ChangeLog index f485dd016..97b9e3a8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-10-19 Yoshinori OKUJI + + From KB Sriram : + * 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 * config.{guess,sub}: Update from official source (CVS). diff --git a/THANKS b/THANKS index 314d2e8e3..a4987ce89 100644 --- a/THANKS +++ b/THANKS @@ -63,6 +63,7 @@ Julien Bordet Julien Perrot Kalle Olavi Niemitalo Karsten Scheibler +KB Sriram Khimenko Victor Klaus Reichl Kristoffer Branemyr @@ -87,6 +88,7 @@ Per Lundberg Peter Astrand Ralf Medow Ramon van Handel +Robert Millan Roderich Schupp Rogelio M. Serrano Jr. Serguei Tzukanov diff --git a/stage2/disk_io.c b/stage2/disk_io.c index 0e54a0209..b75c18c48 100644 --- a/stage2/disk_io.c +++ b/stage2/disk_io.c @@ -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 *) ¤t_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 */