U-boot Archive mirror
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@cherry.de>
To: Chris Morgan <macroalpha82@gmail.com>, u-boot@lists.denx.de
Cc: trini@konsulko.com, kever.yang@rock-chips.com,
	philipp.tomsich@vrull.eu, sjg@chromium.org,
	Chris Morgan <macromorgan@hotmail.com>
Subject: Re: [PATCH] rockchip: Correct UUID for root partitions
Date: Fri, 3 May 2024 15:53:36 +0200	[thread overview]
Message-ID: <beac250b-2f37-4d30-8bc9-b22e5ba3ddcc@cherry.de> (raw)
In-Reply-To: <20240426153338.210102-1-macroalpha82@gmail.com>

Hi Chris,

On 4/26/24 5:33 PM, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
> 
> For root partitions, the UUID should still be random but the partition
> type uuid should either be b921b045-1df0-41c3-af44-4c6f280d3fae for
> aarch64 or 69dad710-2ce4-4e3c-b16c-21a1d49abed3 for aarch32. Correct
> the attribute so it is the partition type that is hard coded and not
> the partition unique identifier.
> 
> Note that in order for "type" to be used the config option
> CONFIG_PARTITION_TYPE_GUID must be enabled. If this option is not
> enabled then the type is ignored and instead the partition type
> remains the generic ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 for a
> Linux data partition.
> 
> Fixes: 42ec247e6988 ("rockchip: use UUID for root partitions")
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> ---
>   include/configs/rockchip-common.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
> index 9121bba373..f620579248 100644
> --- a/include/configs/rockchip-common.h
> +++ b/include/configs/rockchip-common.h
> @@ -26,7 +26,7 @@
>   	"name=loader2,start=8MB,size=4MB,uuid=${uuid_gpt_loader2};" \
>   	"name=trust,size=4M,uuid=${uuid_gpt_atf};" \
>   	"name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};" \
> -	"name=rootfs,size=-,uuid="ROOT_UUID
> +	"name=rootfs,size=-,uuid=${uuid_gpt_rootfs},type="ROOT_UUID

I would recommend to rename ROOT_UUID to ROOT_GUID also, since it's what 
it is, c.f. 
https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs

BTW, it seems that type is optional, so maybe we could afford to just 
remove the whole thing? I don't see anything else defining that type 
parameter?

c.f. https://elixir.bootlin.com/u-boot/latest/source/cmd/gpt.c#L536

Also, this code is guarded by CONFIG_PARTITION_TYPE_GUID which seems to 
only be enabled for RK3399 and no other SoC or Rockchip board... so not 
sure it's *THAT* useful (or if it is, are we missing out on enabling on 
other boards/SoCs).

Additionally, I cannot find anything setting uuid_gpt_rootfs environment 
variable anywhere. I'm a bit lost to be honest. Are we maybe randomly 
generating this uuid at runtime? (RANDOM_UUID is implied by CMD_GPT 
after all so it isn't too much of a stretch).

Cheers,
Quentin

      reply	other threads:[~2024-05-03 14:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 15:33 [PATCH] rockchip: Correct UUID for root partitions Chris Morgan
2024-05-03 13:53 ` Quentin Schulz [this message]

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=beac250b-2f37-4d30-8bc9-b22e5ba3ddcc@cherry.de \
    --to=quentin.schulz@cherry.de \
    --cc=kever.yang@rock-chips.com \
    --cc=macroalpha82@gmail.com \
    --cc=macromorgan@hotmail.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).