From 7375ca8ab23a58fc270e081a348d5149de51073677221ee66353673cb27c4bc7 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Tue, 8 Jan 2013 02:50:55 +0000 Subject: [PATCH] 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 --- ...ix-enumeration-of-extended-partition.patch | 38 +++++++++++++++++++ grub2.changes | 6 +++ grub2.spec | 7 +++- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 grub2-fix-enumeration-of-extended-partition.patch diff --git a/grub2-fix-enumeration-of-extended-partition.patch b/grub2-fix-enumeration-of-extended-partition.patch new file mode 100644 index 0000000..106363c --- /dev/null +++ b/grub2-fix-enumeration-of-extended-partition.patch @@ -0,0 +1,38 @@ +From: Andrey Borzenkov +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 + +--- + 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++; diff --git a/grub2.changes b/grub2.changes index 4471c58..aead23c 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Jan 6 18:54:54 UTC 2013 - arvidjaar@gmail.com + +- add patch grub2-fix-enumeration-of-extended-partition.patch to + fix enumeration of extended partitions with non-standard EBR (bnc#779534) + ------------------------------------------------------------------- Fri Jan 4 10:29:58 UTC 2013 - arvidjaar@gmail.com diff --git a/grub2.spec b/grub2.spec index 61d8f35..6225557 100644 --- a/grub2.spec +++ b/grub2.spec @@ -1,7 +1,7 @@ # # spec file for package grub2 # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -132,6 +132,7 @@ Patch22: grub2-secureboot-use-linuxefi-on-uefi.patch Patch23: grub2-secureboot-no-insmod-on-sb.patch Patch24: grub2-secureboot-provide-linuxefi-config.patch Patch25: 30_os-prober_UEFI_support.patch +Patch26: grub2-fix-enumeration-of-extended-partition.patch PreReq: perl-Bootloader Requires: gettext-runtime %if 0%{?suse_version} >= 1140 @@ -244,6 +245,7 @@ mv docs/grub.texi docs/grub2.texi %patch23 -p1 %patch24 -p1 %patch25 -p1 +%patch26 -p1 cd .. # README.openSUSE @@ -418,7 +420,6 @@ elif [ "x${LOADER_TYPE}" = "xgrub2" ]; then fi %endif - %ifarch %{efi} %triggerpostun -- %{name}-efi @@ -617,3 +618,5 @@ fi %{_libdir}/%{name}/%{grubefiarch}/kernel.exec %{_libdir}/%{name}/%{grubefiarch}/modinfo.sh %endif + +%changelog