[U-Boot] [PATCH 2/2] cmd:gpt: randomly generate each partition uuid if undefined

Tom Rini trini at ti.com
Mon Mar 3 15:13:10 CET 2014


-----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?

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.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJTFI32AAoJENk4IS6UOR1WAyQP/2bfClvRaWtLzUDggRUnNr99
RKSgB1m/nl09ZwclB2Gn1FZL2IR/M0u+ia89FE9leSN4eoOEswN2rrUiExVv7QpJ
d+oCH/H3oNDAyb9L4HXXYHeRGCVHK7KE/KP5Ngb7KfTGZhj5kHdkx9iQM7dO9OtX
DmvW5+JoRXgXPkpmvy5s20IzRUbBEqGC6Z2h8Y/VKHTDnrUmYvFb6XPgjwwrYVB6
+Hx/7K2R1uXQTuoHM7FqVAqKx7GGiUmcpLG90iHeYcX4fib/+RwC7hcre0rRj71v
NyAnO4t0nXKefLXYe5iGold7cNx9xUKO3s4u2EkC9lNGRkN6RcVuaxzEKGD4/QTX
fHA2q6FwSVLv4lXBT6UWxXiky2C9TMY/DUNM0EWe2KSx2V2glXPKiBX7gRk0Rq0d
EWq1G5oQS0qiZgb+vUQ4Acf4/HDjhAl1l18Hx6w+26LNvz8Fi+o7Om4kkBdI5sos
GX2auS1RxQc3qQkrAjxFx1xpDr9iMikV6nNqYDcVU894PeCgzmUWaWG/IrBFixO6
2XjF1sMth8LrVqUHirh3Y7lDU+FFPP+mMb6eaY3oajtVkg3u6cpQ0eJ0A612CsXG
oaTPxWKKTsWlBxaVIgzu2OXeYg5BJF4OTKxjNiV2wptheEVc4RVLDiQ1yf74YEHy
Hve7lpxa9i4Oo9Vf2Pd7
=5FKf
-----END PGP SIGNATURE-----


More information about the U-Boot mailing list