From 5b47f83914e68f40c57feeaa6582c183556f51c2 Mon Sep 17 00:00:00 2001
From: Mark Salter <msalter@redhat.com>
Date: Thu, 25 Jun 2015 12:27:03 -0400
Subject: [PATCH] Support upstream sysfs filename for smbios entry point
The existing (preliminary) SMBIOS 64-bit support relies on the
SMBIOS entry point to be exposed via sysfs. Since this support
was added, the upstream kernel patches have evolved and now use
a different filename. This patch checks for the new filename as
well as the older name for backwards compatibility.
Signed-off-by: Mark Salter <msalter@redhat.com>
---
libdmifs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libdmifs.c b/libdmifs.c
index ef4e1c1..05c8ea0 100644
--- a/libdmifs.c
+++ b/libdmifs.c
@@ -102,6 +102,8 @@ static int dmi_get_smbios(unsigned char *smbios)
enum {SMBIOS_SIZE = 32};
file = fopen("/sys/firmware/dmi/smbios_raw_header", "rb");
+ if (!file)
+ file = fopen("/sys/firmware/dmi/tables/smbios_entry_point", "rb");
if (!file) {
fprintf(stderr, "no \"smbios\" sysfs entry\n");
return count;
--
2.4.3