From: Andrey Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: floppym@gentoo.org
Subject: Re: [PATCH] grub-install: Improve support for partitioned loop devices.
Date: Sun, 26 Jan 2014 09:16:53 +0400 [thread overview]
Message-ID: <20140126091653.727f82e4@opensuse.site> (raw)
In-Reply-To: <1390700460-30725-1-git-send-email-floppym@gentoo.org>
В Sat, 25 Jan 2014 20:41:00 -0500
Mike Gilbert <floppym@gentoo.org> пишет:
> * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect
> /dev/loopX as being the parent of /dev/loopXpY.
Those devices are normally device-mapper ones (created by kpartx) and
grub already detects parent by following device-mapper tree. What
exact problem are you trying to solve?
> ---
> 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 <floppym@gentoo.org>
> + 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 <arvidjaar@gmail.com>
>
> 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;
next prev parent reply other threads:[~2014-01-26 5:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-26 1:41 [PATCH] grub-install: Improve support for partitioned loop devices Mike Gilbert
2014-01-26 5:16 ` Andrey Borzenkov [this message]
2014-01-26 6:20 ` Mike Gilbert
2014-01-26 6:25 ` Andrey Borzenkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140126091653.727f82e4@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=floppym@gentoo.org \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).