[RFC PATCH] efi_loader: disk: Add print to show ESP device
Heinrich Schuchardt
heinrich.schuchardt at canonical.com
Sat Dec 6 11:58:14 CET 2025
On 12/4/25 10:47, Padmarao Begari wrote:
> Print a message for debug purposes when an EFI System Partition
> (ESP) is detected on the device to indicate how many devices are
> detected. Only one ESP device is used for capsule update; if
> multiple ESP devices are found, it may indicate corruption in UEFI
> variables. This is for informational purposes only, as the number
> of removable media connected to a given board cannot be controlled.
>
> Signed-off-by: Padmarao Begari <padmarao.begari at amd.com>
> ---
> lib/efi_loader/efi_disk.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
> index 130c4db9606..8391de1527c 100644
> --- a/lib/efi_loader/efi_disk.c
> +++ b/lib/efi_loader/efi_disk.c
> @@ -565,6 +565,11 @@ static efi_status_t efi_disk_add_dev(
> diskobj->media.removable_media,
> diskobj->media.last_block);
>
> + if (part_info && part_info->bootable & PART_EFI_SYSTEM_PARTITION)
> + printf("EFI system partition: %s %x:%x\n",
> + blk_get_uclass_name(desc->uclass_id),
> + desc->devnum, part);
> +
> /* Store first EFI system partition */
> if (part && efi_system_partition.uclass_id == UCLASS_INVALID) {
> if (part_info &&
Hello Padmarao,
Thank you reviewing the ESP detection.
We already have debug output with EFIPRINT() for this information in the
subsequent lines. Please, have a look at CONFIG_LOG for enabling the output.
Generally noisy output should be avoided in the normal bootflow.
A "message for debug purposes" should not use printf().
Maybe we could add a subcommand to the efidebug command for users who
want to look up the identified ESP.
Best regards
Heinrich
More information about the U-Boot
mailing list