summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysutils/smartmontools/Makefile6
-rw-r--r--sysutils/smartmontools/distinfo3
-rw-r--r--sysutils/smartmontools/patches/patch-nvmecmds.cpp34
3 files changed, 41 insertions, 2 deletions
diff --git a/sysutils/smartmontools/Makefile b/sysutils/smartmontools/Makefile
index 84412614d79..2e3b4402bb4 100644
--- a/sysutils/smartmontools/Makefile
+++ b/sysutils/smartmontools/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.33 2019/01/18 00:28:24 tnn Exp $
+# $NetBSD: Makefile,v 1.34 2019/01/18 02:04:43 tnn Exp $
DISTNAME= smartmontools-7.0
+PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=smartmontools/}
@@ -31,4 +32,7 @@ INSTALL_MAKE_FLAGS= ${MAKE_FLAGS} sysconfdir=${EGDIR}
INSTALLATION_DIRS= ${EGDIR}
+CFLAGS+=-O0 -ggdb -g3
+CXXFLAGS+=-O0 -ggdb -g3
+
.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/smartmontools/distinfo b/sysutils/smartmontools/distinfo
index ee4dd9e156b..8c282763d8a 100644
--- a/sysutils/smartmontools/distinfo
+++ b/sysutils/smartmontools/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.32 2019/01/18 00:28:24 tnn Exp $
+$NetBSD: distinfo,v 1.33 2019/01/18 02:04:43 tnn Exp $
SHA1 (smartmontools-7.0.tar.gz) = 00e6a7bb26b283695ab0deaf521be6723ba44f0a
RMD160 (smartmontools-7.0.tar.gz) = db20533115aa05a52836dbef0006c664083fbe90
@@ -6,3 +6,4 @@ SHA512 (smartmontools-7.0.tar.gz) = 96e18a201182579f699d541539ce393e7bc2191e027c
Size (smartmontools-7.0.tar.gz) = 944925 bytes
SHA1 (patch-aa) = bd08aff267f0e9e9307ebc57858e61e35144bf16
SHA1 (patch-ag) = 01b0b35d89d6d6a11b13b3c05a141c46a0c1590b
+SHA1 (patch-nvmecmds.cpp) = 0fec043f00b4a7fde2974e1a4670ce42343f2d52
diff --git a/sysutils/smartmontools/patches/patch-nvmecmds.cpp b/sysutils/smartmontools/patches/patch-nvmecmds.cpp
new file mode 100644
index 00000000000..77d5f1cd226
--- /dev/null
+++ b/sysutils/smartmontools/patches/patch-nvmecmds.cpp
@@ -0,0 +1,34 @@
+$NetBSD: patch-nvmecmds.cpp,v 1.1 2019/01/18 02:04:43 tnn Exp $
+
+It looks from the code like it is supposed to work to read the SMART data
+by calling the nvme passthrough ioctl with broadcast nsid.
+But it doesn't seem to work on NetBSD? So use the explicit nsid instead.
+
+--- nvmecmds.cpp.orig 2018-08-19 18:45:53.000000000 +0000
++++ nvmecmds.cpp
+@@ -207,7 +207,11 @@ bool nvme_read_log_page(nvme_device * de
+ // Read NVMe Error Information Log.
+ bool nvme_read_error_log(nvme_device * device, nvme_error_log_page * error_log, unsigned num_entries)
+ {
+- if (!nvme_read_log_page(device, 0x01, error_log, num_entries * sizeof(*error_log), true))
++ bool use_broadcast_nsid = true;
++#if defined(__NetBSD__)
++ use_broadcast_nsid = false;
++#endif
++ if (!nvme_read_log_page(device, 0x01, error_log, num_entries * sizeof(*error_log), use_broadcast_nsid))
+ return false;
+
+ if (isbigendian()) {
+@@ -228,7 +232,11 @@ bool nvme_read_error_log(nvme_device * d
+ // Read NVMe SMART/Health Information log.
+ bool nvme_read_smart_log(nvme_device * device, nvme_smart_log & smart_log)
+ {
+- if (!nvme_read_log_page(device, 0x02, &smart_log, sizeof(smart_log), true))
++ bool use_broadcast_nsid = true;
++#if defined(__NetBSD__)
++ use_broadcast_nsid = false;
++#endif
++ if (!nvme_read_log_page(device, 0x02, &smart_log, sizeof(smart_log), use_broadcast_nsid))
+ return false;
+
+ if (isbigendian()) {