SHA256
1
0
forked from pool/grub2
grub2/grub2-fix-enumeration-of-extended-partition.patch
Michael Chang 7375ca8ab2 Accepting request 147406 from home:arvidjaar:bnc:779534
- add patch grub2-fix-enumeration-of-extended-partition.patch to
  fix enumeration of extended partitions with non-standard EBR (bnc#779534)

OBS-URL: https://build.opensuse.org/request/show/147406
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=3
2013-01-08 02:50:55 +00:00

39 lines
1.4 KiB
Diff

From: Andrey Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] fix off by one error in enumerating MSDOS partitions
References: bnc#779534
As reported in https://bugzilla.novell.com/show_bug.cgi?id=779534,
grub2 assigns incorrect partition number to extended partitions.
This is due to slightly non-standard EBR which contains single extended
partition record, but no normal partition. Due to incorrect p.number
comparison, grub2 includes it in partition numbering.
With standard EBR first entry is "true" partition that correctly
gets assigned next available number.
At the point of comparison p.number is one less than partition
number; so make correct comparison.
Actual partition chain is visible in this attachement:
http://bugzilla.novell.com/attachment.cgi?id=519076
Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
---
grub-core/partmap/msdos.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: grub-2.00/grub-core/partmap/msdos.c
===================================================================
--- grub-2.00.orig/grub-core/partmap/msdos.c
+++ grub-2.00/grub-core/partmap/msdos.c
@@ -196,7 +196,7 @@ grub_partition_msdos_iterate (grub_disk_
return grub_errno;
}
}
- else if (p.number < 4)
+ else if (p.number < 3)
/* If this partition is a logical one, shouldn't increase the
partition number. */
p.number++;