1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00

Ports: Upgrade dmidecode to version 3.3

This commit is contained in:
Liav A 2021-01-29 21:04:12 +02:00 committed by Andreas Kling
parent 65c27bfe52
commit 6e8f86b44b
5 changed files with 63 additions and 19 deletions

View file

@ -1,8 +1,7 @@
diff --git a/dmidecode.c b/dmidecode.c
index 6559567..17573a9 100644
--- a/dmidecode.c
diff -u b/dmidecode.c b/dmidecode.c
--- b/dmidecode.c
+++ b/dmidecode.c
@@ -80,7 +80,7 @@ static const char *bad_index = "<BAD INDEX>";
@@ -90,7 +90,7 @@
#define FLAG_NO_FILE_OFFSET (1 << 0)
#define FLAG_STOP_AT_EOT (1 << 1)
@ -11,21 +10,44 @@ index 6559567..17573a9 100644
#define SYS_ENTRY_FILE SYS_FIRMWARE_DIR "/smbios_entry_point"
#define SYS_TABLE_FILE SYS_FIRMWARE_DIR "/DMI"
@@ -5053,7 +5053,7 @@ int main(int argc, char * const argv[])
}
@@ -3654,8 +3654,6 @@
{
if (addrtype == 0x1) /* IPv4 */
return inet_ntop(AF_INET, data, storage, 64);
- if (addrtype == 0x2) /* IPv6 */
- return inet_ntop(AF_INET6, data, storage, 64);
return out_of_spec;
}
/*
- * First try reading from sysfs tables. The entry point file could
+ * First try reading from procfs tables. The entry point file could
* contain one of several types of entry points, so read enough for
@@ -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.
*/
@@ -5062,7 +5062,7 @@ int main(int argc, char * const argv[])
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))
- printf("Getting SMBIOS data from sysfs.\n");
+ printf("Getting SMBIOS data from procfs.\n");
- 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) */