diff --git a/ChangeLog b/ChangeLog index d6afea1d2..1ea9ca076 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-03-29 Mario Limonciello + + * 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 * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Remove stale diff --git a/util/grub-setup.c b/util/grub-setup.c index b4749b433..c1f2a1f5e 100644 --- a/util/grub-setup.c +++ b/util/grub-setup.c @@ -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",