]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Use absolute offsets for start of embedding area.
authorGrégoire Sutre <gregoire.sutre@gmail.com>
Tue, 8 Jun 2010 10:23:30 +0000 (12:23 +0200)
committerGrégoire Sutre <gregoire.sutre@gmail.com>
Tue, 8 Jun 2010 10:23:30 +0000 (12:23 +0200)
ChangeLog
util/i386/pc/grub-setup.c

index b48b7981918479f0ec8ee42bfe1bec6fe159409c..45637ac173dd367cf154d98165aef32dbc6e84dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-08  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
+       * util/i386/pc/grub-setup.c (setup): Use absolute offsets for start of
+       embedding area.  Use <= instead of == when checking for non-emptiness.
+
 2010-06-08  Grégoire Sutre  <gregoire.sutre@gmail.com>
 
        * configure.ac: Add `.' to the directories searched for unifont.
index 6e6b2e878feb32ee1dcff12711583e0b2a364e0b..08a76f65cb22453f13bb956c5b829a29d274885e 100644 (file)
@@ -126,8 +126,8 @@ setup (const char *dir,
       /* There's always an embed region, and it starts right after the MBR.  */
       embed_region.start = 1;
 
-      if (embed_region.end > p->start)
-       embed_region.end = p->start;
+      if (embed_region.end > grub_partition_get_start (p))
+       embed_region.end = grub_partition_get_start (p);
 
       return 0;
     }
@@ -147,8 +147,8 @@ setup (const char *dir,
       /* If there's an embed region, it is in a dedicated partition.  */
       if (! memcmp (&gptdata.type, &grub_gpt_partition_type_bios_boot, 16))
        {
-         embed_region.start = p->start;
-         embed_region.end = p->start + p->len;
+         embed_region.start = grub_partition_get_start (p);
+         embed_region.end = grub_partition_get_start (p) + grub_partition_get_len (p);
 
          return 1;
        }
@@ -361,7 +361,7 @@ setup (const char *dir,
   else
     grub_util_error (_("No DOS-style partitions found"));
 
-  if (embed_region.end == embed_region.start)
+  if (embed_region.end <= embed_region.start)
     {
       if (! strcmp (dest_partmap, "msdos"))
        grub_util_warn (_("This msdos-style partition label has no post-MBR gap; embedding won't be possible!"));