[PATCH] lib: fwts_uefi: make vars work on recent kernels

Colin King colin.king at canonical.com
Fri Apr 19 14:42:48 UTC 2013


From: Colin Ian King <colin.king at canonical.com>

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;
 	}
-- 
1.8.1.2




More information about the fwts-devel mailing list