SHA256
1
0
forked from pool/grub2
grub2/grub2-iterate-and-hook-for-extended-partition.patch
Stephan Kulow ecac8f86f6 Accepting request 128513 from devel:openSUSE:Factory
Hi,
Please help to review the patches. Thanks. (forwarded request 128468 from michael-chang)

OBS-URL: https://build.opensuse.org/request/show/128513
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=41
2012-07-23 08:00:52 +00:00

34 lines
1.1 KiB
Diff

From: Michael Chang <mchang@suse.com>
The same as in the previous patch, add a support for installing grub
into an extended partition.
Here, we do not ignore extended partitions anymore. Instead we call a
hook that makes sure we have the partition when installing.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
References: https://bugzilla.novell.com/show_bug.cgi?id=750897
---
Index: grub-1.99/grub-core/partmap/msdos.c
===================================================================
--- grub-1.99.orig/grub-core/partmap/msdos.c
+++ grub-1.99/grub-core/partmap/msdos.c
@@ -107,11 +107,15 @@ grub_partition_msdos_iterate (grub_disk_
(unsigned long long) p.len);
/* If this partition is a normal one, call the hook. */
- if (! grub_msdos_partition_is_empty (e->type)
- && ! grub_msdos_partition_is_extended (e->type))
+ if (! grub_msdos_partition_is_empty (e->type))
{
p.number++;
+ /* prevent someone doing mkfs or mkswap on an
+ extended partition, but leave room for LILO */
+ if (grub_msdos_partition_is_extended (e->type))
+ p.len = 2;
+
if (hook (disk, &p))
return grub_errno;
}