rewrite the command find, update TODO.
This commit is contained in:
parent
b3ccacd20f
commit
69e36bc547
3 changed files with 79 additions and 43 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2000-09-29 OKUJI Yoshinori <okuji@gnu.org>
|
||||
|
||||
* stage2/builtins.c (find_func): New variable GOT_FILE is set to
|
||||
one if FILENAME is found. Otherwise, it is set to zero.
|
||||
Clear ERRNUM at the end in the loop for floppies, to ensure that
|
||||
ERRNUM is cleared before examining hard disks.
|
||||
Rewrite the loop for hard disks using next_partitions, so this
|
||||
function now checks all partitions you have certainly.
|
||||
If GOT_FILE is non-zero, set ERRNUM to ERR_FILE_NOT_FOUND and
|
||||
return one.
|
||||
|
||||
2000-09-29 OKUJI Yoshinori <okuji@gnu.org>
|
||||
|
||||
* stage2/disk_io.c (check_BSD_parts): Removed.
|
||||
|
|
26
TODO
26
TODO
|
@ -16,9 +16,19 @@ Priorities:
|
|||
* Port the script ``grub-install'' to FreeBSD, NetBSD and OpenBSD. At
|
||||
least you will have to modify the function `convert' so that it can
|
||||
translate a native device name into the corresponding GRUB drive
|
||||
representation.
|
||||
representation. !
|
||||
|
||||
* Add configuration inclusion support by adding a command "include".
|
||||
* Add configuration inclusion support by adding a command "include". !
|
||||
|
||||
* Add a command to run a GRUB script file. !!
|
||||
|
||||
* Finish the Multiboot Speicification 0.7. !!!
|
||||
|
||||
* Add commands to manipulate the menu from the command-line interface. !
|
||||
|
||||
* Add more --disable-FOO options to configure, so that you can create a
|
||||
minimum GRUB image. This is useful for boot floppies because of the size
|
||||
restriction. !
|
||||
|
||||
* Make symbolic links work for BSD FFS.
|
||||
|
||||
|
@ -44,15 +54,13 @@ Priorities:
|
|||
|
||||
* Add ISA PnP support.
|
||||
|
||||
* Fix the completion so that it works for BSD partitions as well. !
|
||||
|
||||
* Add BSD syntax support, using results of ioprobe to map drives. !
|
||||
(0x1f0-0x1f7 = primary IDE, 0x170-0x176 = secondary,
|
||||
0x1e8-0x1ef = tertiary, 0x168-0x16f = quaternary).
|
||||
|
||||
* Add more filesystems support (XFS, NTFS, etc.)
|
||||
|
||||
* Add remote console support (parallel and net). !
|
||||
* Add more remote console support (parallel and net).
|
||||
|
||||
* Add RAID support.
|
||||
|
||||
|
@ -72,3 +80,11 @@ Priorities:
|
|||
BIOSes which have bootable-CDROM support (so you may use the "Bootable
|
||||
CDROM" BIOS calls). It is not trivial to support BIOSes without the
|
||||
capability to boot CDROM.
|
||||
|
||||
? Divide pxegrub into two parts, so the initial image doesn't exceed
|
||||
the 32KB limit. I'm not sure if this is really necessary, because the
|
||||
PXE standard just says that it is _recommended_ to improve the
|
||||
modularity of a boot image. Obviously, this reason doesn't apply to
|
||||
GRUB, as pxegrub is merely a secondary boot loader. So whether this
|
||||
task should be done depends on if existing PXE ROMs support >32KB
|
||||
images or not, after all.
|
||||
|
|
|
@ -1028,78 +1028,87 @@ find_func (char *arg, int flags)
|
|||
unsigned long drive;
|
||||
unsigned long tmp_drive = saved_drive;
|
||||
unsigned long tmp_partition = saved_partition;
|
||||
int got_file = 0;
|
||||
|
||||
/* Floppies. */
|
||||
for (drive = 0; drive < 8; drive++)
|
||||
{
|
||||
errnum = ERR_NONE;
|
||||
current_drive = drive;
|
||||
current_partition = 0xFFFFFF;
|
||||
|
||||
if (! open_device ())
|
||||
continue;
|
||||
|
||||
if (open_device ())
|
||||
{
|
||||
saved_drive = current_drive;
|
||||
saved_partition = current_partition;
|
||||
if (grub_open (filename))
|
||||
{
|
||||
grub_close ();
|
||||
grub_printf (" (fd%d)\n", drive);
|
||||
got_file = 1;
|
||||
}
|
||||
}
|
||||
|
||||
errnum = ERR_NONE;
|
||||
}
|
||||
|
||||
/* Hard disks. */
|
||||
for (drive = 0x80; drive < 0x88; drive++)
|
||||
{
|
||||
unsigned long slice;
|
||||
unsigned long part = 0xFFFFFF;
|
||||
unsigned long start, len, offset, ext_offset;
|
||||
int type, entry;
|
||||
char buf[SECTOR_SIZE];
|
||||
|
||||
current_drive = drive;
|
||||
/* FIXME: is what maximum number right? */
|
||||
for (slice = 0; slice < 12; slice++)
|
||||
while (next_partition (drive, 0xFFFFFF, &part, &type,
|
||||
&start, &len, &offset, &entry,
|
||||
&ext_offset, buf))
|
||||
{
|
||||
errnum = ERR_NONE;
|
||||
current_partition = (slice << 16) | 0xFFFF;
|
||||
if (type != PC_SLICE_TYPE_NONE
|
||||
&& ! IS_PC_SLICE_TYPE_BSD (type)
|
||||
&& ! IS_PC_SLICE_TYPE_EXTENDED (type))
|
||||
{
|
||||
current_partition = part;
|
||||
if (open_device ())
|
||||
{
|
||||
errnum = ERR_NONE;
|
||||
saved_drive = current_drive;
|
||||
saved_partition = current_partition;
|
||||
if (grub_open (filename))
|
||||
{
|
||||
grub_close ();
|
||||
grub_printf (" (hd%d,%d)", drive - 0x80, slice);
|
||||
}
|
||||
}
|
||||
else if (IS_PC_SLICE_TYPE_BSD (current_slice))
|
||||
{
|
||||
unsigned long part;
|
||||
int bsd_part = (part >> 8) & 0xFF;
|
||||
int pc_slice = part >> 16;
|
||||
|
||||
for (part = 0; part < 8; part++)
|
||||
{
|
||||
errnum = ERR_NONE;
|
||||
current_partition = (slice << 16) | (part << 8) | 0xFF;
|
||||
if (! open_device ())
|
||||
continue;
|
||||
|
||||
saved_drive = current_drive;
|
||||
saved_partition = current_partition;
|
||||
if (grub_open (filename))
|
||||
{
|
||||
grub_close ();
|
||||
grub_printf (" (hd%d,%d,%c)",
|
||||
drive - 0x80, slice, part + 'a');
|
||||
}
|
||||
}
|
||||
|
||||
if (bsd_part == 0xFF)
|
||||
grub_printf (" (hd%d,%d)\n",
|
||||
drive - 0x80, pc_slice);
|
||||
else
|
||||
grub_printf (" (hd%d,%d,%c)\n",
|
||||
drive - 0x80, pc_slice, bsd_part + 'a');
|
||||
|
||||
got_file = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
errnum = ERR_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
saved_drive = tmp_drive;
|
||||
saved_partition = tmp_partition;
|
||||
|
||||
if (got_file)
|
||||
{
|
||||
errnum = ERR_NONE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
errnum = ERR_FILE_NOT_FOUND;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct builtin builtin_find =
|
||||
{
|
||||
"find",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue