2002-05-25 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/builtins.c (boot_func): Load the boot partition information, only if the address of the boot partition entry is set appropriately. (real_root_func): If ATTEMPT_MOUNT is false, call open_partition and if successful, call set_bootdev, to set the offset of the boot partition and the address of the boot paetition entry. IF ATTEMPT_MOUNT is false, don't set BOOTDEV. The BSD evil hack is useless with the command "rootnoverify" anyway. * stage2/disk_io.c (boot_part_addr): Initialized with zero explicitly, to emphasize that it is invalid.
This commit is contained in:
parent
4339b22d7a
commit
c65ae440c8
3 changed files with 37 additions and 14 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2002-05-25 Yoshinori K. Okuji <okuji@enbug.org>
|
||||
|
||||
* stage2/builtins.c (boot_func): Load the boot partition
|
||||
information, only if the address of the boot partition entry is
|
||||
set appropriately.
|
||||
(real_root_func): If ATTEMPT_MOUNT is false, call open_partition
|
||||
and if successful, call set_bootdev, to set the offset of the
|
||||
boot partition and the address of the boot paetition entry.
|
||||
IF ATTEMPT_MOUNT is false, don't set BOOTDEV. The BSD evil hack
|
||||
is useless with the command "rootnoverify" anyway.
|
||||
* stage2/disk_io.c (boot_part_addr): Initialized with zero
|
||||
explicitly, to emphasize that it is invalid.
|
||||
|
||||
2002-05-24 Yoshinori K. Okuji <okuji@enbug.org>
|
||||
|
||||
* stage2/builtins.c (real_root_func): New function.
|
||||
|
|
|
@ -296,8 +296,9 @@ boot_func (char *arg, int flags)
|
|||
boot_drive = saved_drive;
|
||||
|
||||
/* Copy the boot partition information to 0x7be-0x7fd, if
|
||||
BOOT_DRIVE is a hard disk drive. */
|
||||
if (boot_drive & 0x80)
|
||||
BOOT_DRIVE is a hard disk drive and the address of the boot
|
||||
partition entry is set. */
|
||||
if ((boot_drive & 0x80) && boot_part_addr)
|
||||
{
|
||||
char *dst, *src;
|
||||
int i;
|
||||
|
@ -3125,22 +3126,31 @@ real_root_func (char *arg, int attempt_mount)
|
|||
if (! open_device () && errnum != ERR_FSYS_MOUNT)
|
||||
return 1;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* This is necessary, because the location of a partition table
|
||||
must be set appropriately. */
|
||||
if (open_partition ())
|
||||
set_bootdev (0);
|
||||
}
|
||||
|
||||
/* Clear ERRNUM. */
|
||||
errnum = 0;
|
||||
saved_partition = current_partition;
|
||||
saved_drive = current_drive;
|
||||
|
||||
/* BSD and chainloading evil hacks !! */
|
||||
biasptr = skip_to (0, next);
|
||||
safe_parse_maxint (&biasptr, &hdbias);
|
||||
errnum = 0;
|
||||
bootdev = set_bootdev (hdbias);
|
||||
|
||||
/* Print the type of the filesystem. */
|
||||
if (attempt_mount)
|
||||
print_fsys_type ();
|
||||
|
||||
{
|
||||
/* BSD and chainloading evil hacks !! */
|
||||
biasptr = skip_to (0, next);
|
||||
safe_parse_maxint (&biasptr, &hdbias);
|
||||
errnum = 0;
|
||||
bootdev = set_bootdev (hdbias);
|
||||
|
||||
/* Print the type of the filesystem. */
|
||||
print_fsys_type ();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* disk_io.c - implement abstract BIOS disk input and output */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1999,2000,2001,2002 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
|
||||
|
@ -85,7 +85,7 @@ unsigned long current_partition;
|
|||
#ifndef STAGE1_5
|
||||
/* The register ESI should contain the address of the partition to be
|
||||
used for loading a chain-loader when chain-loading the loader. */
|
||||
unsigned long boot_part_addr;
|
||||
unsigned long boot_part_addr = 0;
|
||||
unsigned long boot_part_offset;
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue