[PATCH] lib: fwts_uefi: make vars work on recent kernels (LP: #1171617 )

Keng-Yu Lin kengyu at canonical.com
Tue Apr 23 01:21:29 UTC 2013


On Tue, Apr 23, 2013 at 4:43 AM, Colin Ian King
<colin.king at canonical.com> wrote:
> On 19/04/13 15:42, Colin King wrote:
>>
>> From: Colin Ian King <colin.king at canonical.com>
>>
>
> This fixes LP:#1171617
>
> Kengu-Yu, do you mind added that bug number into the patch
> when it is added to the repo.
>

No problem. Already done.

> Also, can we get fwts released as a SRU under this bug as it's quite an
> omission for uefidump to fail with recent kernels.
>

I will do the SRU.

> Thanks.
>
>> Looks like we need to check for PSTOREFS and EFIVARSFS magics
>> to make this work with recent kernels. Sigh.  Tested on 3.5 + 3.8
>> kernels.  Without this fix uefidump fails on 3.8 kernels.
>>
>> Thanks to Stefan Bader for spotting this bug.
>>
>> Signed-off-by: Colin Ian King <colin.king at canonical.com>
>> ---
>>   src/lib/src/fwts_uefi.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
>> index b3d0c36..8149d23 100644
>> --- a/src/lib/src/fwts_uefi.c
>> +++ b/src/lib/src/fwts_uefi.c
>> @@ -60,7 +60,8 @@ typedef struct {
>>   #define UEFI_IFACE_EFIVARS            (3)     /* efivar fs */
>>
>>   /* File system magic numbers */
>> -#define EFIVARS_FS_MAGIC       0x6165676C
>> +#define PSTOREFS_MAGIC          0x6165676C
>> +#define EFIVARFS_MAGIC          0xde5e81e4
>>   #define SYS_FS_MAGIC          0x62656572
>>
>>   /*
>> @@ -126,7 +127,8 @@ static int fwts_uefi_get_interface(char **path)
>>         /* We've now found a valid file system we can use */
>>         *path = efivar_path;
>>
>> -       if (statbuf.f_type == EFIVARS_FS_MAGIC) {
>> +       if ((statbuf.f_type == EFIVARFS_MAGIC) ||
>> +           (statbuf.f_type == PSTOREFS_MAGIC)) {
>>                 efivars_interface = UEFI_IFACE_EFIVARS;
>>                 return UEFI_IFACE_EFIVARS;
>>         }
>>
>
>
> --
> fwts-devel mailing list
> fwts-devel at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/fwts-devel



More information about the fwts-devel mailing list