do not embed the drive where a Stage 2 resides when using a Stage 1.5 if possible.
This commit is contained in:
parent
9f88649c8c
commit
a40c3176c2
3 changed files with 30 additions and 11 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
1999-11-13 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||||
|
|
||||||
|
* stage2/builtins.c (install_func): When using a Stage 1.5, set
|
||||||
|
CURRENT_DRIVE to SAVED_DRIVE and CURRENT_PARTITION to
|
||||||
|
SAVED_PARTITION if set_device fails. If CURRENT_DRIVE is equal
|
||||||
|
to SRC_DRIVE, then set CURRENT_DRIVE to 0xFF. We don't want to
|
||||||
|
embed any drive number whenever possible.
|
||||||
|
* stage2/disk_io.c (set_device) [STAGE1_5]: Always set
|
||||||
|
CURRENT_PARTITION to PARTITION.
|
||||||
|
|
||||||
1999-11-13 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
1999-11-13 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||||
|
|
||||||
From Pavel Roskin:
|
From Pavel Roskin:
|
||||||
|
|
|
@ -1370,12 +1370,23 @@ install_func (char *arg, int flags)
|
||||||
syntax. */
|
syntax. */
|
||||||
if (! (config_file = set_device (ptr)))
|
if (! (config_file = set_device (ptr)))
|
||||||
{
|
{
|
||||||
errnum = 0;
|
/* The Stage 2 PTR does not contain the device name, so
|
||||||
current_drive = 0xFF;
|
use the root device instead. */
|
||||||
|
errnum = ERR_NONE;
|
||||||
|
current_drive = saved_drive;
|
||||||
|
current_partition = saved_partition;
|
||||||
config_file = ptr;
|
config_file = ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (current_drive == src_drive)
|
||||||
|
{
|
||||||
|
/* If the drive where the Stage 2 resides is the same as
|
||||||
|
the one where the Stage 1.5 resides, do not embed the
|
||||||
|
drive number. */
|
||||||
|
current_drive = 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
device = current_drive << 24 | current_partition;
|
device = (current_drive << 24) | current_partition;
|
||||||
grub_memmove (config_file_location, (char *) &device,
|
grub_memmove (config_file_location, (char *) &device,
|
||||||
sizeof (device));
|
sizeof (device));
|
||||||
grub_strcpy (config_file_location + sizeof (device), config_file);
|
grub_strcpy (config_file_location + sizeof (device), config_file);
|
||||||
|
|
|
@ -686,16 +686,14 @@ set_device (char *device)
|
||||||
int drive = (dev >> 24) & 0xFF;
|
int drive = (dev >> 24) & 0xFF;
|
||||||
int partition = dev & 0xFFFFFF;
|
int partition = dev & 0xFFFFFF;
|
||||||
|
|
||||||
|
/* If DRIVE is disabled (0xFF), use SAVED_DRIVE instead. */
|
||||||
if (drive == 0xFF)
|
if (drive == 0xFF)
|
||||||
{
|
current_drive = saved_drive;
|
||||||
current_drive = saved_drive;
|
|
||||||
current_partition = saved_partition;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
current_drive = drive;
|
||||||
current_drive = drive;
|
|
||||||
current_partition = partition;
|
/* The `partition' part must always have a valid number. */
|
||||||
}
|
current_partition = partition;
|
||||||
|
|
||||||
return device + sizeof (unsigned long);
|
return device + sizeof (unsigned long);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue