diff --git a/debian/changelog b/debian/changelog index 67e19d1a7..d8ef9cd3d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ grub2 (1.99~rc1-7) UNRELEASED; urgency=low /dev/disk/by-uuid/ to bug reports, by request of upstream. * Cherry-pick from upstream: - Use libgeom on FreeBSD to detect partitions (closes: #612128). + - Copy the partition table zone if floppy support is disabled, even if + no partition table is found (LP: #741867). -- Colin Watson Mon, 28 Mar 2011 23:47:28 +0100 diff --git a/debian/patches/copy_partition_table.patch b/debian/patches/copy_partition_table.patch new file mode 100644 index 000000000..baa61dcc2 --- /dev/null +++ b/debian/patches/copy_partition_table.patch @@ -0,0 +1,46 @@ +Description: Always copy partition table zone if floppy support is disabled + Do this 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. +Author: Mario Limonciello +Bug-Ubuntu: https://bugs.launchpad.net/bugs/741867 +Forwarded: http://lists.gnu.org/archive/html/grub-devel/2011-03/msg00062.html +Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3123 +Last-Update: 2011-03-29 + +Index: b/util/grub-setup.c +=================================================================== +--- a/util/grub-setup.c ++++ b/util/grub-setup.c +@@ -400,6 +400,15 @@ + } + #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.")); +@@ -411,14 +420,6 @@ + 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", diff --git a/debian/patches/series b/debian/patches/series index 936e315f0..0735561fd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -23,3 +23,4 @@ normal_menu_line_alloc.patch freebsd_module_header_alloc.patch video_fb_pageflip.patch kfreebsd_libgeom.patch +copy_partition_table.patch