pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: [pkgsrc-2018Q2] pkgsrc/sysutils/smartmontools
Module Name: pkgsrc
Committed By: bsiegert
Date: Sat Aug 18 10:34:16 UTC 2018
Modified Files:
pkgsrc/sysutils/smartmontools [pkgsrc-2018Q2]: Makefile distinfo
pkgsrc/sysutils/smartmontools/patches [pkgsrc-2018Q2]:
patch-os_netbsd.cpp
Log Message:
Pullup ticket #5808 - requested by sevan
sysutils/smartmontools: NetBSD build fix
Revisions pulled up:
- sysutils/smartmontools/Makefile 1.32
- sysutils/smartmontools/distinfo 1.31
- sysutils/smartmontools/patches/patch-os_netbsd.cpp 1.2
---
Module Name: pkgsrc
Committed By: sevan
Date: Sat Aug 4 19:05:13 UTC 2018
Modified Files:
pkgsrc/sysutils/smartmontools: Makefile distinfo
pkgsrc/sysutils/smartmontools/patches: patch-os_netbsd.cpp
Log Message:
Backport fix for NetBSD on bigendian systems
https://www.smartmontools.org/ticket/943
https://www.smartmontools.org/changeset/4628
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.6.1 pkgsrc/sysutils/smartmontools/Makefile \
pkgsrc/sysutils/smartmontools/distinfo
cvs rdiff -u -r1.1 -r1.1.6.1 \
pkgsrc/sysutils/smartmontools/patches/patch-os_netbsd.cpp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/sysutils/smartmontools/Makefile
diff -u pkgsrc/sysutils/smartmontools/Makefile:1.30 pkgsrc/sysutils/smartmontools/Makefile:1.30.6.1
--- pkgsrc/sysutils/smartmontools/Makefile:1.30 Fri Dec 15 03:02:10 2017
+++ pkgsrc/sysutils/smartmontools/Makefile Sat Aug 18 10:34:16 2018
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.30 2017/12/15 03:02:10 nonaka Exp $
+# $NetBSD: Makefile,v 1.30.6.1 2018/08/18 10:34:16 bsiegert Exp $
DISTNAME= smartmontools-6.6
+PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=smartmontools/}
Index: pkgsrc/sysutils/smartmontools/distinfo
diff -u pkgsrc/sysutils/smartmontools/distinfo:1.30 pkgsrc/sysutils/smartmontools/distinfo:1.30.6.1
--- pkgsrc/sysutils/smartmontools/distinfo:1.30 Fri Dec 15 11:38:26 2017
+++ pkgsrc/sysutils/smartmontools/distinfo Sat Aug 18 10:34:16 2018
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.30 2017/12/15 11:38:26 hauke Exp $
+$NetBSD: distinfo,v 1.30.6.1 2018/08/18 10:34:16 bsiegert Exp $
SHA1 (smartmontools-6.6.tar.gz) = 8946f6350d6df9341d571381d66ffbb7d83b8af2
RMD160 (smartmontools-6.6.tar.gz) = 8504a7a04e99d26acb3662ae5e0e8e6d38a52b5d
@@ -6,4 +6,4 @@ SHA512 (smartmontools-6.6.tar.gz) = 64bb
Size (smartmontools-6.6.tar.gz) = 903847 bytes
SHA1 (patch-aa) = bd08aff267f0e9e9307ebc57858e61e35144bf16
SHA1 (patch-ag) = 01b0b35d89d6d6a11b13b3c05a141c46a0c1590b
-SHA1 (patch-os_netbsd.cpp) = 8402fe8bf5e5af2c262e4b159ff3799814d6963a
+SHA1 (patch-os_netbsd.cpp) = 70a5fcfbdced36203b2b07b3496cddf915ef8938
Index: pkgsrc/sysutils/smartmontools/patches/patch-os_netbsd.cpp
diff -u pkgsrc/sysutils/smartmontools/patches/patch-os_netbsd.cpp:1.1 pkgsrc/sysutils/smartmontools/patches/patch-os_netbsd.cpp:1.1.6.1
--- pkgsrc/sysutils/smartmontools/patches/patch-os_netbsd.cpp:1.1 Fri Dec 15 11:38:26 2017
+++ pkgsrc/sysutils/smartmontools/patches/patch-os_netbsd.cpp Sat Aug 18 10:34:16 2018
@@ -1,6 +1,9 @@
-$NetBSD: patch-os_netbsd.cpp,v 1.1 2017/12/15 11:38:26 hauke Exp $
+$NetBSD: patch-os_netbsd.cpp,v 1.1.6.1 2018/08/18 10:34:16 bsiegert Exp $
Missing #include
+Backport fix for NetBSD on bigendian systems
+https://www.smartmontools.org/ticket/943
+https://www.smartmontools.org/changeset/4628
--- os_netbsd.cpp.orig 2017-08-08 19:38:15.000000000 +0000
+++ os_netbsd.cpp
@@ -12,3 +15,99 @@ Missing #include
#include <errno.h>
#include <unistd.h>
+@@ -206,7 +207,7 @@ bool netbsd_ata_device::ata_pass_through
+ req.sec_count = in.in_regs.sector_count;
+ req.sec_num = in.in_regs.lba_low;
+ req.head = in.in_regs.device;
+- req.cylinder = le16toh(in.in_regs.lba_mid | (in.in_regs.lba_high << 8));
++ req.cylinder = in.in_regs.lba_mid | (in.in_regs.lba_high << 8);
+
+ switch (in.direction) {
+ case ata_cmd_in::no_data:
+@@ -237,41 +238,10 @@ bool netbsd_ata_device::ata_pass_through
+ out.out_regs.sector_count = req.sec_count;
+ out.out_regs.lba_low = req.sec_num;
+ out.out_regs.device = req.head;
+- out.out_regs.lba_mid = le16toh(req.cylinder);
+- out.out_regs.lba_high = le16toh(req.cylinder) >> 8;
++ out.out_regs.lba_mid = req.cylinder;
++ out.out_regs.lba_high = req.cylinder >> 8;
+ out.out_regs.status = req.command;
+
+- // Command specific processing
+- if (in.in_regs.command == ATA_SMART_CMD
+- && in.in_regs.features == ATA_SMART_STATUS
+- && in.out_needed.lba_high)
+- {
+- unsigned const char normal_lo=0x4f, normal_hi=0xc2;
+- unsigned const char failed_lo=0xf4, failed_hi=0x2c;
+-
+- // Cyl low and Cyl high unchanged means "Good SMART status"
+- if (!(out.out_regs.lba_mid==normal_lo && out.out_regs.lba_high==normal_hi)
+- // These values mean "Bad SMART status"
+- && !(out.out_regs.lba_mid==failed_lo && out.out_regs.lba_high==failed_hi))
+-
+- {
+- // We haven't gotten output that makes sense; print out some debugging info
+- char buf[512];
+- snprintf(buf, sizeof(buf),
+- "CMD=0x%02x\nFR =0x%02x\nNS =0x%02x\nSC =0x%02x\nCL =0x%02x\nCH =0x%02x\nRETURN =0x%04x\n",
+- (int)req.command,
+- (int)req.features,
+- (int)req.sec_count,
+- (int)req.sec_num,
+- (int)(le16toh(req.cylinder) & 0xff),
+- (int)((le16toh(req.cylinder) >> 8) & 0xff),
+- (int)req.error);
+- printwarning(BAD_SMART,buf);
+- out.out_regs.lba_high = failed_hi;
+- out.out_regs.lba_mid = failed_lo;
+- }
+- }
+-
+ return true;
+ }
+
+@@ -834,24 +804,29 @@ smart_device * netbsd_smart_interface::a
+ }
+ }
+
+- if (str_starts_with(test_name, net_dev_raw_prefix)) {
++ if (str_starts_with(test_name, net_dev_raw_prefix))
+ test_name += strlen(net_dev_raw_prefix);
+- if (!strncmp(net_dev_ata_disk, test_name, strlen(net_dev_ata_disk)))
+- return get_ata_device(test_name, "ata");
+- if (!strncmp(net_dev_scsi_disk, test_name, strlen(net_dev_scsi_disk))) {
++ else if (str_starts_with(test_name, net_dev_prefix))
++ test_name += strlen(net_dev_prefix);
++ else
++ return 0; // device is not starting with /dev/ or /dev/r*
++
++ if (!strncmp(net_dev_ata_disk, test_name, strlen(net_dev_ata_disk)))
++ return get_ata_device(name, "ata");
++
++ if (!strncmp(net_dev_scsi_disk, test_name, strlen(net_dev_scsi_disk))) {
+ // XXX Try to detect possible USB->(S)ATA bridge
+ // XXX get USB vendor ID, product ID and version from sd(4)/umass(4).
+ // XXX check sat device via get_usb_dev_type_by_id().
+-
+ // No USB bridge found, assume regular SCSI device
+- return get_scsi_device(test_name, "scsi");
+- }
+- if (!strncmp(net_dev_scsi_tape, test_name, strlen(net_dev_scsi_tape)))
+- return get_scsi_device(test_name, "scsi");
+- } else if (str_starts_with(test_name, net_dev_prefix)) {
+- if (!strncmp(NVME_PREFIX, test_name, strlen(NVME_PREFIX)))
+- return get_nvme_device(test_name, "nvme", 0 /* use default nsid */);
+- }
++ return get_scsi_device(name, "scsi");
++ }
++
++ if (!strncmp(net_dev_scsi_tape, test_name, strlen(net_dev_scsi_tape)))
++ return get_scsi_device(name, "scsi");
++
++ if (!strncmp(net_dev_nvme_ctrl, test_name, strlen(net_dev_nvme_ctrl)))
++ return get_nvme_device(name, "nvme", 0 /* use default nsid */);
+
+ // device type unknown
+ return 0;
Home |
Main Index |
Thread Index |
Old Index