[PATCH] efi_loader: Add absolute path to EFI_VAR_FILE_NAME

Patrice CHOTARD patrice.chotard at foss.st.com
Wed Mar 20 17:32:05 CET 2024



On 3/20/24 12:53, Ilias Apalodimas wrote:
> Hi Patrice,
> 
> On Wed, 20 Mar 2024 at 12:31, Patrice Chotard
> <patrice.chotard at foss.st.com> wrote:
>>
>> If the ESP partition is formatted in ext4, we got the following error :
>>
>> STM32MP>  setenv -e -nv -bs -rt -v OsIndications =0x0000000000000004
>> GUID: 8be4df61-93ca-11d2-aa0d-00e098032b8c (EFI_GLOBAL_VARIABLE_GUID)
>> Attributes: 0x7
>> Value:
>>     00000000: 04 00 00 00 00 00 00 00                          ........
>> File System is consistent
>> Please supply Absolute path
> 
> This error message comes from ext4_common.c and it's ext4 specific. Do
> you have any idea why this exists?
> What happens to other filesystems? IOW does this change the behavior
> of the existing code if it tries to write a file in FAT?

I made a try in FAT with this patch, and there is no issue.

Thanks
Patrice

> 
> Thanks
> /Ilias
> 
>> ** Error ext4fs_write() **
>> ** Unable to write file ubootefi.var **
>> Failed to persist EFI variables
>>
>> Signed-off-by: Patrice Chotard <patrice.chotard at foss.st.com>
>> ---
>>
>>  include/efi_variable.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/efi_variable.h b/include/efi_variable.h
>> index 805e6c5f1e0..8d507460b20 100644
>> --- a/include/efi_variable.h
>> +++ b/include/efi_variable.h
>> @@ -92,7 +92,7 @@ efi_status_t efi_query_variable_info_int(u32 attributes,
>>                                          u64 *remaining_variable_storage_size,
>>                                          u64 *maximum_variable_size);
>>
>> -#define EFI_VAR_FILE_NAME "ubootefi.var"
>> +#define EFI_VAR_FILE_NAME "/ubootefi.var"
>>
>>  #define EFI_VAR_BUF_SIZE CONFIG_EFI_VAR_BUF_SIZE
>>
>> --
>> 2.25.1
>>


More information about the U-Boot mailing list