diff options
Diffstat (limited to 'sysutils/smartmontools-devel')
-rw-r--r-- | sysutils/smartmontools-devel/Makefile | 47 | ||||
-rw-r--r-- | sysutils/smartmontools-devel/distinfo | 3 | ||||
-rw-r--r-- | sysutils/smartmontools-devel/files/ciss-patch | 109 | ||||
-rw-r--r-- | sysutils/smartmontools-devel/files/ciss_common.c | 197 | ||||
-rw-r--r-- | sysutils/smartmontools-devel/files/patch-knowndrives.cpp | 14 | ||||
-rw-r--r-- | sysutils/smartmontools-devel/files/patch-os__freebsd.cpp | 31 | ||||
-rw-r--r-- | sysutils/smartmontools-devel/files/pkg-message.in | 14 | ||||
-rw-r--r-- | sysutils/smartmontools-devel/files/smartd.in | 44 | ||||
-rw-r--r-- | sysutils/smartmontools-devel/pkg-descr | 7 | ||||
-rw-r--r-- | sysutils/smartmontools-devel/pkg-plist | 22 |
10 files changed, 0 insertions, 488 deletions
diff --git a/sysutils/smartmontools-devel/Makefile b/sysutils/smartmontools-devel/Makefile deleted file mode 100644 index d5a5ee4525a9..000000000000 --- a/sysutils/smartmontools-devel/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -# New ports collection makefile for: smartmontools -# Date created: 12 October 2003 -# Whom: Eduard Martinescu -# -# $FreeBSD$ -# - -PORTNAME= smartmontools -PORTVERSION= 5.37 -PORTREVISION= 2 -CATEGORIES= sysutils -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} -MASTER_SITE_SUBDIR= ${PORTNAME} - -MAINTAINER= pav@FreeBSD.org -COMMENT= S.M.A.R.T. disk monitoring tools - -USE_GMAKE= yes -GNU_CONFIGURE= yes -CONFIGURE_ARGS= --with-docdir=${DOCSDIR} --enable-sample -CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} - -SUB_FILES= pkg-message -USE_RC_SUBR= smartd - -MAN5= smartd.conf.5 -MAN8= smartd.8 smartctl.8 - -OPTIONS= CISS "Support ciss(4) -- requires kernel source tree" off - -.include <bsd.port.pre.mk> - -.if defined(WITH_CISS) -. if !exists(/sys/dev/ciss/cissio.h) -IGNORE= built WITH_CISS requires /sys/dev/ciss/cissio.h -. endif -CFLAGS+= -I/sys/dev/ciss -I${FILESDIR} -EXTRA_PATCHES= ${FILESDIR}/ciss-patch -.endif - -post-patch: - @${REINPLACE_CMD} -e 's| install-initdDATA | |' ${WRKSRC}/Makefile.in - -post-install: - @${CAT} ${PKGMESSAGE} - -.include <bsd.port.post.mk> diff --git a/sysutils/smartmontools-devel/distinfo b/sysutils/smartmontools-devel/distinfo deleted file mode 100644 index 7b927a1c4ff0..000000000000 --- a/sysutils/smartmontools-devel/distinfo +++ /dev/null @@ -1,3 +0,0 @@ -MD5 (smartmontools-5.37.tar.gz) = 4ab3668b7d1362ce923f64a211e0e568 -SHA256 (smartmontools-5.37.tar.gz) = 2984645b207c52ea9b8ef3951af8bd0c5aab469607fabf63ade05f8fe87309c1 -SIZE (smartmontools-5.37.tar.gz) = 590605 diff --git a/sysutils/smartmontools-devel/files/ciss-patch b/sysutils/smartmontools-devel/files/ciss-patch deleted file mode 100644 index e83a7583eed8..000000000000 --- a/sysutils/smartmontools-devel/files/ciss-patch +++ /dev/null @@ -1,109 +0,0 @@ ---- os_freebsd.cpp Sat Sep 16 23:17:53 2006 -+++ os_freebsd.cpp Sat Mar 3 05:00:36 2007 -@@ -38,4 +39,5 @@ - #include "utility.h" - #include "os_freebsd.h" -+#include "extern.h" - - static const char *filenameandversion="$Id: os_freebsd.cpp,v 1.51 2006/09/17 03:17:53 dpgilbert Exp $"; -@@ -47,4 +49,7 @@ - extern int exitstatus; - -+/* for passing global control variables */ -+extern smartmonctrl *con; -+ - // Private table of open devices: guaranteed zero on startup since - // part of static data. -@@ -86,8 +91,11 @@ - - // Like open(). Return positive integer handle, used by functions below only. mode=="ATA" or "SCSI". --int deviceopen (const char* dev, char* mode __unused) { -+int deviceopen (const char* dev, char* mode) { - struct freebsd_dev_channel *fdchan; - int parse_ok, i; - -+ if (strcasecmp(mode, "CCISS") == 0) -+ return open(dev, O_RDONLY); -+ - // Search table for a free entry - for (i=0; i<FREEBSD_MAXDEV; i++) -@@ -440,5 +453,6 @@ - - // Interface to SCSI devices. See os_linux.c --int do_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report) -+static int -+do_normal_scsi_cmnd_io(int fd, struct scsi_cmnd_io * iop, int report) - { - struct freebsd_dev_channel* con = NULL; -@@ -541,4 +555,21 @@ - } - -+#include "ciss_common.c" -+ -+int do_scsi_cmnd_io(int dev_fd, struct scsi_cmnd_io * iop, int report) -+{ -+ switch(con->controller_type) -+ { -+ case CONTROLLER_CCISS: -+ return cciss_io_interface(dev_fd, con->controller_port-1, iop, report); -+ // not reached -+ break; -+ default: -+ return do_normal_scsi_cmnd_io(dev_fd, iop, report); -+ // not reached -+ break; -+ } -+} -+ - // Interface to ATA devices behind 3ware escalade RAID controller cards. See os_linux.c - -@@ -871,6 +902,7 @@ - static const char * fbsd_dev_scsi_tape3 = "esa"; - static const char * fbsd_dev_twe_ctrl = "twe"; - static const char * fbsd_dev_twa_ctrl = "twa"; -+static const char * fbsd_dev_ciss_ctrl = "ciss"; - - static int parse_ata_chan_dev(const char * dev_name, struct freebsd_dev_channel *chan) { - int len; -@@ -953,4 +985,13 @@ - } - return CONTROLLER_3WARE_678K_CHAR; -+ } -+ // form /dev/esa* or esa* -+ if (!strncmp(fbsd_dev_ciss_ctrl, dev_name, -+ strlen(fbsd_dev_ciss_ctrl))) { -+ // This is of dubious value, as the desired disk's (unit's) number -+ // still must be specified explicitly with the `-d' option -+ warnx("Use the `-d' option to access drives behind %s. " -+ "See smartctl(8) manual page.", dev_name); -+ return CONTROLLER_CCISS; - } - ---- smartctl.8.in Wed Dec 20 02:30:43 2006 -+++ smartctl.8.in Sat Mar 3 05:22:28 2007 -@@ -303,5 +303,5 @@ - .B HighPoint RocketRAID controllers are currently ONLY supported under Linux. - --.B cciss controllers are currently ONLY supported under Linux. -+.B cciss controllers are currently ONLY supported under Linux and FreeBSD. - - .TP -@@ -1257,7 +1257,7 @@ - .PP - .nf --.B smartctl \-a \-d cciss,0 /dev/cciss/c0d0 -+.B smartctl \-a \-d cciss,0 /dev/ciss0 - .fi --Examine all SMART data for the first SCSI disk connected to a cciss -+Examine all SMART data for the first SCSI disk connected to the first ciss - RAID controller card. - .PP ---- smartd.8.in Wed Dec 20 02:30:43 2006 -+++ smartd.8.in Sat Mar 3 05:24:51 2007 -@@ -717,5 +717,5 @@ - with XX in the range from 00 to 15 inclusive. - --.B 3ware and cciss controllers are currently ONLY supported under Linux. -+.B 3ware and cciss controllers are currently ONLY supported under Linux and FreeBSD. - - .I hpt,L/M/N diff --git a/sysutils/smartmontools-devel/files/ciss_common.c b/sysutils/smartmontools-devel/files/ciss_common.c deleted file mode 100644 index 80dfaf812cf0..000000000000 --- a/sysutils/smartmontools-devel/files/ciss_common.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * This bits are ripped almost verbatim from os_linux.cpp to allow - * FreeBSD, which has the same ciss-ioctls as Linux, to access - * individual drives behind ciss(4) controllers. - * Authors of smartmontools may wish to make this code shared between - * *BSD and Linux, but * currently it remains a duplicate. - * - * Mikhail T. <mi@aldan.algebra.com> - */ - -/* - * This header is not currently installed under /usr/include. Thus - * having a kernel source tree is required to compile this file. Use: - * - * -I/sys/dev/ciss - * - * to build. Rather unfortunate... - */ -#include <cissio.h> - -#define SEND_IOCTL_RESP_SENSE_LEN 16 /* ioctl limitation */ -#define LSCSI_DRIVER_SENSE 0x8 /* alternate CHECK CONDITION indication */ - -static int cciss_io_interface(int device, int target, - struct scsi_cmnd_io * iop, int report); - -typedef int8_t BYTE; /* some kind of Linuxism? */ -typedef uint32_t DWORD; - -typedef struct _ReportLUNdata_struct -{ - BYTE LUNListLength[4]; - DWORD reserved; - BYTE LUN[CISS_MAX_LUN][8]; -} ReportLunData_struct; - -/* Structure/defines of Report Physical LUNS of drive */ -#define CISS_MAX_LUN 16 -#define CISS_MAX_PHYS_LUN 1024 -#define CISS_REPORT_PHYS 0xc3 - -// CCISS Smart Array Controller -static int cciss_sendpassthru(unsigned int cmdtype, unsigned char *CDB, - unsigned int CDBlen, char *buff, - unsigned int size, unsigned int LunID, - unsigned char *scsi3addr, int fd) -{ - int err ; - IOCTL_Command_struct iocommand; - - memset(&iocommand, 0, sizeof(iocommand)); - - if (cmdtype == 0) - { - // To controller; nothing to do - } - else if (cmdtype == 1) - { - iocommand.LUN_info.LogDev.VolId = LunID; - iocommand.LUN_info.LogDev.Mode = 1; - } - else if (cmdtype == 2) - { - memcpy(&iocommand.LUN_info.LunAddrBytes,scsi3addr,8); - iocommand.LUN_info.LogDev.Mode = 0; - } - else - { - fprintf(stderr, "cciss_sendpassthru: bad cmdtype\n"); - return 1; - } - - memcpy(&iocommand.Request.CDB[0], CDB, CDBlen); - iocommand.Request.CDBLen = CDBlen; - iocommand.Request.Type.Type = TYPE_CMD; - iocommand.Request.Type.Attribute = ATTR_SIMPLE; - iocommand.Request.Type.Direction = XFER_READ; - iocommand.Request.Timeout = 0; - - iocommand.buf_size = size; - iocommand.buf = (unsigned char *)buff; - - if ((err = ioctl(fd, CCISS_PASSTHRU, &iocommand))) - { - perror("CCISS ioctl error"); - } - return err; -} - -static int cciss_getlun(int device, int target, unsigned char *physlun) -{ - unsigned char CDB[16]= {0}; - ReportLunData_struct *luns; - int reportlunsize = sizeof(*luns) + CISS_MAX_PHYS_LUN * 8; - int i; - int ret; - - luns = (ReportLunData_struct *)malloc(reportlunsize); - - memset(luns, 0, reportlunsize); - - /* Get Physical LUN Info (for physical device) */ - CDB[0] = CISS_REPORT_PHYS; - CDB[6] = (reportlunsize >> 24) & 0xFF; /* MSB */ - CDB[7] = (reportlunsize >> 16) & 0xFF; - CDB[8] = (reportlunsize >> 8) & 0xFF; - CDB[9] = reportlunsize & 0xFF; - - if ((ret = cciss_sendpassthru(0, CDB, 12, (char *)luns, reportlunsize, 0, NULL, device))) - { - free(luns); - return ret; - } - - for (i=0; i<CISS_MAX_LUN+1; i++) - { - if (luns->LUN[i][6] == target) - { - memcpy(physlun, luns->LUN[i], 8); - free(luns); - return 0; - } - } - - free(luns); - return ret; -} -// end CCISS Smart Array Controller - -/* cciss >> CCSISS I/O passthrough - This is an interface that uses the cciss passthrough to talk to the SMART controller on - the HP system. The cciss driver provides a way to send SCSI cmds through the CCISS passthrough - essentially the methods above and below pertain to SCSI, except for the SG driver which is not - involved. The CCISS driver does not engage the scsi subsystem. */ - static int cciss_io_interface(int device, int target, struct scsi_cmnd_io * iop, int report) - { - unsigned char pBuf[512] = {0}; - unsigned char phylun[1024] = {0}; - int iBufLen = 512; - int status = -1; - int len = 0; // used later in the code. - report = 0; - - cciss_getlun(device, target, phylun); - status = cciss_sendpassthru( 2, iop->cmnd, iop->cmnd_len, (char*) pBuf, iBufLen, 1, phylun, device); - - if (0 == status) - { - if (report > 0) - printf(" status=0\n"); - if (DXFER_FROM_DEVICE == iop->dxfer_dir) - { - memcpy(iop->dxferp, pBuf, iop->dxfer_len); - if (report > 1) - { - int trunc = (iop->dxfer_len > 256) ? 1 : 0; - printf(" Incoming data, len=%d%s:\n", (int)iop->dxfer_len, - (trunc ? " [only first 256 bytes shown]" : "")); - dStrHex((const char*)iop->dxferp, (trunc ? 256 : iop->dxfer_len) , 1); - } - } - return 0; - } - iop->scsi_status = status & 0x7e; /* bits 0 and 7 used to be for vendors */ - if (LSCSI_DRIVER_SENSE == ((status >> 24) & 0xf)) - iop->scsi_status = SCSI_STATUS_CHECK_CONDITION; - len = (SEND_IOCTL_RESP_SENSE_LEN < iop->max_sense_len) ? - SEND_IOCTL_RESP_SENSE_LEN : iop->max_sense_len; - if ((SCSI_STATUS_CHECK_CONDITION == iop->scsi_status) && - iop->sensep && (len > 0)) - { - memcpy(iop->sensep, pBuf, len); - iop->resp_sense_len = iBufLen; - if (report > 1) - { - printf(" >>> Sense buffer, len=%d:\n", (int)len); - dStrHex((const char *)pBuf, len , 1); - } - } - if (report) - { - if (SCSI_STATUS_CHECK_CONDITION == iop->scsi_status) { - printf(" status=%x: sense_key=%x asc=%x ascq=%x\n", status & 0xff, - pBuf[2] & 0xf, pBuf[12], pBuf[13]); - } - else - printf(" status=0x%x\n", status); - } - if (iop->scsi_status > 0) - return 0; - else - { - if (report > 0) - printf(" ioctl status=0x%x but scsi status=0, fail with EIO\n", status); - return -EIO; /* give up, assume no device there */ - } - } diff --git a/sysutils/smartmontools-devel/files/patch-knowndrives.cpp b/sysutils/smartmontools-devel/files/patch-knowndrives.cpp deleted file mode 100644 index 07291d4df9be..000000000000 --- a/sysutils/smartmontools-devel/files/patch-knowndrives.cpp +++ /dev/null @@ -1,14 +0,0 @@ - -$FreeBSD$ - ---- knowndrives.cpp.orig -+++ knowndrives.cpp -@@ -1031,7 +1031,7 @@ - NULL, NULL, NULL, NULL - }, - { "Western Digital Caviar SE (Serial ATA) family", -- "^WDC WD((4|8|12|16|20|25|32)00JD|(12|16|20|25|30|32)00JS|1600AAJS)-.*$", -+ "^WDC WD((4|8|12|16|20|25|32)00[JP]D|(12|16|20|25|30|32)00JS|1600AAJS)-.*$", - ".*", - NULL, NULL, NULL, NULL - }, diff --git a/sysutils/smartmontools-devel/files/patch-os__freebsd.cpp b/sysutils/smartmontools-devel/files/patch-os__freebsd.cpp deleted file mode 100644 index 8521192345c1..000000000000 --- a/sysutils/smartmontools-devel/files/patch-os__freebsd.cpp +++ /dev/null @@ -1,31 +0,0 @@ ---- os_freebsd.cpp.orig 2006-09-17 05:17:53.000000000 +0200 -+++ os_freebsd.cpp 2007-10-21 18:09:02.000000000 +0200 -@@ -873,6 +873,7 @@ - static const char * fbsd_dev_prefix = "/dev/"; - static const char * fbsd_dev_ata_disk_prefix = "ad"; - static const char * fbsd_dev_scsi_disk_plus = "da"; -+static const char * fbsd_dev_scsi_pass = "pass"; - static const char * fbsd_dev_scsi_tape1 = "sa"; - static const char * fbsd_dev_scsi_tape2 = "nsa"; - static const char * fbsd_dev_scsi_tape3 = "esa"; -@@ -908,6 +909,11 @@ - return CONTROLLER_ATA; - } - -+ // form /dev/pass* or pass* -+ if (!strncmp(fbsd_dev_scsi_pass, dev_name, -+ strlen(fbsd_dev_scsi_pass))) -+ goto handlescsi; -+ - // form /dev/da* or da* - if (!strncmp(fbsd_dev_scsi_disk_plus, dev_name, - strlen(fbsd_dev_scsi_disk_plus))) -@@ -1008,7 +1014,7 @@ - // to first list. Turn on NOCHECK for second call. This results in no - // error if no more matches found, however it does append the actual - // pattern to the list of paths.... -- if ((retglob=glob(pattern1, GLOB_ERR, NULL, &globbuf)) || -+ if ((retglob=glob(pattern1, GLOB_ERR|GLOB_NOCHECK, NULL, &globbuf)) || - (retglob=glob(pattern2, GLOB_ERR|GLOB_APPEND|GLOB_NOCHECK,NULL,&globbuf))) { - int retval = -1; - // glob failed diff --git a/sysutils/smartmontools-devel/files/pkg-message.in b/sysutils/smartmontools-devel/files/pkg-message.in deleted file mode 100644 index ee9f662c7703..000000000000 --- a/sysutils/smartmontools-devel/files/pkg-message.in +++ /dev/null @@ -1,14 +0,0 @@ -smartmontools has been installed - -To check the status of drives, use the following: - - %%PREFIX%%/sbin/smartctl -a /dev/ad0 for first ATA drive - %%PREFIX%%/sbin/smartctl -a /dev/da0 for first SCSI drive - -To enable monitor of drives, you can use %%PREFIX%%/sbin/smartd -A sample configuration file has been installed as -%%PREFIX%%/etc/smartd.conf.sample -Copy this file to %%PREFIX%%/etc/smartd.conf and edit appropriately - -To have smartd start at boot - echo 'smartd_enable="YES"' >> /etc/rc.conf diff --git a/sysutils/smartmontools-devel/files/smartd.in b/sysutils/smartmontools-devel/files/smartd.in deleted file mode 100644 index 600a0bf2a472..000000000000 --- a/sysutils/smartmontools-devel/files/smartd.in +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -# PROVIDE: smartd -# REQUIRE: DAEMON -# BEFORE: LOGIN -# KEYWORD: shutdown - -# Define these smartd_* variables in one of these files: -# /etc/rc.conf -# /etc/rc.conf.local -# /etc/rc.conf.d/smartd -# -# DO NOT CHANGE THESE DEFAULT VALUES HERE -# -smartd_enable="${smartd_enable-NO}" -smartd_pidfile="/var/run/smartd.pid" - -. %%RC_SUBR%% - -name="smartd" -rcvar=`set_rcvar` -command="%%PREFIX%%/sbin/smartd" - -load_rc_config $name - -: ${smartd_config="%%PREFIX%%/etc/smartd.conf"} -: ${smartd_flags="-c ${smartd_config}"} - -pidfile="${smartd_pidfile}" -required_files="${smartd_config}" - -case "${smartd_flags}" in -*-p\ *) - echo "ERROR: \$smartd_flags includes -p option." \ - "Please use \$smartd_pidfile instead." - exit 1 - ;; -*) - smartd_flags="-p ${pidfile} ${smartd_flags}" - ;; -esac - -run_rc_command "$1" diff --git a/sysutils/smartmontools-devel/pkg-descr b/sysutils/smartmontools-devel/pkg-descr deleted file mode 100644 index c95debe3b9fa..000000000000 --- a/sysutils/smartmontools-devel/pkg-descr +++ /dev/null @@ -1,7 +0,0 @@ -The smartmontools package contains two utility programs (smartctl and smartd) -to control and monitor storage systems using the Self-Monitoring, Analysis -and Reporting Technology System (S.M.A.R.T.) built into most modern ATA and -SCSI hard disks. It is derived from the smartsuite package, and includes -support for ATA/ATAPI-5 disks. - -WWW: http://smartmontools.sourceforge.net diff --git a/sysutils/smartmontools-devel/pkg-plist b/sysutils/smartmontools-devel/pkg-plist deleted file mode 100644 index 4e77c480f242..000000000000 --- a/sysutils/smartmontools-devel/pkg-plist +++ /dev/null @@ -1,22 +0,0 @@ -@comment $FreeBSD$ -@unexec /bin/echo "===>" Stopping smartd ... -@unexec /usr/bin/killall smartd 2>/dev/null || true -etc/smartd.conf.sample -sbin/smartctl -sbin/smartd -%%DOCSDIR%%/AUTHORS -%%DOCSDIR%%/CHANGELOG -%%DOCSDIR%%/COPYING -%%DOCSDIR%%/INSTALL -%%DOCSDIR%%/NEWS -%%DOCSDIR%%/README -%%DOCSDIR%%/TODO -%%DOCSDIR%%/WARNINGS -%%DOCSDIR%%/examplescripts/Example1 -%%DOCSDIR%%/examplescripts/Example2 -%%DOCSDIR%%/examplescripts/Example3 -%%DOCSDIR%%/examplescripts/Example4 -%%DOCSDIR%%/examplescripts/README -%%DOCSDIR%%/smartd.conf -@dirrm %%DOCSDIR%%/examplescripts -@dirrm %%DOCSDIR%% |