[PATCH 1/1] cmd: eficonfig: create shortened boot options

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Sat Nov 18 11:59:47 CET 2023


On 11/18/23 08:35, Ilias Apalodimas wrote:
> Hi Heinrich
> 
> On Fri, 17 Nov 2023 at 01:08, Heinrich Schuchardt
> <heinrich.schuchardt at canonical.com> wrote:
>>
>> The boot options created by eficonfig should use shortened device-paths to
>> avoid problems if drives are enumerated in a different sequence.
>>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
>> ---
>>   cmd/eficonfig.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
>> index e6e8a0a488..3d95092109 100644
>> --- a/cmd/eficonfig.c
>> +++ b/cmd/eficonfig.c
>> @@ -528,6 +528,7 @@ struct efi_device_path *eficonfig_create_device_path(struct efi_device_path *dp_
>>          p += fp_size;
>>          *((struct efi_device_path *)p) = END;
>>
>> +       dp_volume = efi_dp_shorten(dp_volume);
> 
> efi_dp_shorten can return null.  Dont we need to check that here?

Thank you for reviewing.

In the current usage we always have a dp_volume selected in 
eficonfig_select_volume. Only if we had an EFI_SIMPLE_FILE_PROTOCOL on a 
device that is not a block device we could receive NULL here.

Thinking of future support of network files it is probably wiser to 
catch this case too.

Best regards

Heinrich

> 
> Thanks
> /Ilias
>>          dp = efi_dp_append(dp_volume, (struct efi_device_path *)buf);
>>          free(buf);
>>
>> --
>> 2.40.1
>>



More information about the U-Boot mailing list