diff options
author | Liav A <liavalb@gmail.com> | 2021-01-29 21:04:12 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-01 17:13:23 +0100 |
commit | 6e8f86b44bbef8c561f74e136d5c8da643ae0352 (patch) | |
tree | 2cdd0de928019dd555bc81a11faa0e308a844498 | |
parent | 65c27bfe52df291875ed0dc95340c3173ed09cc8 (diff) | |
download | serenity-6e8f86b44bbef8c561f74e136d5c8da643ae0352.zip |
Ports: Upgrade dmidecode to version 3.3
-rw-r--r-- | Ports/AvailablePorts.md | 2 | ||||
-rwxr-xr-x | Ports/dmidecode/package.sh | 2 | ||||
-rw-r--r-- | Ports/dmidecode/patches/dmidecode.patch | 48 | ||||
-rw-r--r-- | Ports/dmidecode/patches/dmiopt.c.patch (renamed from Ports/dmidecode/patches/dmiopt.patch) | 17 | ||||
-rw-r--r-- | Ports/dmidecode/patches/dmiopt.h.patch | 13 |
5 files changed, 63 insertions, 19 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 45655797c3..e4a3b509d2 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -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/ | diff --git a/Ports/dmidecode/package.sh b/Ports/dmidecode/package.sh index d1542a214e..f22b492ab7 100755 --- a/Ports/dmidecode/package.sh +++ b/Ports/dmidecode/package.sh @@ -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 diff --git a/Ports/dmidecode/patches/dmidecode.patch b/Ports/dmidecode/patches/dmidecode.patch index 0fbec65a73..8b12ac99ce 100644 --- a/Ports/dmidecode/patches/dmidecode.patch +++ b/Ports/dmidecode/patches/dmidecode.patch @@ -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) */ diff --git a/Ports/dmidecode/patches/dmiopt.patch b/Ports/dmidecode/patches/dmiopt.c.patch index c91fff322b..2e75eb83a9 100644 --- a/Ports/dmidecode/patches/dmiopt.patch +++ b/Ports/dmidecode/patches/dmiopt.c.patch @@ -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" diff --git a/Ports/dmidecode/patches/dmiopt.h.patch b/Ports/dmidecode/patches/dmiopt.h.patch new file mode 100644 index 0000000000..875f6cb8c5 --- /dev/null +++ b/Ports/dmidecode/patches/dmiopt.h.patch @@ -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); |