[PATCH v1 1/2] efi_loader: improve device path matching for partition lookup

Ilias Apalodimas ilias.apalodimas at linaro.org
Fri Nov 21 11:41:20 CET 2025


Hi Balaji,

On Fri, 21 Nov 2025 at 11:24, Balaji Selvanathan
<balaji.selvanathan at oss.qualcomm.com> wrote:
>
> Hi Ilias,
> Sorry for the late reply.
>
> If the boot option generation logic skips partitions, then the boot
> option points to whole disk.
>
> But when capsule update calls device_is_present_and_system_part() →
> efi_dp_find_obj() → find_handle(), it tries to match this boot device
> path against the ESP partition handle which has path longer than boot
> device path.
>
> The find_handle() logic at line 142 rejects the ESP handle because:
> if (len_current > len)  // ESP path is longer than boot device path
>      continue;           // Skip it!
>
> So capsule update fails to find the ESP partition.
> Based on this analysis, I believe the fix I proposed would help address
> this issue, but I'd appreciate your thoughts on whether this approach
> makes sense or if there's a better way to handle it.

It would and and what you point at is an actual problem. The reason it
happens is that doing what is suggested would violate the EFI spec.
OTOH I don't mind because being able to update the device without
having to manually add a boot option is a nice feature.
Heinirch any opinions?

Cheers
/Ilias
> Thanks for your guidance!
>
> On 8/28/2025 5:53 PM, Ilias Apalodimas wrote:
> > Yes it was. In fact the original patches were adding the file instead
> > of the disk [1], but we had concerns on scanning all partitions wrt to
> > boot time. I don't remember if anyone tested the boot time though.


More information about the U-Boot mailing list