+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):
/* 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. */
*((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);
free (memdisk);
memdisk = xstrdup (optarg);
+
+ if (prefix)
+ free (prefix);
+
+ prefix = xstrdup ("(memdisk)/boot/grub");
break;
case 'h':