head 1.3; access; symbols pkgsrc-2018Q4:1.2.0.4 pkgsrc-2018Q4-base:1.2 pkgsrc-2018Q3:1.2.0.2 pkgsrc-2018Q3-base:1.2 pkgsrc-2018Q2:1.1.0.6 pkgsrc-2018Q2-base:1.1 pkgsrc-2018Q1:1.1.0.4 pkgsrc-2018Q1-base:1.1 pkgsrc-2017Q4:1.1.0.2 pkgsrc-2017Q4-base:1.1; locks; strict; comment @// @; 1.3 date 2019.01.18.00.28.24; author tnn; state dead; branches; next 1.2; commitid h5Rmi7OzhLYJkc8B; 1.2 date 2018.08.04.19.05.13; author sevan; state Exp; branches; next 1.1; commitid QUbDdcCbvfthSPMA; 1.1 date 2017.12.15.11.38.26; author hauke; state Exp; branches 1.1.6.1; next ; commitid SQhLos5c7M3SRYiA; 1.1.6.1 date 2018.08.18.10.34.16; author bsiegert; state Exp; branches; next ; commitid Zw3uV8H1VxuHBAOA; desc @@ 1.3 log @smartmontools: update to 7.0 Date 2018-12-30 Summary: smartmontools release 7.0 ----------------------------------------------------------- - smartctl: New options '-j' and '--json[=giosu]' to enable experimental JSON output mode. Also supports an alternative flat format suitable for grep ('--json=g'). - smartctl '-l devstat': Fix for logs with 256 sectors. - smartctl '-l error': Prints SCSI Pending Defects log page if supported. - smartctl '-H': Prints SCSI Format Status log page if supported. - smartctl '-x': Now includes '-l defects'. - NVMe/USB: Device type '-d sntjmicron' for NVMe drives behind JMicron USB to NVMe bridges. - NVMe: SMART/Health Information and Error Information are always read with broadcast NSID. - SCSI: Various improvements for the decoding of log pages. - SCSI: Improved handling of READ CAPACITY command. - SCSI: Support for SAS host managed drives. - New option '-d scsi+TYPE' to disable SAT auto detection for 'aacraid' and 'cciss'. - update-smart-drivedb: New option '-u github'. - update-smart-drivedb: New signing key. - configure: New options '--with-cxx11-regex' and '--with-libsystemd'. - configure: Default for '--with-nvme-devicescan' is now 'yes' on Linux and Windows. - configure: Default for '--with-scriptpath' now includes '/usr/local/bin'. - configure: Options '-with-initscriptdir=[auto|yes]' are no longer supported. - Reworked handling of unaligned LE and BE integers. - Dropped various backward compatibility fixes for very old compilers. - Replaced GPL header with 'SPDX-License-Identifier' in all source files. - HDD, SSD and USB additions to drive database. - Always use '-d sat' for USB vendor IDs with known SAT support. - Linux: Device scan with '-d by-id' scans '/dev/disk/by-id/*' symlinks. - Linux: Dropped device scan support for devfs. - Linux: Fixed device scan with multiple '-d TYPE' options. - Linux: Fixed device scan crash on missing '/proc/devices'. - Linux: USB ID detection also for '/dev/sgN'. - Linux: Compile fix for systems with musl libc. - Linux smartd: Could now run as systemd service with 'Type=notify' set. - FreeBSD: NVMe device scanning. - FreeBSD: Various compile fixes. - NetBSD: Fixed regression in name based device type detection. - NetBSD big endian: Fixed regression in ATA code. - NetBSD big endian: Fixed byte ordering of ATA IDENTIFY data from USB/SAT drives. - Windows: Improved search for actual CSMI port number. - Windows: Installer includes VERSIONINFO resource. @ text @$NetBSD: patch-os_netbsd.cpp,v 1.2 2018/08/04 19:05:13 sevan 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 @@@@ -26,6 +26,7 @@@@ #include #include +#include #include #include @@@@ -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; @ 1.2 log @Backport fix for NetBSD on bigendian systems https://www.smartmontools.org/ticket/943 https://www.smartmontools.org/changeset/4628 @ text @d1 1 a1 1 $NetBSD$ @ 1.1 log @Unbreak package after upgrade. @ text @d4 3 d18 96 @ 1.1.6.1 log @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 @ text @a3 3 Backport fix for NetBSD on bigendian systems https://www.smartmontools.org/ticket/943 https://www.smartmontools.org/changeset/4628 a14 96 @@@@ -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; @