All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario_limonciello@dell.com>
To: grub-devel@gnu.org
Cc: phcoder@gmail.com, Colin Watson <cjwatson@ubuntu.com>
Subject: [PATCH] grub-setup Modify the conditionality of the copy of the partition table
Date: Fri, 25 Mar 2011 17:13:43 -0500	[thread overview]
Message-ID: <4D8D1397.5030802@dell.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 928 bytes --]

 Hi:

I've discovered that in snapshots of GRUB2 in Ubuntu natty, you are no longer able to install GRUB2 to a partition and successfully boot on certain Dell E-series Latitudes.  This is a regression from the GRUB2 that was included in Ubuntu maverick.  The BIOS makes an assertion based on the content of the partition table section of the PBR and content that doesn't resemble a partition table will cause the the BIOS to get stuck in a loop and never complete POST.

I've identified the changeset that caused this to be r2751.  I've created a patch that modifies the conditionality of the partition table copy to not check for a partition table, but instead to verify it's not operating on a floppy disk.  This restores the previous behavior when installing to a partition, and still allows the new behavior for floppy disk installations.

Thanks,

-- 
*Mario Limonciello*
Linux Engineer
*Dell* | OS Engineering

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: always_copy_partition_table.patch --]
[-- Type: text/x-diff; name="always_copy_partition_table.patch", Size: 2238 bytes --]

=== modified file 'ChangeLog'
--- ChangeLog	2011-03-23 19:29:17 +0000
+++ ChangeLog	2011-03-25 21:56:23 +0000
@@ -1,3 +1,11 @@
+2011-03-24  Mario Limonciello    <Mario_Limonciello@Dell.com>
+        * util/grub-setup.c: Conditionalize the partition map copy on floppy
+          support, not on whether the target contains partitions.
+
+          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-23  Vladimir Serbinenko  <phcoder@gmail.com>
 
 	* grub-core/term/gfxterm.c (calculate_normal_character_width): Return 8

=== modified file 'util/grub-setup.c'
--- util/grub-setup.c	2011-01-07 12:27:34 +0000
+++ util/grub-setup.c	2011-03-25 21:51:56 +0000
@@ -399,25 +399,25 @@
       }
 #endif
 
-    if (! dest_partmap)
-      {
-	grub_util_warn (_("Attempting to install GRUB to a partitionless disk or to a partition.  This is a BAD idea."));
-	goto unable_to_embed;
-      }
-    if (multiple_partmaps || fs)
-      {
-	grub_util_warn (_("Attempting to install GRUB to a disk with multiple partition labels or both partition label and filesystem.  This is not supported yet."));
-	goto unable_to_embed;
-      }
-
     /* Copy the partition table.  */
-    if (dest_partmap)
+    if (!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."));
+	goto unable_to_embed;
+      }
+    if (multiple_partmaps || fs)
+      {
+	grub_util_warn (_("Attempting to install GRUB to a disk with multiple partition labels or both partition label and filesystem.  This is not supported yet."));
+	goto unable_to_embed;
+      }
+
     if (!dest_partmap->embed)
       {
 	grub_util_warn ("Partition style '%s' doesn't support embeding",


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

             reply	other threads:[~2011-03-25 22:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25 22:13 Mario Limonciello [this message]
2011-03-25 22:55 ` [PATCH] grub-setup Modify the conditionality of the copy of the partition table Vladimir 'φ-coder/phcoder' Serbinenko
2011-03-25 23:31   ` Colin Watson
2011-03-26  0:37     ` Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D8D1397.5030802@dell.com \
    --to=mario_limonciello@dell.com \
    --cc=cjwatson@ubuntu.com \
    --cc=grub-devel@gnu.org \
    --cc=phcoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.