Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W7Eix-0008LA-9J for mharc-grub-devel@gnu.org; Sat, 25 Jan 2014 20:41:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7Ein-0008Hj-O5 for grub-devel@gnu.org; Sat, 25 Jan 2014 20:41:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7Eif-0004Gh-B1 for grub-devel@gnu.org; Sat, 25 Jan 2014 20:41:13 -0500 Received: from dev.gentoo.org ([2001:470:ea4a:1:214:c2ff:fe64:b2d3]:48750 helo=smtp.gentoo.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7Eif-0004Ga-4M for grub-devel@gnu.org; Sat, 25 Jan 2014 20:41:05 -0500 Received: from naomi.gilbertsystems.net (76-230-137-203.lightspeed.livnmi.sbcglobal.net [76.230.137.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id 125ED33F692 for ; Sun, 26 Jan 2014 01:41:02 +0000 (UTC) From: Mike Gilbert To: grub-devel@gnu.org Subject: [PATCH] grub-install: Improve support for partitioned loop devices. Date: Sat, 25 Jan 2014 20:41:00 -0500 Message-Id: <1390700460-30725-1-git-send-email-floppym@gentoo.org> X-Mailer: git-send-email 1.8.5.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:470:ea4a:1:214:c2ff:fe64:b2d3 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: Sun, 26 Jan 2014 01:41:22 -0000 * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect /dev/loopX as being the parent of /dev/loopXpY. --- ChangeLog | 5 +++++ grub-core/osdep/linux/getroot.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index c93f11f..d5c5c3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-01-26 Mike Gilbert + grub-install: Improve support for partitioned loop devices. + + * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect + /dev/loopX as being the parent of /dev/loopXpY. 2014-01-25 Andrey Borzenkov diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c index 772de0a..19581d3 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -883,6 +883,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, *pp = '\0'; return path; } + + /* If this is a loop device */ + if ((strncmp ("loop", p, 4) == 0) && p[4] >= '0' && p[4] <= '9') + { + char *pp = p + 4; + while (*pp >= '0' && *pp <= '9') + pp++; + if (*pp == 'p') + *is_part = 1; + /* /dev/loop[0-9]+p[0-9]* */ + *pp = '\0'; + return path; + } } return path; -- 1.8.5.3