[PATCH v3 3/5] env: scsi: Add support for partition type GUID based environment

Simon Glass sjg at chromium.org
Mon Apr 20 03:18:04 CEST 2026


Hi Balaji,

On 2026-04-19T10:24:02, Balaji Selvanathan
<balaji.selvanathan at oss.qualcomm.com> wrote:
> env: scsi: Add support for partition type GUID based environment
>
> Add support for locating SCSI environment partition using GPT type
> GUID instead of unique UUID. This enables the saveenv command to
> work with partitions identified by their type rather than unique
> identifiers, providing flexibility for systems where partition
> UUIDs may vary across devices but types remain constant.
>
> Introduce a Kconfig choice statement to select between three partition
> lookup methods. The choice provides mutually exclusive options:
> ENV_SCSI_PART_USE_UUID (default), ENV_SCSI_PART_USE_TYPE_GUID, and
> ENV_SCSI_PART_USE_HW. The corresponding string configs depend on their
> respective selection method, creating a clear configuration structure.
>
> Introduce CONFIG_ENV_SCSI_PART_TYPE_GUID configuration option that
> allows specifying a partition type GUID for environment storage.
> When SCSI_ENV_PART_USE_TYPE_GUID is enabled, the environment subsystem
> uses the type GUID based lookup method via
> scsi_get_blk_by_type_guid() to find the first matching partition.
>
> [...]
>
> env/Kconfig | 50 ++++++++++++++++++++++++++++++++++++++++++++++++--
>  env/scsi.c  | 29 ++++++++++++++++++++++++++---
>  2 files changed, 74 insertions(+), 5 deletions(-)

> diff --git a/env/Kconfig b/env/Kconfig
> @@ -763,12 +763,58 @@ config ENV_MMC_USE_DT
> +config ENV_SCSI_PART_USE_TYPE_GUID
> +     bool "Use partition type GUID"
> +     help
> +       Use the partition type GUID to identify the SCSI partition
> +       for environment storage. The first partition matching the
> +       specified type GUID will be used.

How about adding 'select PARTITION_TYPE_GUID' so that users do not
have to manually enable it. Otherwise the lookup will silently fail at
runtime when part_get_info_by_type_guid() returns -ENOENT

Reviewed-by: Simon Glass <sjg at chromium.org>

Regards,
Simon


More information about the U-Boot mailing list