grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/5] msdos-part: allow embedding in extended partition


From: Jiri Slaby
Subject: [PATCH 3/5] msdos-part: allow embedding in extended partition
Date: Mon, 9 Jul 2012 22:02:28 +0200

From: Michael Chang <address@hidden>

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 <address@hidden>
References: https://bugzilla.novell.com/show_bug.cgi?id=750897
---
 grub-core/partmap/msdos.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/grub-core/partmap/msdos.c b/grub-core/partmap/msdos.c
index 6e54a74..17f712e 100644
--- a/grub-core/partmap/msdos.c
+++ b/grub-core/partmap/msdos.c
@@ -181,11 +181,15 @@ grub_partition_msdos_iterate (grub_disk_t 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;
            }
-- 
1.7.10.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]