2008-06-15 Robert Millan <rmh@aybabtu.com>

* util/i386/pc/grub-mkimage.c (generate_image): If we included a drive
        in our prefix, set install_{dos,bsd}_part = -2 to indicate this can be
        skipped later.
        (main): If a memdisk was requested, add "(memdisk)" drive explicitly to
        the beginning of the prefix.

        * kern/i386/pc/init.c (make_install_device): Remove memdisk check.
        It is assumed that if we have a memdisk, grub-mkimage has set
        grub_prefix to include the "(memdisk)" drive in it.
This commit is contained in:
robertmh 2008-06-15 18:21:16 +00:00
parent a7cbd45a07
commit a920728493
3 changed files with 28 additions and 6 deletions

View File

@ -1,3 +1,15 @@
2008-06-15 Robert Millan <rmh@aybabtu.com>
* util/i386/pc/grub-mkimage.c (generate_image): If we included a drive
in our prefix, set install_{dos,bsd}_part = -2 to indicate this can be
skipped later.
(main): If a memdisk was requested, add "(memdisk)" drive explicitly to
the beginning of the prefix.
* kern/i386/pc/init.c (make_install_device): Remove memdisk check.
It is assumed that if we have a memdisk, grub-mkimage has set
grub_prefix to include the "(memdisk)" drive in it.
2008-06-15 Robert Millan <rmh@aybabtu.com>
* term/i386/pc/console.c [GRUB_MACHINE_LINUXBIOS] (grub_console_init):

View File

@ -64,12 +64,7 @@ make_install_device (void)
/* XXX: This should be enough. */
char dev[100];
if (grub_memdisk_image_size)
{
grub_sprintf (dev, "(memdisk)%s", grub_prefix);
grub_strcpy (grub_prefix, dev);
}
else if (grub_install_dos_part != -2)
if (grub_install_dos_part != -2)
{
/* If the root drive is not set explicitly, assume that it is identical
to the boot drive. */

View File

@ -182,6 +182,16 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *me
*((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE))
= grub_cpu_to_le32 (core_size - GRUB_KERNEL_MACHINE_RAW_SIZE);
/* If we included a drive in our prefix, let GRUB know it doesn't have to
prepend the drive told by BIOS. */
if (prefix[0] == '(')
{
*((grub_int32_t *) (core_img + GRUB_KERNEL_MACHINE_INSTALL_DOS_PART))
= grub_cpu_to_le32 (-2);
*((grub_int32_t *) (core_img + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART))
= grub_cpu_to_le32 (-2);
}
if (core_size > GRUB_MEMORY_MACHINE_UPPER - GRUB_MEMORY_MACHINE_LINK_ADDR)
grub_util_error ("Core image is too big (%p > %p)\n", core_size,
GRUB_MEMORY_MACHINE_UPPER - GRUB_MEMORY_MACHINE_LINK_ADDR);
@ -278,6 +288,11 @@ main (int argc, char *argv[])
free (memdisk);
memdisk = xstrdup (optarg);
if (prefix)
free (prefix);
prefix = xstrdup ("(memdisk)/boot/grub");
break;
case 'h':