pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/smartmontools smartmontools: fix 6.6 -> 7.0 N...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7bdb532a8224
branches:  trunk
changeset: 317978:7bdb532a8224
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Fri Jan 18 02:04:43 2019 +0000

description:
smartmontools: fix 6.6 -> 7.0 NVMe SMART data readout regression. Bump.

diffstat:

 sysutils/smartmontools/Makefile                   |   6 +++-
 sysutils/smartmontools/distinfo                   |   3 +-
 sysutils/smartmontools/patches/patch-nvmecmds.cpp |  34 +++++++++++++++++++++++
 3 files changed, 41 insertions(+), 2 deletions(-)

diffs (72 lines):

diff -r 62649dc289b2 -r 7bdb532a8224 sysutils/smartmontools/Makefile
--- a/sysutils/smartmontools/Makefile   Fri Jan 18 00:28:55 2019 +0000
+++ b/sysutils/smartmontools/Makefile   Fri Jan 18 02:04:43 2019 +0000
@@ -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 @@
 
 INSTALLATION_DIRS=     ${EGDIR}
 
+CFLAGS+=-O0 -ggdb -g3
+CXXFLAGS+=-O0 -ggdb -g3
+
 .include "../../mk/bsd.pkg.mk"
diff -r 62649dc289b2 -r 7bdb532a8224 sysutils/smartmontools/distinfo
--- a/sysutils/smartmontools/distinfo   Fri Jan 18 00:28:55 2019 +0000
+++ b/sysutils/smartmontools/distinfo   Fri Jan 18 02:04:43 2019 +0000
@@ -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 @@
 Size (smartmontools-7.0.tar.gz) = 944925 bytes
 SHA1 (patch-aa) = bd08aff267f0e9e9307ebc57858e61e35144bf16
 SHA1 (patch-ag) = 01b0b35d89d6d6a11b13b3c05a141c46a0c1590b
+SHA1 (patch-nvmecmds.cpp) = 0fec043f00b4a7fde2974e1a4670ce42343f2d52
diff -r 62649dc289b2 -r 7bdb532a8224 sysutils/smartmontools/patches/patch-nvmecmds.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/smartmontools/patches/patch-nvmecmds.cpp Fri Jan 18 02:04:43 2019 +0000
@@ -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()) {



Home | Main Index | Thread Index | Old Index