Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SoTks-0008Ld-NQ for mharc-grub-devel@gnu.org; Tue, 10 Jul 2012 02:17:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoKAK-0005GZ-2e for grub-devel@gnu.org; Mon, 09 Jul 2012 16:02:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoKAG-0006AY-IG for grub-devel@gnu.org; Mon, 09 Jul 2012 16:02:39 -0400 Received: from mail.pripojeni.net ([178.22.112.14]:36828 helo=smtp.pripojeni.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoKAG-0006A6-Ap for grub-devel@gnu.org; Mon, 09 Jul 2012 16:02:36 -0400 Received: from anemoi.localdomain ([178.22.113.142]) by smtp.pripojeni.net (Kerio Connect 7.2.2); Mon, 9 Jul 2012 22:02:31 +0200 From: Jiri Slaby To: grub-devel@gnu.org Subject: [PATCH 3/5] msdos-part: allow embedding in extended partition Date: Mon, 9 Jul 2012 22:02:28 +0200 Message-Id: <1341864150-9588-3-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1341864150-9588-1-git-send-email-jslaby@suse.cz> References: <1341864150-9588-1-git-send-email-jslaby@suse.cz> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 178.22.112.14 X-Mailman-Approved-At: Tue, 10 Jul 2012 02:17:00 -0400 Cc: Michael Chang , Jiri Slaby X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 20:02:41 -0000 From: Michael Chang 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 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