2012-07-23 10:00:52 +02:00
|
|
|
From: Michael Chang <mchang@suse.com>
|
2012-06-29 06:59:42 +02:00
|
|
|
|
2012-07-23 10:00:52 +02:00
|
|
|
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
|
2012-10-26 17:06:09 +02:00
|
|
|
|
|
|
|
From: Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
|
|
|
|
|
Apply this logic only to primary extended partition. Ignore extended
|
|
|
|
partitions that are used to link together logical partitions.
|
|
|
|
|
|
|
|
References: https://bugzilla.novell.com/show_bug.cgi?id=785341
|
2012-06-29 06:59:42 +02:00
|
|
|
---
|
2012-10-26 17:06:09 +02:00
|
|
|
Index: grub-2.00/grub-core/partmap/msdos.c
|
2012-03-22 12:32:34 +01:00
|
|
|
===================================================================
|
2012-10-26 17:06:09 +02:00
|
|
|
--- grub-2.00.orig/grub-core/partmap/msdos.c
|
|
|
|
+++ grub-2.00/grub-core/partmap/msdos.c
|
2013-06-26 20:19:00 +02:00
|
|
|
@@ -188,13 +188,20 @@ grub_partition_msdos_iterate (grub_disk_
|
2012-06-29 06:59:42 +02:00
|
|
|
(unsigned long long) p.len);
|
2012-03-22 12:32:34 +01:00
|
|
|
|
|
|
|
/* 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))
|
|
|
|
{
|
2012-10-26 17:06:09 +02:00
|
|
|
- p.number++;
|
|
|
|
+ if (!grub_msdos_partition_is_extended (e->type) || p.number < 3)
|
|
|
|
+ {
|
|
|
|
+ p.number++;
|
2012-03-22 12:32:34 +01:00
|
|
|
|
2013-06-26 20:19:00 +02:00
|
|
|
- if (hook (disk, &p, hook_data))
|
2012-10-26 17:06:09 +02:00
|
|
|
- return grub_errno;
|
|
|
|
+ /* 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;
|
2012-03-22 12:32:34 +01:00
|
|
|
+
|
2013-06-26 20:19:00 +02:00
|
|
|
+ if (hook (disk, &p, hook_data))
|
2012-10-26 17:06:09 +02:00
|
|
|
+ return grub_errno;
|
|
|
|
+ }
|
2012-03-22 12:32:34 +01:00
|
|
|
}
|
2013-06-26 20:19:00 +02:00
|
|
|
else if (p.number < 3)
|
2012-10-26 17:06:09 +02:00
|
|
|
/* If this partition is a logical one, shouldn't increase the
|