public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Przemyslaw Marczak <p.marczak@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] cmd:gpt: randomly generate each partition uuid if undefined
Date: Mon, 03 Mar 2014 18:23:59 +0100	[thread overview]
Message-ID: <5314BAAF.9010602@samsung.com> (raw)
In-Reply-To: <20140303164621.GT16805@bill-the-cat>

On 03/03/2014 05:46 PM, Tom Rini wrote:
> On Mon, Mar 03, 2014 at 04:31:35PM +0100, Przemyslaw Marczak wrote:
>> Hello Tom,
>>
>> On 03/03/2014 03:13 PM, Tom Rini wrote:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> On 03/03/2014 08:45 AM, Przemyslaw Marczak wrote:
>>>
>>> [snip]
>>>> Actually automatically generated uuids was the main purpose of this
>>>> patches. Setting each env variable in this place was the most easy way
>>>> to make this without a lot of duplicated code.
>>>>
>>>> Why do you treat it like a side-effect?
>>>> If user wants have own generated uuids - then he can manually set env
>>>> variables like "uuid_gpt_disk".
>>>> This actually is not changed - when uuid env is set then it will be used
>>>> like in current version of code.
>>>> When user can't generate uuids or just wants to have it automatically
>>>> generated then my code do this job.
>>>
>>> Having been using this code again myself recently, at the high level,
>>> this is useful.  Having to copy/paste in N UUIDs gets silly.  But I also
>>> wonder..
>>>
>>> [snip]
>>>> The one and only reason for put saveenv() here was that if uuids are
>>>> randomly generated or even just are in environment then I can be sure
>>>> that next gpt write (e.g. in case of overwrite sector 0 by mistake) is
>>>> using the same uuids values.
>>>
>>> Is this really an important use case to cover?
>>
>> It can be important if somebody uses UUIDS to boot kernel. In kernel
>> documentation you can find a notice about kernel function
>> name_to_dev_t() - so by command line you can pass uuid for root
>> partition. And the same is for arg "suspend" in kernel cmd line.
>
> Right.  But that seems to be putting things in the wrong order.  If you
> need to restore UUIDs to your partition table, you pass in the optional
> and already known UUID.  If you're starting from scratch, by the time
> the installer is run U-Boot is long gone.  And tying things back to the
> commodity distro stuff, we would be fetching 'root=UUID=...' from some
> file generated and controlled on the Linux side of things anyhow.  To be
> clear, on the OS side of the equation there's much better ways to find
> out that partition1 has a UUID of ... than poking the U-Boot
> environment.
>

Ok, I understand this.

>>> The way I see things, would it be possible (and not a pain) to make the
>>> UUID part of the partition string passed to 'gpt write' optional.  If
>>> not passed, generate the UUIDs needed.  What was used would be seen in
>>> 'part list' and so forth.
>>
>> Ok, so I remove saveenv() from my changes and then we will have two cases:
>>
>> # gpt write mmc 0 $partitions
>> case 1: envorinment uuids are not set; then:
>>    proper uuids variables are set automatically (and printed)
>
> I'd go so far as to say we don't need to print the uuids, they're
> available via 'part list ...'.  A notice that we're generating UUIDs is
> probably not too spammy.
>

Ok, I will remove this notice.

>> case 2: environment uuids are set in env (e.g. some user has put his
>> own env); then
>>    users uuids will be used and new uuids are not generated automatically
>>
>> So this will not change current "gpt" usability - just add new
>> feature, moreover user will be informed about each uuid generation.
>> In case when someone use gpt write by mistake and overwrite uuids by
>> randomly generated then he can easily back to his own uuids by
>> setting each in environment and run gpt write again.
>
> Right.  We're making the use case of "fresh device, create new table"
> easier and we're still allowing "existing device, re-establish old
> UUIDs".
>
That's the point.

>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

Thanks,
-- 
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

  reply	other threads:[~2014-03-03 17:23 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 15:18 [U-Boot] [PATCH 1/2] lib: uuid: add function to generate UUID version 4 Przemyslaw Marczak
2014-02-28 15:18 ` [U-Boot] [PATCH 2/2] cmd:gpt: randomly generate each partition uuid if undefined Przemyslaw Marczak
2014-02-28 17:03   ` Stephen Warren
2014-03-03 13:45     ` Przemyslaw Marczak
2014-03-03 14:13       ` Tom Rini
2014-03-03 15:31         ` Przemyslaw Marczak
2014-03-03 16:46           ` Tom Rini
2014-03-03 17:23             ` Przemyslaw Marczak [this message]
2014-03-03 17:35               ` Tom Rini
2014-03-03 17:58                 ` Przemyslaw Marczak
2014-02-28 16:55 ` [U-Boot] [PATCH 1/2] lib: uuid: add function to generate UUID version 4 Stephen Warren
2014-03-03 13:44   ` Przemyslaw Marczak
2014-03-03 17:47     ` Stephen Warren
2014-03-05 16:45 ` [U-Boot] [PATCH V2 1/3] part_efi: move uuid_string() and string_uuid() to lib/uuid.c Przemyslaw Marczak
2014-03-05 16:45   ` [U-Boot] [PATCH V2 2/3] lib: uuid: add functions to generate UUID version 4 Przemyslaw Marczak
2014-03-10 17:37     ` Stephen Warren
2014-03-13 18:10       ` Przemyslaw Marczak
2014-03-13 18:41         ` Wolfgang Denk
2014-03-13 18:41     ` Wolfgang Denk
2014-03-13 19:18       ` Tom Rini
2014-03-13 19:48         ` Wolfgang Denk
2014-03-13 19:55           ` Stephen Warren
2014-03-13 19:51         ` Przemyslaw Marczak
2014-03-05 16:45   ` [U-Boot] [PATCH V2 3/3] cmd:gpt: randomly generate each partition uuid if undefined Przemyslaw Marczak
2014-03-10 17:44     ` Stephen Warren
2014-03-13 17:28       ` Przemyslaw Marczak
2014-03-13 19:49         ` Stephen Warren
2014-03-13 20:13           ` Przemyslaw Marczak
2014-03-10 17:24   ` [U-Boot] [PATCH V2 1/3] part_efi: move uuid_string() and string_uuid() to lib/uuid.c Stephen Warren
2014-03-10 17:28     ` Tom Rini
2014-03-10 17:52       ` Tom Rini
2014-03-10 17:29   ` Stephen Warren
2014-03-10 17:39     ` Tom Rini
2014-03-14 14:37 ` [U-Boot] [PATCH v3 1/3] part_efi: move uuid<->string conversion functions into lib/uuid.c Przemyslaw Marczak
2014-03-14 14:37   ` [U-Boot] [PATCH v3 2/3] lib: uuid: add functions to generate UUID version 4 Przemyslaw Marczak
2014-03-14 16:12     ` Wolfgang Denk
2014-03-17  9:16       ` Przemyslaw Marczak
2014-03-14 14:37   ` [U-Boot] [PATCH v3 3/3] cmd:gpt: randomly generate each partition uuid if undefined Przemyslaw Marczak
2014-03-14 16:16     ` Wolfgang Denk
2014-03-17  9:17       ` Przemyslaw Marczak
2014-03-14 16:06   ` [U-Boot] [PATCH v3 1/3] part_efi: move uuid<->string conversion functions into lib/uuid.c Wolfgang Denk
2014-03-17  9:15     ` Przemyslaw Marczak
2014-03-19 17:58   ` [U-Boot] [PATCH v4 1/6] " Przemyslaw Marczak
2014-03-19 17:58     ` [U-Boot] [PATCH v4 2/6] lib: uuid: code refactor for proper maintain between uuid bin and string Przemyslaw Marczak
2014-03-19 19:20       ` Wolfgang Denk
2014-03-25 19:12       ` Stephen Warren
2014-03-26 12:00         ` Przemyslaw Marczak
2014-03-26 18:43           ` Stephen Warren
2014-03-19 17:58     ` [U-Boot] [PATCH v4 3/6] lib: uuid: add functions to generate UUID version 4 Przemyslaw Marczak
2014-03-25 19:28       ` Stephen Warren
2014-03-26 12:00         ` Przemyslaw Marczak
2014-03-26 18:47           ` Stephen Warren
2014-03-27  9:17             ` Przemyslaw Marczak
2014-03-19 17:58     ` [U-Boot] [PATCH v4 4/6] new commands: uuid and guid - generate random unique identifier Przemyslaw Marczak
2014-03-25 19:37       ` Stephen Warren
2014-03-26 12:01         ` Przemyslaw Marczak
2014-03-26 18:32           ` Stephen Warren
2014-03-27  9:17             ` Przemyslaw Marczak
2014-03-19 17:58     ` [U-Boot] [PATCH v4 5/6] cmd:gpt: randomly generate each partition uuid if undefined Przemyslaw Marczak
2014-03-25 19:51       ` Stephen Warren
2014-03-26 12:01         ` Przemyslaw Marczak
2014-03-26 18:36           ` Stephen Warren
2014-03-27  9:17             ` Przemyslaw Marczak
2014-03-19 17:58     ` [U-Boot] [PATCH v4 6/6] trats/trats2: enable CONFIG_RANDOM_UUID Przemyslaw Marczak
2014-03-25 19:51       ` Stephen Warren
2014-03-26 12:01         ` Przemyslaw Marczak
2014-03-19 19:19     ` [U-Boot] [PATCH v4 1/6] part_efi: move uuid<->string conversion functions into lib/uuid.c Wolfgang Denk
2014-03-20  8:42       ` Przemyslaw Marczak
2014-03-25 19:03     ` Stephen Warren
2014-04-01 14:30     ` [U-Boot] [PATCH v5 " Przemyslaw Marczak
2014-04-01 14:30       ` [U-Boot] [PATCH v5 2/6] lib: uuid: code refactor for proper maintain between uuid bin and string Przemyslaw Marczak
2014-04-01 14:30       ` [U-Boot] [PATCH v5 3/6] lib: uuid: add functions to generate UUID version 4 Przemyslaw Marczak
2014-04-01 14:30       ` [U-Boot] [PATCH v5 4/6] new commands: uuid and guid - generate random unique identifier Przemyslaw Marczak
2014-04-01 14:30       ` [U-Boot] [PATCH v5 5/6] cmd:gpt: randomly generate each partition uuid if undefined Przemyslaw Marczak
2014-04-01 14:30       ` [U-Boot] [PATCH v5 6/6] trats/trats2: enable CONFIG_RANDOM_UUID Przemyslaw Marczak
2014-04-02  1:28         ` Minkyu Kang
2014-04-02  8:20       ` [U-Boot] [PATCH v6 1/6] part_efi: move uuid<->string conversion functions into lib/uuid.c Przemyslaw Marczak
2014-04-02  8:20         ` [U-Boot] [PATCH v6 2/6] lib: uuid: code refactor for proper maintain between uuid bin and string Przemyslaw Marczak
2014-04-02 21:18           ` [U-Boot] [U-Boot, v6, " Tom Rini
2014-04-02  8:20         ` [U-Boot] [PATCH v6 3/6] lib: uuid: add functions to generate UUID version 4 Przemyslaw Marczak
2014-04-02  8:25           ` Przemyslaw Marczak
2014-04-02 21:18           ` [U-Boot] [U-Boot, v6, " Tom Rini
2014-04-02  8:20         ` [U-Boot] [PATCH v6 4/6] new commands: uuid and guid - generate random unique identifier Przemyslaw Marczak
2014-04-02 21:18           ` [U-Boot] [U-Boot, v6, " Tom Rini
2014-04-02  8:20         ` [U-Boot] [PATCH v6 5/6] cmd:gpt: randomly generate each partition uuid if undefined Przemyslaw Marczak
2014-04-02 21:19           ` [U-Boot] [U-Boot, v6, " Tom Rini
2014-04-02  8:20         ` [U-Boot] [PATCH v6 6/6] trats/trats2: enable CONFIG_RANDOM_UUID Przemyslaw Marczak
2014-04-02 21:19           ` [U-Boot] [U-Boot, v6, " Tom Rini
2014-04-02 21:18         ` [U-Boot] [U-Boot, v6, 1/6] part_efi: move uuid<->string conversion functions into lib/uuid.c Tom Rini
2014-04-03  7:10           ` Przemyslaw Marczak

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=5314BAAF.9010602@samsung.com \
    --to=p.marczak@samsung.com \
    --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