Imported Upstream version 5.38+svn2956

This commit is contained in:
Giuseppe Iuculano 2009-10-11 08:46:19 +02:00
parent 549657432d
commit eb07ddf29c
13 changed files with 487 additions and 727 deletions

View File

@ -1,6 +1,6 @@
CHANGELOG for smartmontools
$Id: CHANGELOG 2918 2009-09-20 11:51:42Z samm2 $
$Id: CHANGELOG 2951 2009-10-08 23:43:46Z samm2 $
The most recent version of this file is:
http://smartmontools.svn.sourceforge.net/viewvc/smartmontools/trunk/smartmontools/CHANGELOG?view=markup
@ -43,6 +43,44 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[AS] Linux: Autodetect DELL PERC and MegaRAID controllers.
Hiding debug messages coming from megaraid code.
[AS] Linux: Fixed SATA drives support on megaraid device (see ticket #15).
[AS] FreeBSD: Removed all old detection code, moving everything to
the objects. Now we are using CAM/ATA enumerators to guess device
type.
[AS] FreeBSD: Added autodetection for the ada disks (untested).
Code for USB device detection refactored.
[AS] FreeBSD: cam_get_umassno rewritten using XPT_PATH_INQ
[AS] FreeBSD: do not open/close cam device on every request for SCSI
disks. Use com->camdev both for SCSI and ATAPICAM.
[AS] FreeBSD: added support for the ada disks, based on agapon patch
[CF] Add names for attributes 184 and 188, see ticket #17.
[CF] configure.in: Change configure date syntax.
Add message to '-mno-cygwin' option check.
[GK] Add names for some attributes used in MLC flash drives:
175, 176, 177, 181, 182
[CF] Windows: Check support of gcc '-mno-cygwin' option in configure.
This option has been removed in Cygwin gcc 4.x. Update INSTALL
instructions accordingly.
[CF] Increase SCSI_TIMEOUT_DEFAULT from 6 to 20 seconds to avoid
timeouts when a disk spins up from standby mode.
[CF] Add USB ID of AcomData 504 (OnSpec USB bridge).
[AS] Correcting manual pages (FreeBSD related)
[AS] FreeBSD: fix FTBFS on GNU/kFreeBSD (reported by derevko).
[AS] FreeBSD: Add USB autodetection to smartd DEVICESCAN directive.

24
INSTALL
View File

@ -1,7 +1,7 @@
Smartmontools installation instructions
=======================================
$Id: INSTALL 2844 2009-07-18 12:59:21Z chrfranke $
$Id: INSTALL 2925 2009-10-02 20:45:54Z chrfranke $
Please also see the smartmontools home page:
http://smartmontools.sourceforge.net/
@ -434,16 +434,32 @@ Same as Red Hat:
instead. This is not necessary for the generated ./configure script.
[10] Guidelines for Windows
==========================
===========================
To compile the Windows release with MinGW, use the following on Cygwin:
To compile the Windows release with MinGW gcc on MSYS, use:
./configure --build=mingw32
./configure
make
Instead of using "make install", copy the .exe files into
some directory in the PATH.
To compile with MinGW gcc 3.x on Cygwin, use:
./configure --build=i686-pc-mingw32
The above does not work if gcc 4.x is installed and selected as
default by /usr/sbin/alternatives. If the configure command aborts
with error message '... does not support -mno-cygwin', select
gcc 3.x by:
CC=gcc-3 CXX=g++-3 ./configure --build=i686-pc-mingw32
Alternatively, a MinGW-targeted cross-compiler can be used if available:
./configure --build=i686-pc-cygwin --host=i686-pc-mingw32
To build the Windows binary distribution, use:
make dist-win32

9
NEWS
View File

@ -1,6 +1,6 @@
smartmontools NEWS
------------------
$Id: NEWS 2844 2009-07-18 12:59:21Z chrfranke $
$Id: NEWS 2956 2009-10-11 00:21:15Z samm2 $
The most up-to-date version of this file is:
http://smartmontools.svn.sourceforge.net/viewvc/smartmontools/trunk/smartmontools/NEWS?view=markup
@ -10,7 +10,7 @@ Summary: smartmontools release 5.39 (UNSTABLE/EXPERIMENTAL)
-----------------------------------------------------------
- Sourcecode repository moved from CVS to SVN
- Support for USB devices with Cypress, JMicron and Sunplus USB bridges
- USB device type autodetection for some devices on Linux and Windows
- USB device type autodetection for some devices on Linux,Windows and FreeBSD
(http://smartmontools.wiki.sourceforge.net/overview_USB-Support)
- Support for Areca controllers on Linux
- Support for MegaRAID controllers on Linux
@ -38,7 +38,7 @@ Summary: smartmontools release 5.39 (UNSTABLE/EXPERIMENTAL)
- Option '-s PREFIX' to store smartd internal state until next startup
- Configure option to enable the above by default
- Change to an object oriented interface to access ATA and SCSI devices
- Linux and Win32 modules migrated to new interface
- Linux, Win32 and FreeBSD modules migrated to new interface
- Rework of smartd data structures
- Checkin date and SVN revision and optional BUILD_INFO printed in version info
- Better support for gSmartControl on Windows
@ -49,7 +49,8 @@ Summary: smartmontools release 5.39 (UNSTABLE/EXPERIMENTAL)
- C++ Support for QNX Target, already tested for QNX 6.3.2 on x86 and
armle target
- Additional support for Samsung MLC flash drives
- New device type detection algorithm on FreeBSD, not based on filename
- Support for the adaX (ATA on CAM bus) devices on FreeBSD 8.0 and higher
Date 2008-03-10
Summary: smartmontools release 5.38 (STABLE)

View File

@ -37,7 +37,7 @@
#include "utility.h"
#include "dev_ata_cmd_set.h" // for parsed_ata_device
const char * atacmds_cpp_cvsid = "$Id: atacmds.cpp 2872 2009-08-08 19:54:28Z chrfranke $"
const char * atacmds_cpp_cvsid = "$Id: atacmds.cpp 2928 2009-10-03 16:24:53Z chrfranke $"
ATACMDS_H_CVSID;
// for passing global control variables
@ -1985,6 +1985,15 @@ void ataPrintSmartAttribName(char * out, unsigned char id, const unsigned char *
case 13:
name="Read_Soft_Error_Rate";
break;
case 175:
name="Program_Fail_Count_Chip";
break;
case 176:
name="Erase_Fail_Count_Chip";
break;
case 177:
name="Wear_Leveling_Count";
break;
case 178:
name="Used_Rsvd_Blk_Cnt_Chip";
break;
@ -1994,12 +2003,24 @@ void ataPrintSmartAttribName(char * out, unsigned char id, const unsigned char *
case 180:
name="Unused_Rsvd_Blk_Cnt_Tot";
break;
case 181:
name="Program_Fail_Cnt_Total";
break;
case 182:
name="Erase_Fail_Count_Total";
break;
case 183:
name="Runtime_Bad_Block";
break;
case 184:
name="End-to-End_Error";
break;
case 187:
name="Reported_Uncorrect";
break;
case 188:
name="Command_Timeout";
break;
case 189:
name="High_Fly_Writes";
break;

View File

@ -1,13 +1,13 @@
#
# $Id: configure.in 2890 2009-09-03 14:47:38Z samm2 $
# $Id: configure.in 2927 2009-10-03 16:08:34Z chrfranke $
#
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(smartmontools, 5.39, smartmontools-support@lists.sourceforge.net)
AC_CONFIG_SRCDIR(smartctl.cpp)
smartmontools_configure_date=`date -u +"%Y/%m/%d %T %Z"`
smartmontools_cvs_tag=`echo '$Id: configure.in 2890 2009-09-03 14:47:38Z samm2 $'`
smartmontools_configure_date=`date -u +'%Y-%m-%d %T %Z'`
smartmontools_cvs_tag=`echo '$Id: configure.in 2927 2009-10-03 16:08:34Z chrfranke $'`
smartmontools_release_date=2008/03/10
smartmontools_release_time="10:44:07 GMT"
@ -34,8 +34,23 @@ AC_CANONICAL_HOST
dnl Set flags which may affect AC_CHECK_*.
case "${host}" in
*-*-mingw*)
# If building on Cygwin and not cross-compiling add '-mno-cygwin'
# to select MinGW gcc. This does no longer work for gcc 4.x.
if test "${build}" = "${host}" && test -x /usr/bin/uname && \
/usr/bin/uname | grep -i '^CYGWIN' >/dev/null; then
AC_MSG_CHECKING([whether C and C++ compiler support -mno-cygwin])
gcc_support_m_no_cygwin=no
if $CC -v -mno-cygwin >/dev/null 2>&1 && \
$CXX -v -mno-cygwin >/dev/null 2>&1; then
gcc_support_m_no_cygwin=yes
fi
AC_MSG_RESULT([$gcc_support_m_no_cygwin])
if test "$gcc_support_m_no_cygwin" != "yes"; then
AC_MSG_ERROR([$CC and $CXX do not support -mno-cygwin, see INSTALL file for details.])
fi
CPPFLAGS="$CPPFLAGS -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin"
fi
CPPFLAGS="$CPPFLAGS -idirafter ${srcdir}/posix -idirafter ${srcdir}/os_win32"
;;
*-*-freebsd*)

File diff suppressed because it is too large Load Diff

View File

@ -84,18 +84,6 @@
#define OS_FREEBSD_H_CVSID "$Id: os_freebsd.h,v 1.26 2009/01/14 02:39:00 sxzzsf Exp $\n"
struct freebsd_dev_channel {
int channel; // the ATA channel to work with
int device; // the device on the channel
#ifndef IOCATAREQUEST
int atacommand; // the ATA Command file descriptor (/dev/ata)
#endif
char* devname; // the SCSI device name
int unitnum; // the SCSI unit number
};
#define FREEBSD_MAXDEV 64
#define FREEBSD_FDOFFSET 16
#define MAX_NUM_DEV 26
#ifdef HAVE_SYS_TWEREG_H

View File

@ -90,7 +90,7 @@
#define ARGUSED(x) ((void)(x))
const char *os_XXXX_c_cvsid="$Id: os_linux.cpp 2915 2009-09-18 21:17:37Z chrfranke $" \
const char *os_XXXX_c_cvsid="$Id: os_linux.cpp 2951 2009-10-08 23:43:46Z samm2 $" \
ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_LINUX_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
/* for passing global control variables */
@ -951,6 +951,7 @@ bool linux_megaraid_device::open()
char line[128];
int mjr, n1;
FILE *fp;
int report = con->reportscsiioctl;
if (!linux_smart_device::open())
return false;
@ -963,7 +964,7 @@ bool linux_megaraid_device::open()
else if (ioctl(get_fd(), SCSI_IOCTL_GET_BUS_NUMBER, &m_hba) != 0) {
int err = errno;
linux_smart_device::close();
return set_err(err, "can't get hba");
return set_err(err, "can't get bus number");
}
/* Perform mknod of device ioctl node */
@ -972,12 +973,14 @@ bool linux_megaraid_device::open()
n1=0;
if (sscanf(line, "%d megaraid_sas_ioctl%n", &mjr, &n1) == 1 && n1 == 22) {
n1=mknod("/dev/megaraid_sas_ioctl_node", S_IFCHR, makedev(mjr, 0));
if(report > 0)
printf("Creating /dev/megaraid_sas_ioctl_node = %d\n", n1 >= 0 ? 0 : errno);
if (n1 >= 0 || errno == EEXIST)
break;
}
else if (sscanf(line, "%d megadev%n", &mjr, &n1) == 1 && n1 == 11) {
n1=mknod("/dev/megadev0", S_IFCHR, makedev(mjr, 0));
if(report > 0)
printf("Creating /dev/megadev0 = %d\n", n1 >= 0 ? 0 : errno);
if (n1 >= 0 || errno == EEXIST)
break;
@ -1043,7 +1046,18 @@ bool linux_megaraid_device::scsi_pass_through(scsi_cmnd_io *iop)
if (iop->cmnd[0] == 0x00)
return true;
if (iop->cmnd[0] == 0x85 && iop->cmnd[1] == 0x06) {
if(report > 0)
pout("Rejecting SMART/ATA command to controller\n");
// Emulate SMART STATUS CHECK drive reply
// smartctl fail to work without this
if(iop->cmnd[2]==0x2c) {
iop->resp_sense_len=22;
iop->sensep[0]=0x72; // response code
iop->sensep[7]=0x0e; // no idea what it is, copied from sat device answer
iop->sensep[8]=0x09; //
iop->sensep[17]=0x4f; // lm
iop->sensep[19]=0xc2; // lh
}
return true;
}
@ -2666,6 +2680,12 @@ smart_device * linux_scsi_device::autodetect_open()
"you may need to replace %s with /dev/twaN or /dev/tweN", get_dev_name());
return this;
}
// DELL?
if (!memcmp(req_buff + 8, "DELL PERC", 12) || !memcmp(req_buff + 8, "MegaRAID", 8)) {
close();
set_err(EINVAL, "DELL or MegaRaid controller, please try adding '-d megaraid,N'");
return this;
}
// Marvell ?
if (len >= 42 && !memcmp(req_buff + 36, "MVSATA", 6)) {

View File

@ -61,7 +61,7 @@
#include "dev_ata_cmd_set.h" // ata_device_with_command_set
#include "dev_tunnelled.h" // tunnelled_device<>
const char * scsiata_cpp_cvsid = "$Id: scsiata.cpp 2916 2009-09-19 12:46:26Z chrfranke $";
const char * scsiata_cpp_cvsid = "$Id: scsiata.cpp 2923 2009-09-24 20:10:38Z chrfranke $";
/* for passing global control variables */
extern smartmonctrl *con;
@ -1415,7 +1415,9 @@ const usb_id_entry usb_ids[] = {
// Verbatim
{ 0x18a5, 0x0215, 0x0001, d_sat }, // Verbatim FW/USB160 - Oxford OXUF934SSA-LQAG (USB+IEE1394->SATA)
// SunplusIT
{ 0x1bcf, 0x0c31, -1, d_sunplus } // SunplusIT
{ 0x1bcf, 0x0c31, -1, d_sunplus }, // SunplusIT
// OnSpec
{ 0x55aa, 0x2b00, 0x0100, d_unsup } // OnSpec ? (USB->PATA)
};
const unsigned num_usb_ids = sizeof(usb_ids)/sizeof(usb_ids[0]);

View File

@ -32,7 +32,7 @@
#ifndef SCSICMDS_H_
#define SCSICMDS_H_
#define SCSICMDS_H_CVSID "$Id: scsicmds.h,v 1.69 2009/06/24 04:10:10 dpgilbert Exp $\n"
#define SCSICMDS_H_CVSID "$Id: scsicmds.h 2924 2009-09-26 20:38:40Z chrfranke $\n"
#include <stdio.h>
#include <stdlib.h>
@ -273,7 +273,8 @@ Documentation, see http://www.storage.ibm.com/techsup/hddtech/prodspecs.htm */
/* SCSI command timeout values (units are seconds) */
#define SCSI_TIMEOUT_DEFAULT 6 /* 6 seconds should be ample */
#define SCSI_TIMEOUT_DEFAULT 20 // should be longer than the spin up time
// of a disk in standby mode.
#define SCSI_TIMEOUT_SELF_TEST (5 * 60 * 60) /* allow max 5 hours for */
/* extended foreground self test */

View File

@ -1,7 +1,7 @@
.ig
Copyright (C) 2002-9 Bruce Allen <smartmontools-support@lists.sourceforge.net>
$Id: smartctl.8.in 2883 2009-09-02 12:38:39Z samm2 $
$Id: smartctl.8.in 2922 2009-09-22 16:27:33Z chrfranke $
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@ -875,11 +875,12 @@ twenty\-one self\-tests, the log shows the type of test (short or
extended, off\-line or captive) and the final status of the test. If
the test did not complete successfully, then the percentage of the
test remaining is shown. The time at which the test took place,
measured in hours of disk lifetime, is also printed. If any errors
were detected, the Logical Block Address (LBA) of the first error is
printed in decimal notation. On Linux systems the smartmontools
web page has instructions about how to convert this LBA address to the
name of the disk file containing the erroneous block.
measured in hours of disk lifetime, is also printed. [Note: this time
stamp wraps after 2^16 hours, or 2730 days and 16 hours, or about 7.5
years.] If any errors were detected, the Logical Block Address (LBA)
of the first error is printed in decimal notation. On Linux systems the
smartmontools web page has instructions about how to convert this LBA
address to the name of the disk file containing the erroneous block.
.I selftest
\- [SCSI] the self\-test log for a SCSI device has a slightly different
@ -1769,7 +1770,7 @@ these documents may be found in the References section of the
.SH
SVN ID OF THIS PAGE:
$Id: smartctl.8.in 2883 2009-09-02 12:38:39Z samm2 $
$Id: smartctl.8.in 2922 2009-09-22 16:27:33Z chrfranke $
.\" Local Variables:
.\" mode: nroff
.\" End:

View File

@ -1,7 +1,7 @@
.ig
Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
$Id: smartd.8.in 2870 2009-08-02 20:38:30Z manfred99 $
$Id: smartd.8.in 2921 2009-09-20 19:19:32Z samm2 $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -91,8 +91,7 @@ devices that support SMART. The scanning is done as follows:
Examine all entries \fB"/dev/hd[a-t]"\fP for IDE/ATA
devices, and \fB"/dev/sd[a-z]"\fP for SCSI devices.
.IP \fBFREEBSD:\fP 9
Examine all entries \fB"/dev/ad[0-9]+"\fP for IDE/ATA
devices and \fB"/dev/da[0-9]+"\fP for SCSI devices.
Authoritative list of disk devices is obtained from SCSI (CAM) and ATA subsystems.
.IP \fBNETBSD/OPENBSD:\fP 9
Authoritative list of disk devices is obtained from sysctl
\'hw.disknames\'.
@ -496,8 +495,7 @@ Under FreeBSD,
\fBsmartd\fP
will try to open all existing ATA devices (with entries in /dev)
.B /dev/ad[0-9]+
and all existing SCSI devices
.B /dev/da[0-9]+.
and all existing SCSI devices (using CAM subsystem).
Under NetBSD/OpenBSD,
\fBsmartd\fP
will try to open all existing ATA devices (with entries in /dev)
@ -2151,4 +2149,4 @@ smartmontools home page at \fBhttp://smartmontools.sourceforge.net/#references\f
.SH
SVN ID OF THIS PAGE:
$Id: smartd.8.in 2870 2009-08-02 20:38:30Z manfred99 $
$Id: smartd.8.in 2921 2009-09-20 19:19:32Z samm2 $

View File

@ -1,7 +1,7 @@
.ig
Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
$Id: smartd.conf.5.in 2847 2009-07-18 14:58:44Z chrfranke $
$Id: smartd.conf.5.in 2921 2009-09-20 19:19:32Z samm2 $
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@ -394,7 +394,9 @@ inclusive) denotes which disk on the controller is monitored. In log
files and email messages this disk will be identified as cciss_disk_XX
with XX in the range from 00 to 15 inclusive.
.B 3ware, MegaRAID, Areca and cciss controllers are currently ONLY supported under Linux.
.B 3ware and cciss controllers are currently ONLY supported under Linux and FreeBSD.
.B MegaRAID and Areca controllers are currently ONLY supported under Linux.
.I hpt,L/M/N
\- the device consists of one or more ATA disks connected to a HighPoint
@ -1482,4 +1484,4 @@ SEE ALSO:
.SH
SVN ID OF THIS PAGE:
$Id: smartd.conf.5.in 2847 2009-07-18 14:58:44Z chrfranke $
$Id: smartd.conf.5.in 2921 2009-09-20 19:19:32Z samm2 $