Am Wed, Apr 07, 2021 at 10:59:26AM +0200 schrieb Martin Ziemer: > This patch updates smartmontools from 7.1p0 to 7.2. > > There are three changes imported from upstream to get smartmontools > work on all my systems. > > Tested on four amd64 systems using sata or pata. > > Could not test using real scsi drives.
Index: Makefile =================================================================== RCS file: /cvs/ports/sysutils/smartmontools/Makefile,v retrieving revision 1.44 diff -u -p -r1.44 Makefile --- Makefile 1 Sep 2020 15:46:04 -0000 1.44 +++ Makefile 7 Apr 2021 08:28:20 -0000 @@ -3,8 +3,7 @@ COMMENT= control and monitor storage systems using SMART # XXX at update time check whether C++11 is actually needed -DISTNAME= smartmontools-7.1 -REVISION= 0 +DISTNAME= smartmontools-7.2 CATEGORIES= sysutils HOMEPAGE= https://www.smartmontools.org/ Index: distinfo =================================================================== RCS file: /cvs/ports/sysutils/smartmontools/distinfo,v retrieving revision 1.19 diff -u -p -r1.19 distinfo --- distinfo 19 Feb 2020 17:46:52 -0000 1.19 +++ distinfo 7 Apr 2021 08:28:20 -0000 @@ -1,2 +1,2 @@ -SHA256 (smartmontools-7.1.tar.gz) = P3NNLJneseSvYrJdlExiUt5wymTXZsTHKUVFouZZuEY= -SIZE (smartmontools-7.1.tar.gz) = 971468 +SHA256 (smartmontools-7.2.tar.gz) = XNmKJ+Y5MWi8aq6gcNnhzVUbD4mMUvZrL/Ll0nQRjNY= +SIZE (smartmontools-7.2.tar.gz) = 992256 Index: patches/patch-os-openbsd_cpp =================================================================== RCS file: patches/patch-os-openbsd_cpp diff -N patches/patch-os-openbsd_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-os-openbsd_cpp 7 Apr 2021 08:28:20 -0000 @@ -0,0 +1,38 @@ +$OpenBSD $ + +Upstream r5213: Use correct devicename for autodetection +Upstream r5214: Apply conversion to seconds for timeouts in scsi_pass_through +Upstream r5215: fix SAT autodetection for the sd* devices + +--- os_openbsd.cpp Tue Oct 6 17:31:47 2020 ++++ os_openbsd.cpp.patched Wed Apr 7 09:39:24 2021 +@@ -266,7 +266,7 @@ bool openbsd_scsi_device::scsi_pass_through(scsi_cmnd_ + sc.databuf = (char *)iop->dxferp; + sc.datalen = iop->dxfer_len; + sc.senselen = iop->max_sense_len; +- sc.timeout = iop->timeout == 0 ? 60000 : iop->timeout; /* XXX */ ++ sc.timeout = (iop->timeout == 0 ? 60 : iop->timeout) * 1000; + sc.flags = + (iop->dxfer_dir == DXFER_NONE ? SCCMD_READ : + (iop->dxfer_dir == DXFER_FROM_DEVICE ? SCCMD_READ : SCCMD_WRITE)); +@@ -582,17 +582,17 @@ smart_device * openbsd_smart_interface::autodetect_sma + if (str_starts_with(test_name, net_dev_prefix)) { + test_name += strlen(net_dev_prefix); + if (!strncmp(net_dev_ata_disk, test_name, strlen(net_dev_ata_disk))) +- return get_ata_device(test_name, "ata"); ++ 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"); ++ return get_scsi_device(name, ""); + } + if (!strncmp(net_dev_scsi_tape, test_name, strlen(net_dev_scsi_tape))) +- return get_scsi_device(test_name, "scsi"); ++ return get_scsi_device(name, "scsi"); + } + // device type unknown + return 0; Index: patches/patch-scsiata_cpp =================================================================== RCS file: patches/patch-scsiata_cpp diff -N patches/patch-scsiata_cpp --- patches/patch-scsiata_cpp 1 Sep 2020 15:46:04 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -$OpenBSD $ - -Add missing seconds to milliseconds conversion, hand picked from upstream -9c2f3a38063c4c6837507373c4dc4c9b1e3e7e81 from 05.06.2020. - ---- scsiata.cpp.orig Wed Dec 5 19:30:46 2018 -+++ scsiata.cpp Tue Sep 1 08:48:16 2020 -@@ -364,7 +364,7 @@ bool sat_device::ata_pass_through(const ata_cmd_in & i - io_hdr.cmnd_len = passthru_size; - io_hdr.sensep = sense; - io_hdr.max_sense_len = sizeof(sense); -- io_hdr.timeout = SCSI_TIMEOUT_DEFAULT; -+ io_hdr.timeout = SCSI_TIMEOUT_DEFAULT * 1000; - - scsi_device * scsidev = get_tunnel_dev(); - if (!scsidev->scsi_pass_through(&io_hdr)) {