]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-setup.c: Copy the partition table zone if floppy support
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 29 Mar 2011 00:20:52 +0000 (02:20 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 29 Mar 2011 00:20:52 +0000 (02:20 +0200)
is disabled, even if no partition table is found.

        Otherwise, the BIOS on Dell Latitude E series laptops will freeze
        during POST if an invalid partition table is contained in the PBR
        of the active partition when GRUB is installed to a partition.

ChangeLog
util/grub-setup.c

index d6afea1d2d33804acac3286125ccae8dab3f5753..1ea9ca076e069ed575a564acb00b67027345f6ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-03-29  Mario Limonciello  <Mario_Limonciello@Dell.com>
+
+        * util/grub-setup.c: Copy the partition table zone if floppy support
+       is disabled, even if no partition table is found.
+
+        Otherwise, the BIOS on Dell Latitude E series laptops will freeze
+        during POST if an invalid partition table is contained in the PBR
+        of the active partition when GRUB is installed to a partition.
+
 2011-03-28  Colin Watson  <cjwatson@debian.org>
 
        * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Remove stale
index b4749b433510f9a419103e6758b56264bc22063e..c1f2a1f5ee1fda7d9de65b39295e951d27c6c132 100644 (file)
@@ -399,6 +399,15 @@ setup (const char *dir,
       }
 #endif
 
+    /* Copy the partition table.  */
+    if (dest_partmap ||
+        (!allow_floppy && !grub_util_biosdisk_is_floppy (dest_dev->disk)))
+      memcpy (boot_img + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC,
+             tmp_img + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC,
+             GRUB_BOOT_MACHINE_PART_END - GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC);
+
+    free (tmp_img);
+    
     if (! dest_partmap)
       {
        grub_util_warn (_("Attempting to install GRUB to a partitionless disk or to a partition.  This is a BAD idea."));
@@ -410,14 +419,6 @@ setup (const char *dir,
        goto unable_to_embed;
       }
 
-    /* Copy the partition table.  */
-    if (dest_partmap)
-      memcpy (boot_img + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC,
-             tmp_img + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC,
-             GRUB_BOOT_MACHINE_PART_END - GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC);
-
-    free (tmp_img);
-    
     if (!dest_partmap->embed)
       {
        grub_util_warn ("Partition style '%s' doesn't support embeding",