From: Lukasz Majewski <l.majewski@majess.pl>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] gpt: add part-uuid and part-num subcommands
Date: Mon, 4 Dec 2017 22:12:47 +0100 [thread overview]
Message-ID: <20171204221247.67babafa@jawa> (raw)
In-Reply-To: <CAAkeqgW89TQ0WTMi3=GGaM=K01AY4FT-F0V3RzQJg5wFdnq+fw@mail.gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 3701 bytes --]
Hi Andrey,
> Hi Lukasz,
>
> On Tue, Nov 14, 2017 at 1:45 AM, Lukasz Majewski
> <l.majewski@majess.pl> wrote:
> > Hi Andrey,
> >
> >> Hi Lukasz,
> >>
> >> On Thu, Nov 9, 2017 at 2:28 PM, Lukasz Majewski
> >> <l.majewski@majess.pl> wrote:
> >> > On Thu, 9 Nov 2017 07:34:44 -0800
> >> > Andrey Yurovsky <yurovsky@gmail.com> wrote:
> >> >
> >> >> On Thu, Nov 9, 2017 at 1:55 AM, Lukasz Majewski
> >> >> <l.majewski@majess.pl> wrote:
> >> >> > Hi Andrey,
> >> >> >
> >> >> >> Hi Otavio,
> >> >> >>
> >> >> >> On Wed, Nov 8, 2017 at 2:47 AM, Otavio Salvador
> >> >> >> <otavio.salvador@ossystems.com.br> wrote:
> >> >> >> > On Tue, Nov 7, 2017 at 10:43 PM, your name
> >> >> >> > <yurovsky@gmail.com> wrote:
> >> >> >> >> From: Andrey Yurovsky <yurovsky@gmail.com>
> >> >> >> >>
> >> >> >> >> It is useful to be able to retrieve a partition UUID or
> >> >> >> >> number given the partition label, for instance some
> >> >> >> >> systems use the partition label to indicate the purpose
> >> >> >> >> of the partition (such as "rootfs0" being the 0th root
> >> >> >> >> file system in an A/B image scheme).
> >> >> >> >>
> >> >> >> >> Add "gpt part-uuid" to retrieve the partition UUID for a
> >> >> >> >> given label and "gpt part-num" to retrieve the partition
> >> >> >> >> number for a given label along with some documentation.
> >> >> >> >>
> >> >> >> >> Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
> >> >> >> >
> >> >> >> > Why not use the 'part' cmd? it provides it.
> >> >> >>
> >> >> >> Sorry, I missed the part cmd, it doesn't seem to be
> >> >> >> documented in doc/ and it's unclear what <dev> means there.
> >> >> >
> >> >> > If I may ask - Andrey, if you are now on this "topic" - would
> >> >> > you dare to add some ./doc entry for 'part' command?
> >> >>
> >> >> Yes, I will do that.
> >> >
> >> > Thanks :-)
> >>
> >> On further investigation I am not sure that it's possible to extend
> >> the part command to retrieve UUIDs by label because of the design
> >> of the partition type drivers. Here is how I understand it to work:
> >> 1. the "part" command uses part_get_info() and in turn gets a
> >> partition driver and can call print() there (which is how EFI/GPT
> >> disks are printed with "part list"). The right information
> >> (including label) is printed but it's not tied to the caller in
> >> any way.
> >
> > Maybe you can set some env variable with proper data?
> >
> > For example, please refer to ./cmd/part.c do_part_start() function.
> >
> > Example call from envs (include/configs/display5.h):
> > "part start mmc ${mmcdev} ${kernel_part} lba_start; " \
> >
>
> Again that assumes the partition is referred to by number, I need it
> to be by label, and the part/disk interface does not seem to have any
> way to utilize labels. Unfortunately it looks like my original
> approach with the gpt command is the only way to implement this with
> the current design (at least from what I see here). Please let me know
> if I've missed something. Thanks!
Please correct me if I'm wrong - you need the starting LBA of the
partition named e.g. "FOO" in gpt ?
Conceptually it would be correct to have:
part start <interface> <dev> <NAME - e.g.'FOO'> <env to set>
gpt start <interface> <dev> <NAME- e.g. 'FOO'> <env to set>
If your code is really _small_ and can be used only with GPT, then lets
go for the second option.
--
Best regards,
Łukasz Majewski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171204/6aa79116/attachment.sig>
next prev parent reply other threads:[~2017-12-04 21:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-08 0:43 [U-Boot] [PATCH] gpt: add part-uuid and part-num subcommands your name
2017-11-08 10:47 ` Otavio Salvador
2017-11-08 17:10 ` Andrey Yurovsky
2017-11-09 9:55 ` Lukasz Majewski
2017-11-09 15:34 ` Andrey Yurovsky
2017-11-09 22:28 ` Lukasz Majewski
2017-11-11 20:39 ` Andrey Yurovsky
2017-11-14 9:45 ` Lukasz Majewski
2017-12-04 17:57 ` Andrey Yurovsky
2017-12-04 21:12 ` Lukasz Majewski [this message]
2017-12-04 21:48 ` Andrey Yurovsky
2017-12-05 15:10 ` Lukasz Majewski
2017-12-05 19:00 ` Andrey Yurovsky
2017-12-11 9:09 ` Lukasz Majewski
2017-11-08 17:16 ` Andrey Yurovsky
2017-11-08 18:05 ` Otavio Salvador
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=20171204221247.67babafa@jawa \
--to=l.majewski@majess.pl \
--cc=u-boot@lists.denx.de \
/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