]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-06-15 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Sun, 15 Jun 2008 18:21:16 +0000 (18:21 +0000)
committerrobertmh <robertmh@localhost>
Sun, 15 Jun 2008 18:21:16 +0000 (18:21 +0000)
        * 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.

ChangeLog
kern/i386/pc/init.c
util/i386/pc/grub-mkimage.c

index e2d30dce35a88a865cdb1c615f361647fd2088b4..9de46681db9bbb3277eb785076371de2aee5064d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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):
index 757f5d5c50bff066c8407b3ee87beb0b4694f47c..e47cbfd86475fefa37e5bc40ce828d78a453cc00 100644 (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.  */
index 48d6dfce741feccb68ebe452ed5093b858062608..189ec4e5307a4294db8b5617843ee9ca58cab308 100644 (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':