summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-03-13 12:56:06 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-29 20:53:59 +0200
commit0259781402ddc2b7693d348db668156a49b2bd72 (patch)
tree21af3cc1bc283b341bd7907f29fac8e8bde321a9
parent3d89938c4a3b28090597fe8c223a6685cbf7b4b8 (diff)
downloadserenity-0259781402ddc2b7693d348db668156a49b2bd72.zip
Ports: Fix dmidecode patches
Since we have a SysFS now, we can just let dmidecode to read the DMI blobs from it.
-rw-r--r--Ports/dmidecode/patches/dmidecode.patch37
-rw-r--r--Ports/dmidecode/patches/dmiopt.c.patch31
-rw-r--r--Ports/dmidecode/patches/dmiopt.h.patch13
3 files changed, 2 insertions, 79 deletions
diff --git a/Ports/dmidecode/patches/dmidecode.patch b/Ports/dmidecode/patches/dmidecode.patch
index 8b12ac99ce..b4265e6113 100644
--- a/Ports/dmidecode/patches/dmidecode.patch
+++ b/Ports/dmidecode/patches/dmidecode.patch
@@ -6,11 +6,11 @@ diff -u b/dmidecode.c b/dmidecode.c
#define FLAG_STOP_AT_EOT (1 << 1)
-#define SYS_FIRMWARE_DIR "/sys/firmware/dmi/tables"
-+#define SYS_FIRMWARE_DIR "/proc"
++#define SYS_FIRMWARE_DIR "/sys/bios"
#define SYS_ENTRY_FILE SYS_FIRMWARE_DIR "/smbios_entry_point"
#define SYS_TABLE_FILE SYS_FIRMWARE_DIR "/DMI"
-@@ -3654,8 +3654,6 @@
+@@ -3654,7 +3654,5 @@
{
if (addrtype == 0x1) /* IPv4 */
return inet_ntop(AF_INET, data, storage, 64);
@@ -18,36 +18,3 @@ diff -u b/dmidecode.c b/dmidecode.c
- return inet_ntop(AF_INET6, data, storage, 64);
return out_of_spec;
}
-
-@@ -5278,7 +5276,7 @@
- if ((flags & FLAG_NO_FILE_OFFSET) || (opt.flags & FLAG_FROM_DUMP))
- {
- /*
-- * When reading from sysfs or from a dump file, the file may be
-+ * When reading from procfs or from a dump file, the file may be
- * shorter than announced. For SMBIOS v3 this is expcted, as we
- * only know the maximum table size, not the actual table size.
- * For older implementations (and for SMBIOS v3 too), this
-@@ -5647,11 +5645,11 @@
- * the largest one, then determine what type it contains.
- */
- size = 0x20;
-- if (!(opt.flags & FLAG_NO_SYSFS)
-+ if (!(opt.flags & FLAG_NO_PROCFS)
- && (buf = read_file(0, &size, SYS_ENTRY_FILE)) != NULL)
- {
- if (!(opt.flags & FLAG_QUIET))
-- pr_info("Getting SMBIOS data from sysfs.");
-+ pr_info("Getting SMBIOS data from procfs.");
- if (size >= 24 && memcmp(buf, "_SM3_", 5) == 0)
- {
- if (smbios3_decode(buf, SYS_TABLE_FILE, FLAG_NO_FILE_OFFSET))
-@@ -5671,7 +5669,7 @@
- if (found)
- goto done;
- if (!(opt.flags & FLAG_QUIET))
-- pr_info("Failed to get SMBIOS data from sysfs.");
-+ pr_info("Failed to get SMBIOS data from procfs.");
- }
-
- /* Next try EFI (ia64, Intel-based Mac, arm64) */
diff --git a/Ports/dmidecode/patches/dmiopt.c.patch b/Ports/dmidecode/patches/dmiopt.c.patch
deleted file mode 100644
index 2e75eb83a9..0000000000
--- a/Ports/dmidecode/patches/dmiopt.c.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-diff --git a/dmiopt.c b/dmiopt.c
-index d08288f..42f5458 100644
---- a/dmiopt.c
-+++ b/dmiopt.c
-@@ -277,7 +277,7 @@ int parse_command_line(int argc, char * const argv[])
- { "from-dump", required_argument, NULL, 'F' },
- { "handle", required_argument, NULL, 'H' },
- { "oem-string", required_argument, NULL, 'O' },
-- { "no-sysfs", no_argument, NULL, 'S' },
-+ { "no-procfs", no_argument, NULL, 'S' },
- { "version", no_argument, NULL, 'V' },
- { NULL, 0, NULL, 0 }
- };
-@@ -326,7 +326,7 @@ int parse_command_line(int argc, char * const argv[])
- opt.flags |= FLAG_DUMP;
- break;
- case 'S':
-- opt.flags |= FLAG_NO_SYSFS;
-+ opt.flags |= FLAG_NO_PROCFS;
- break;
- case 'V':
- opt.flags |= FLAG_VERSION;
-@@ -377,7 +377,7 @@ void print_help(void)
- " -u, --dump Do not decode the entries\n"
- " --dump-bin FILE Dump the DMI data to a binary file\n"
- " --from-dump FILE Read the DMI data from a binary file\n"
-- " --no-sysfs Do not attempt to read DMI data from sysfs files\n"
-+ " --no-procfs Do not attempt to read DMI data from procfs files\n"
- " --oem-string N Only display the value of the given OEM string\n"
- " -V, --version Display the version and exit\n";
-
diff --git a/Ports/dmidecode/patches/dmiopt.h.patch b/Ports/dmidecode/patches/dmiopt.h.patch
deleted file mode 100644
index 875f6cb8c5..0000000000
--- a/Ports/dmidecode/patches/dmiopt.h.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/dmiopt.h b/dmiopt.h
-index 2374637..d215aff 100644
---- a/dmiopt.h
-+++ b/dmiopt.h
-@@ -45,7 +45,7 @@ extern struct opt opt;
- #define FLAG_QUIET (1 << 3)
- #define FLAG_DUMP_BIN (1 << 4)
- #define FLAG_FROM_DUMP (1 << 5)
--#define FLAG_NO_SYSFS (1 << 6)
-+#define FLAG_NO_PROCFS (1 << 6)
-
- int parse_command_line(int argc, char * const argv[]);
- void print_help(void);