[PATCH v1 2/2] capsule_update: fix partition match to exclude uefisecapps

Casey Connolly casey.connolly at linaro.org
Tue Jul 29 12:10:09 CEST 2025



On 7/25/25 16:20, Heinrich Schuchardt wrote:
> On 25.07.25 15:11, Casey Connolly wrote:
>> Hi Balaji,
>>
>> On 24/07/2025 11:00, Balaji Selvanathan wrote:
>>> - Update partition name match to use "uefi_" instead of "uefi".
>>> - Prevents incorrect matches with partitions like uefisecapps_a/b.
>>> - Ensures only uefi_a and uefi_b partitions are considered valid.
>>> - Fixes capsule update logic when identifying target partitions.
>>> - Avoids flashing to unintended secure apps partitions.
>>
>> Please rewrite this in sentences rather than bullet points, this should
>> only take a sentence or two to explain.
>>
>> Kind regards,
> 
> The patch does not describe why the change is needed.
> 
> Wouldn't the suggested patch break existing systems using uefia and 
> uefib as partition names?
> 
> What is wrong about calling the A- and B-partition uefia and uefib 
> respectively? Looking at the code it seems only important that the 
> suffix is different. The suffix value seems to be ignored.
> 
> Reading the documentation I would not know if uefi_ALPHA and uefi_BRAVO 
> are valid partition names for the A- and B-slots. I would have expected 
> a matching documentation change in doc/boards/qualcomm describing the 
> precise restrictions on naming the A- and B-partitions.

Some docs explaining this would be a good idea.

These partitions are "firmware", they are provisioned from the factory 
with these names and they always follow the same pattern. We make the 
same assumption in U-Boot that these partitions exist and follow a 
certain scheme. We do assume that there will never be a "uefia" 
partition (if there were it would be added by the user probably on a 
different LUN and this would not be where U-Boot is flashed anyway).

If there is a product with a custom scheme which isn't supported by this 
code then at that point we would look at adjusting this code to be more 
generic somehow.

iirc these partitions also have custom GPT type UUIDs, so it would 
probably make sense to use those in the future rather than matching the 
names and then we can avoid any potential confusion.

In any case, I'm in favour of adding some docs with the expected 
partition layout, I'll send a separate patch for that.

Kind regards,
// Casey (she/her)

> 
> Best regards
> 
> Heinrich
> 
>>
>>>
>>> Signed-off-by: Balaji Selvanathan <balaji.selvanathan at oss.qualcomm.com>
>>> ---
>>>   arch/arm/mach-snapdragon/capsule_update.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/mach-snapdragon/capsule_update.c b/arch/arm/ 
>>> mach-snapdragon/capsule_update.c
>>> index 4dced4961b6..11ef4a0f4b9 100644
>>> --- a/arch/arm/mach-snapdragon/capsule_update.c
>>> +++ b/arch/arm/mach-snapdragon/capsule_update.c
>>> @@ -136,7 +136,7 @@ static int find_target_partition(int *devnum, 
>>> enum uclass_id *uclass,
>>>                * flags might not be set so we assume the A partition 
>>> unless the B
>>>                * partition is active.
>>>                */
>>> -            if (!strncmp(info.name, "uefi", strlen("uefi"))) {
>>> +            if (!strncmp(info.name, "uefi_", strlen("uefi_"))) {
>>>                   /*
>>>                    * If U-Boot was chainloaded somehow we can't be 
>>> flashed to
>>>                    * the uefi partition
> 



More information about the U-Boot mailing list