diff options
author | Chris Rees <crees@FreeBSD.org> | 2011-09-27 18:59:51 +0000 |
---|---|---|
committer | Chris Rees <crees@FreeBSD.org> | 2011-09-27 18:59:51 +0000 |
commit | d1680780d59c82d1397054c8af03792585c59468 (patch) | |
tree | 5779e2f4566a48388d57e12ecf1ba203be8be427 /sysutils/smartmontools | |
parent | 415759d5558795b2b307ceeb0818cfc456bb701d (diff) | |
download | ports-d1680780d59c82d1397054c8af03792585c59468.tar.gz ports-d1680780d59c82d1397054c8af03792585c59468.zip |
Notes
Diffstat (limited to 'sysutils/smartmontools')
-rw-r--r-- | sysutils/smartmontools/Makefile | 2 | ||||
-rw-r--r-- | sysutils/smartmontools/files/patch-os_freebsd | 74 |
2 files changed, 75 insertions, 1 deletions
diff --git a/sysutils/smartmontools/Makefile b/sysutils/smartmontools/Makefile index 627cfeaf17d4..83557246be65 100644 --- a/sysutils/smartmontools/Makefile +++ b/sysutils/smartmontools/Makefile @@ -7,7 +7,7 @@ PORTNAME= smartmontools PORTVERSION= 5.41 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils MASTER_SITES= SF diff --git a/sysutils/smartmontools/files/patch-os_freebsd b/sysutils/smartmontools/files/patch-os_freebsd new file mode 100644 index 000000000000..097cec21b4bf --- /dev/null +++ b/sysutils/smartmontools/files/patch-os_freebsd @@ -0,0 +1,74 @@ +$FreeBSD$ + +This patch from upstream address 2 issues: + +1) SMART health status is always "GOOD" with atacam driver. +2) Command "-l scterc" is broken on ata and atacam drivers. + +See https://sourceforge.net/apps/trac/smartmontools/ticket/198 for more +details. + +NOTE: Path stripped from filename to make make patch work, but otherwise +identical to the patch in the ticket. + +Index: trunk/smartmontools/os_freebsd.cpp +=================================================================== +--- os_freebsd.cpp (revision 3407) ++++ os_freebsd.cpp (revision 3421) +@@ -288,10 +288,10 @@ + break; + case ata_cmd_in::data_in: +- request.flags=ATA_CMD_READ; ++ request.flags=ATA_CMD_READ | ATA_CMD_CONTROL; + request.data=(char *)in.buffer; + request.count=in.size; + break; + case ata_cmd_in::data_out: +- request.flags=ATA_CMD_WRITE; ++ request.flags=ATA_CMD_WRITE | ATA_CMD_CONTROL; + request.data=(char *)in.buffer; + request.count=in.size; +@@ -300,6 +300,6 @@ + return set_err(ENOSYS); + } +- +- clear_err(); ++ ++ clear_err(); + errno = 0; + if (do_cmd(&request, in.in_regs.is_48bit_cmd())) +@@ -390,5 +390,5 @@ + if (request->count == 0) + camflags = CAM_DIR_NONE; +- else if (request->flags == ATA_CMD_READ) ++ else if (request->flags & ATA_CMD_READ) + camflags = CAM_DIR_IN; + else +@@ -406,9 +406,6 @@ + request->timeout * 1000); // timeout in seconds + ++ ccb.ataio.cmd.flags = CAM_ATAIO_NEEDRESULT; + // ata_28bit_cmd +- if (request->flags == ATA_CMD_CONTROL) +- ccb.ataio.cmd.flags = CAM_ATAIO_NEEDRESULT; +- else +- ccb.ataio.cmd.flags = 0; + ccb.ataio.cmd.command = request->u.ata.command; + ccb.ataio.cmd.features = request->u.ata.feature; +@@ -436,5 +433,15 @@ + } + +- request->u.ata.count = ccb.ataio.res.sector_count; ++ request->u.ata.lba = ++ ((u_int64_t)(ccb.ataio.res.lba_low)) | ++ ((u_int64_t)(ccb.ataio.res.lba_mid) << 8) | ++ ((u_int64_t)(ccb.ataio.res.lba_high) << 16) | ++ ((u_int64_t)(ccb.ataio.res.lba_low_exp) << 24) | ++ ((u_int64_t)(ccb.ataio.res.lba_mid_exp) << 32) | ++ ((u_int64_t)(ccb.ataio.res.lba_high_exp) << 40); ++ ++ request->u.ata.count = ccb.ataio.res.sector_count | (ccb.ataio.res.sector_count_exp << 8); ++ request->error = ccb.ataio.res.error; ++ + return 0; + } |