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.
This commit is contained in:
okuji 2003-10-19 16:06:24 +00:00
parent 4db8e630b4
commit e8911332da
4 changed files with 47 additions and 17 deletions

View file

@ -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.

View file

@ -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).

2
THANKS
View file

@ -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>

View 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 */