mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
Ports: Upgrade dmidecode to version 3.3
This commit is contained in:
parent
65c27bfe52
commit
6e8f86b44b
5 changed files with 63 additions and 19 deletions
|
@ -12,7 +12,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
|
|||
| [`curl`](curl/) | curl | 7.65.3 | https://curl.se/ |
|
||||
| [`dash`](dash/) | DASH | 0.5.10.2 | http://gondor.apana.org.au/~herbert/dash |
|
||||
| [`diffutils`](diffutils/) | GNU Diffutils | 3.5 | https://www.gnu.org/software/diffutils/ |
|
||||
| [`dmidecode`](dmidecode/) | dmidecode | 3.1 | https://github.com/mirror/dmidecode |
|
||||
| [`dmidecode`](dmidecode/) | dmidecode | 3.3 | https://github.com/mirror/dmidecode |
|
||||
| [`doom`](doom/) | DOOM | | https://github.com/SerenityOS/SerenityDOOM |
|
||||
| [`dropbear`](dropbear/) | Dropbear SSH | 2019.78 | https://dropbear.nl/mirror/dropbear.html |
|
||||
| [`ed`](ed/) | GNU ed | 1.15 | https://www.gnu.org/software/ed/ |
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env -S bash ../.port_include.sh
|
||||
port=dmidecode
|
||||
version=3.1
|
||||
version=3.3
|
||||
useconfigure=false
|
||||
prefix=
|
||||
files="https://download.savannah.gnu.org/releases/dmidecode/dmidecode-${version}.tar.xz dmidecode-${version}.tar.xz
|
||||
|
|
|
@ -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) */
|
||||
|
|
|
@ -1,17 +1,26 @@
|
|||
diff --git a/dmiopt.c b/dmiopt.c
|
||||
index da42546..8d43119 100644
|
||||
index d08288f..42f5458 100644
|
||||
--- a/dmiopt.c
|
||||
+++ b/dmiopt.c
|
||||
@@ -259,7 +259,7 @@ int parse_command_line(int argc, char * const argv[])
|
||||
{ "dump-bin", required_argument, NULL, 'B' },
|
||||
@@ -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 }
|
||||
};
|
||||
@@ -353,7 +353,7 @@ void print_help(void)
|
||||
@@ -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"
|
13
Ports/dmidecode/patches/dmiopt.h.patch
Normal file
13
Ports/dmidecode/patches/dmiopt.h.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
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);
|
Loading…
Add table
Add a link
Reference in a new issue