pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/sysutils/dmidecode
Module Name: pkgsrc
Committed By: mrg
Date: Mon Nov 28 04:26:08 UTC 2022
Modified Files:
pkgsrc/sysutils/dmidecode: Makefile distinfo
pkgsrc/sysutils/dmidecode/patches: patch-config.h
Added Files:
pkgsrc/sysutils/dmidecode/patches: patch-biosdecode.c patch-dmiopt.c
patch-ownership.c patch-util.c patch-vpdopt.c
Log Message:
optionally use /dev/smbios on all netbsd platforms, if machdep.smbios
exists and is non-zero.
this makes dmidecode by default work on x86 with INSECURE.
bump pkg version.
To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 pkgsrc/sysutils/dmidecode/Makefile
cvs rdiff -u -r1.34 -r1.35 pkgsrc/sysutils/dmidecode/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/dmidecode/patches/patch-biosdecode.c \
pkgsrc/sysutils/dmidecode/patches/patch-dmiopt.c \
pkgsrc/sysutils/dmidecode/patches/patch-ownership.c \
pkgsrc/sysutils/dmidecode/patches/patch-util.c \
pkgsrc/sysutils/dmidecode/patches/patch-vpdopt.c
cvs rdiff -u -r1.1 -r1.2 pkgsrc/sysutils/dmidecode/patches/patch-config.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/sysutils/dmidecode/Makefile
diff -u pkgsrc/sysutils/dmidecode/Makefile:1.38 pkgsrc/sysutils/dmidecode/Makefile:1.39
--- pkgsrc/sysutils/dmidecode/Makefile:1.38 Tue Oct 11 09:12:18 2022
+++ pkgsrc/sysutils/dmidecode/Makefile Mon Nov 28 04:26:08 2022
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.38 2022/10/11 09:12:18 msaitoh Exp $
+# $NetBSD: Makefile,v 1.39 2022/11/28 04:26:08 mrg Exp $
#
DISTNAME= dmidecode-3.4
EXTRACT_SUFX= .tar.xz
CATEGORIES= sysutils
MASTER_SITES= https://download.savannah.gnu.org/releases/dmidecode/
+PKGREVISION= 1
MAINTAINER= msaitoh%NetBSD.org@localhost
HOMEPAGE= https://www.nongnu.org/dmidecode/
Index: pkgsrc/sysutils/dmidecode/distinfo
diff -u pkgsrc/sysutils/dmidecode/distinfo:1.34 pkgsrc/sysutils/dmidecode/distinfo:1.35
--- pkgsrc/sysutils/dmidecode/distinfo:1.34 Tue Oct 11 09:12:18 2022
+++ pkgsrc/sysutils/dmidecode/distinfo Mon Nov 28 04:26:08 2022
@@ -1,8 +1,13 @@
-$NetBSD: distinfo,v 1.34 2022/10/11 09:12:18 msaitoh Exp $
+$NetBSD: distinfo,v 1.35 2022/11/28 04:26:08 mrg Exp $
BLAKE2s (dmidecode-3.4.tar.xz) = 4c77dc57ab99615165128047f803e6bf0844e7f97396a6754da4780d39a620c3
SHA512 (dmidecode-3.4.tar.xz) = 62990b6159e5a7c8688d37e44957e7948391d2c6afeabaa4514ba9dad2d08b020297676e2dbbfcb6471efc6fb6f3682750422931a953f78f358bb3dd3745e95b
Size (dmidecode-3.4.tar.xz) = 61420 bytes
SHA1 (patch-aa) = 4ffeddeb647d07d8d712bab9983c1530e59e6f37
-SHA1 (patch-config.h) = 6ca6459a79ca207ec8b59f0532b2c1db841dc05c
+SHA1 (patch-biosdecode.c) = 76366037a20d7bed2f90771343fbe777ac1e1059
+SHA1 (patch-config.h) = d06c1d45b60e0c687a39b76b4beb007ffa1b4ee4
SHA1 (patch-dmidecode.c) = fe63079df824753a2aca9b9d0371523a36bb08ce
+SHA1 (patch-dmiopt.c) = dd4b990fdf9b5b417459a0a2ddb2e97589605377
+SHA1 (patch-ownership.c) = 4417df76809b187be5c2c3ef691cba2285278df2
+SHA1 (patch-util.c) = d87f60f232e3facbd9aa8fae2e2a2be6bfe4ade5
+SHA1 (patch-vpdopt.c) = 1237207adb8db7aae294153f1bdc27a4e7941737
Index: pkgsrc/sysutils/dmidecode/patches/patch-config.h
diff -u pkgsrc/sysutils/dmidecode/patches/patch-config.h:1.1 pkgsrc/sysutils/dmidecode/patches/patch-config.h:1.2
--- pkgsrc/sysutils/dmidecode/patches/patch-config.h:1.1 Sat Jul 24 13:23:52 2021
+++ pkgsrc/sysutils/dmidecode/patches/patch-config.h Mon Nov 28 04:26:08 2022
@@ -1,15 +1,27 @@
-$NetBSD: patch-config.h,v 1.1 2021/07/24 13:23:52 jmcneill Exp $
+$NetBSD: patch-config.h,v 1.2 2022/11/28 04:26:08 mrg Exp $
-* Use /dev/smbios instead of /dev/mem on NetBSD aarch64
+* Use /dev/smbios instead of /dev/mem on NetBSD if available.
---- config.h.orig 2020-10-14 12:51:11.000000000 +0000
-+++ config.h
+--- config.h.orig 2022-06-27 08:06:32.000000000 -0700
++++ config.h 2022-11-27 14:30:20.312604489 -0800
@@ -8,6 +8,8 @@
/* Default memory device file */
#if defined(__BEOS__) || defined(__HAIKU__)
#define DEFAULT_MEM_DEV "/dev/misc/mem"
-+#elif defined(__NetBSD__) && defined(__aarch64__)
-+#define DEFAULT_MEM_DEV "/dev/smbios"
++#elif defined(__NetBSD__)
++#define USE_DEFAULT_MEM_DEV_FUNC 1
#else
#ifdef __sun
#define DEFAULT_MEM_DEV "/dev/xsvc"
+@@ -16,6 +18,11 @@
+ #endif
+ #endif
+
++#ifdef USE_DEFAULT_MEM_DEV_FUNC
++const char *default_mem_dev(void);
++#define DEFAULT_MEM_DEV default_mem_dev()
++#endif
++
+ /* Use mmap or not */
+ #ifndef __BEOS__
+ #define USE_MMAP
Added files:
Index: pkgsrc/sysutils/dmidecode/patches/patch-biosdecode.c
diff -u /dev/null pkgsrc/sysutils/dmidecode/patches/patch-biosdecode.c:1.1
--- /dev/null Mon Nov 28 04:26:08 2022
+++ pkgsrc/sysutils/dmidecode/patches/patch-biosdecode.c Mon Nov 28 04:26:08 2022
@@ -0,0 +1,21 @@
+$NetBSD: patch-biosdecode.c,v 1.1 2022/11/28 04:26:08 mrg Exp $
+
+* Use /dev/smbios instead of /dev/mem on NetBSD if available.
+
+--- biosdecode.c.orig 2022-06-27 08:06:32.000000000 -0700
++++ biosdecode.c 2022-11-27 14:28:45.654835935 -0800
+@@ -645,12 +645,12 @@
+ static const char *help =
+ "Usage: biosdecode [OPTIONS]\n"
+ "Options are:\n"
+- " -d, --dev-mem FILE Read memory from device FILE (default: " DEFAULT_MEM_DEV ")\n"
++ " -d, --dev-mem FILE Read memory from device FILE (default: %s)\n"
+ " --pir full Decode the details of the PCI IRQ routing table\n"
+ " -h, --help Display this help text and exit\n"
+ " -V, --version Display the version and exit\n";
+
+- printf("%s", help);
++ printf(help, DEFAULT_MEM_DEV);
+ }
+
+ int main(int argc, char * const argv[])
Index: pkgsrc/sysutils/dmidecode/patches/patch-dmiopt.c
diff -u /dev/null pkgsrc/sysutils/dmidecode/patches/patch-dmiopt.c:1.1
--- /dev/null Mon Nov 28 04:26:08 2022
+++ pkgsrc/sysutils/dmidecode/patches/patch-dmiopt.c Mon Nov 28 04:26:08 2022
@@ -0,0 +1,22 @@
+$NetBSD: patch-dmiopt.c,v 1.1 2022/11/28 04:26:08 mrg Exp $
+
+* Use /dev/smbios instead of /dev/mem on NetBSD if available.
+
+--- dmiopt.c.orig 2022-06-27 08:06:32.000000000 -0700
++++ dmiopt.c 2022-11-27 14:28:45.656425673 -0800
+@@ -368,7 +368,7 @@
+ static const char *help =
+ "Usage: dmidecode [OPTIONS]\n"
+ "Options are:\n"
+- " -d, --dev-mem FILE Read memory from device FILE (default: " DEFAULT_MEM_DEV ")\n"
++ " -d, --dev-mem FILE Read memory from device FILE (default: %s)\n"
+ " -h, --help Display this help text and exit\n"
+ " -q, --quiet Less verbose output\n"
+ " -s, --string KEYWORD Only display the value of the given DMI string\n"
+@@ -381,5 +381,5 @@
+ " --oem-string N Only display the value of the given OEM string\n"
+ " -V, --version Display the version and exit\n";
+
+- printf("%s", help);
++ printf(help, DEFAULT_MEM_DEV);
+ }
Index: pkgsrc/sysutils/dmidecode/patches/patch-ownership.c
diff -u /dev/null pkgsrc/sysutils/dmidecode/patches/patch-ownership.c:1.1
--- /dev/null Mon Nov 28 04:26:08 2022
+++ pkgsrc/sysutils/dmidecode/patches/patch-ownership.c Mon Nov 28 04:26:08 2022
@@ -0,0 +1,20 @@
+$NetBSD: patch-ownership.c,v 1.1 2022/11/28 04:26:08 mrg Exp $
+
+* Use /dev/smbios instead of /dev/mem on NetBSD if available.
+
+--- ownership.c.orig 2022-06-27 08:06:32.000000000 -0700
++++ ownership.c 2022-11-27 14:28:45.655641133 -0800
+@@ -146,11 +146,11 @@
+ static const char *help =
+ "Usage: ownership [OPTIONS]\n"
+ "Options are:\n"
+- " -d, --dev-mem FILE Read memory from device FILE (default: " DEFAULT_MEM_DEV ")\n"
++ " -d, --dev-mem FILE Read memory from device FILE (default: %s)\n"
+ " -h, --help Display this help text and exit\n"
+ " -V, --version Display the version and exit\n";
+
+- printf("%s", help);
++ printf(help, DEFAULT_MEM_DEV);
+ }
+
+ int main(int argc, char * const argv[])
Index: pkgsrc/sysutils/dmidecode/patches/patch-util.c
diff -u /dev/null pkgsrc/sysutils/dmidecode/patches/patch-util.c:1.1
--- /dev/null Mon Nov 28 04:26:08 2022
+++ pkgsrc/sysutils/dmidecode/patches/patch-util.c Mon Nov 28 04:26:08 2022
@@ -0,0 +1,45 @@
+$NetBSD: patch-util.c,v 1.1 2022/11/28 04:26:08 mrg Exp $
+
+* Use /dev/smbios instead of /dev/mem on NetBSD if available.
+
+--- util.c.orig 2022-06-27 08:06:32.000000000 -0700
++++ util.c 2022-11-27 14:28:45.657997798 -0800
+@@ -36,6 +36,9 @@
+ #define MAP_FAILED ((void *) -1)
+ #endif /* !MAP_FAILED */
+ #endif /* USE MMAP */
++#ifdef __NetBSD__
++#include <sys/sysctl.h>
++#endif
+
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -314,3 +317,28 @@
+
+ return res;
+ }
++
++#ifdef USE_DEFAULT_MEM_DEV_FUNC
++const char *
++default_mem_dev(void)
++{
++#ifdef __NetBSD__
++ uint64_t addr;
++ size_t addrlen = sizeof addr;
++ int ret;
++
++ /*
++ * If machdep.smbios exists and has a non-zero value, /dev/smbios
++ * should work. Otherwise fallback to /dev/mem.
++ */
++ ret = sysctlbyname("machdep.smbios", &addr, &addrlen, NULL, 0);
++ if (ret == 0 && addr != 0) {
++ return "/dev/smbios";
++ } else {
++ return "/dev/mem";
++ }
++#else
++# error "not implemented."
++#endif
++}
++#endif
Index: pkgsrc/sysutils/dmidecode/patches/patch-vpdopt.c
diff -u /dev/null pkgsrc/sysutils/dmidecode/patches/patch-vpdopt.c:1.1
--- /dev/null Mon Nov 28 04:26:08 2022
+++ pkgsrc/sysutils/dmidecode/patches/patch-vpdopt.c Mon Nov 28 04:26:08 2022
@@ -0,0 +1,20 @@
+$NetBSD: patch-vpdopt.c,v 1.1 2022/11/28 04:26:08 mrg Exp $
+
+* Use /dev/smbios instead of /dev/mem on NetBSD if available.
+
+--- vpdopt.c.orig 2022-06-27 08:06:32.000000000 -0700
++++ vpdopt.c 2022-11-27 14:28:45.657210082 -0800
+@@ -147,11 +147,11 @@
+ static const char *help =
+ "Usage: vpddecode [OPTIONS]\n"
+ "Options are:\n"
+- " -d, --dev-mem FILE Read memory from device FILE (default: " DEFAULT_MEM_DEV ")\n"
++ " -d, --dev-mem FILE Read memory from device FILE (default: %s)\n"
+ " -h, --help Display this help text and exit\n"
+ " -s, --string KEYWORD Only display the value of the given VPD string\n"
+ " -u, --dump Do not decode the VPD records\n"
+ " -V, --version Display the version and exit\n";
+
+- printf("%s", help);
++ printf(help, DEFAULT_MEM_DEV);
+ }
Home |
Main Index |
Thread Index |
Old Index