diff options
author | prlw1 <prlw1@pkgsrc.org> | 2013-12-11 19:07:47 +0000 |
---|---|---|
committer | prlw1 <prlw1@pkgsrc.org> | 2013-12-11 19:07:47 +0000 |
commit | 6590ee0a293685a79884c0897cfa45bdc9ba9cac (patch) | |
tree | 697431bb12948fcd91cdd006c9332cd897e94ef9 | |
parent | 4afedfee8522abe0f1e88ae24330d3685d458353 (diff) | |
download | pkgsrc-6590ee0a293685a79884c0897cfa45bdc9ba9cac.tar.gz |
Update (disk)scrub to 2.5.2 (+add DIOCGDISKINFO implementation)
Since 2.0:
* Fix scrub abort on files/disks > 2G in size (issue 19)
This was introduced in 2.5.0 and the failure is quick and obvious.
* Fix loss of precision in disk size approximation (issue 18)
* Add -t option to disable creation of thread to generate randomness
in parallel with I/O.
* Prepare source for a libscrub api (work in progress)
* Cosmetic changes to man page and help output.
* Generate randomness and do I/O in parallel [Richard B. Hill]
* Replace O_SYNC with O_DIRECT+fsync+posix_fadvise [H. Peter Anvin]
This produces a significant performance improvement, at least on Linux.
* Add support for RDRAND instr. [H. Peter Anvin]
* Use <stdbool.h> if the system has it [H. Peter Anvin]
* Fix incorrect assertion in scrub --dirent handling (issue 9) [Peter Hyman]
* Clean up tmp files after scrub --freespace (issue 9) [Peter Hyman]
* Allow scrub --pattern=custom="string" (issue 11) [Peter Hyman]
Allow C style numerical escapes in string: \nnn (octal) and \xnn (hex).
This is a single-pass sequence with a custom pattern.
* Change default buffer size from 1m to 4m [H. Peter Anvin]
* Avoid closing and re-opening /dev/urandom [H. Peter Anvin]
* Fix bug in pfitzner7 pattern def and add fillff, fillzero
methods (issue 8) [Peter Hyman]
* Change dod method to perform random pass first and skip extra pass.
* Add --help option that lists available scrub methods.
* Make dist tarball work with rpmbuild -ta.
* Added usarmy, pfitzner7, and pfitzner33 methods.
* Added -L option to not follow symbolic links [Timothy Boronczyk]
* Treat a zero return from write(2) as an error.
* New patterns:
- random2: two random passes
- schneier (one 0x00 pass, one 0xff pass, and five random passes) [Joe]
* Add --pattern random (one random pass) mode.
* Portability fixes for Slackware [Timothy Boronczyk]
* Fix bug where scrub --remove on a zero length file would abort
without removing the file. Issue a warning and remove it.
* Fix a bug where some data from the original file could appear in
the first disk block after a verified scrub when running without
the -S (--no-signature) option.
-rw-r--r-- | sysutils/diskscrub/Makefile | 12 | ||||
-rw-r--r-- | sysutils/diskscrub/distinfo | 12 | ||||
-rw-r--r-- | sysutils/diskscrub/patches/patch-configure.ac | 37 | ||||
-rw-r--r-- | sysutils/diskscrub/patches/patch-src_Makefile.am | 15 | ||||
-rw-r--r-- | sysutils/diskscrub/patches/patch-src_getsize.c | 159 | ||||
-rw-r--r-- | sysutils/diskscrub/patches/patch-test_Makefile.am | 16 |
6 files changed, 241 insertions, 10 deletions
diff --git a/sysutils/diskscrub/Makefile b/sysutils/diskscrub/Makefile index cf8e70855d0..07c48bef802 100644 --- a/sysutils/diskscrub/Makefile +++ b/sysutils/diskscrub/Makefile @@ -1,17 +1,17 @@ -# $NetBSD: Makefile,v 1.5 2013/05/31 12:42:00 wiz Exp $ +# $NetBSD: Makefile,v 1.6 2013/12/11 19:07:47 prlw1 Exp $ # -DISTNAME= scrub-2.0 -PKGREVISION= 2 +DISTNAME= scrub-2.5.2 CATEGORIES= sysutils -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=diskscrub/} +MASTER_SITES= http://diskscrub.googlecode.com/files/ EXTRACT_SUFX= .tar.bz2 MAINTAINER= agc@NetBSD.org -HOMEPAGE= http://sourceforge.net/projects/diskscrub +HOMEPAGE= http://code.google.com/p/diskscrub/ COMMENT= Utility to overwrite disks and scrub the data on them +LICENSE= gnu-gpl-v2 GNU_CONFIGURE= yes -USE_TOOLS+= perl # this is purely for GNU configure +USE_TOOLS+= perl # this is purely for GNU configure (X_AC_META macro) .include "../../mk/bsd.pkg.mk" diff --git a/sysutils/diskscrub/distinfo b/sysutils/diskscrub/distinfo index d28a01aacd2..b8a26442272 100644 --- a/sysutils/diskscrub/distinfo +++ b/sysutils/diskscrub/distinfo @@ -1,5 +1,9 @@ -$NetBSD: distinfo,v 1.1.1.1 2008/07/21 22:25:03 agc Exp $ +$NetBSD: distinfo,v 1.2 2013/12/11 19:07:47 prlw1 Exp $ -SHA1 (scrub-2.0.tar.bz2) = 9a4edf70d4b3dc08a1c34c9579af573c872327fd -RMD160 (scrub-2.0.tar.bz2) = dd91066127bdf3cc059aa9832bd00d15af04ad80 -Size (scrub-2.0.tar.bz2) = 145625 bytes +SHA1 (scrub-2.5.2.tar.bz2) = 863e5894e6acb3f922cb25f58e260f9c59b55c14 +RMD160 (scrub-2.5.2.tar.bz2) = 852698810f401226608f6b1882191dc7bd2b47e4 +Size (scrub-2.5.2.tar.bz2) = 161468 bytes +SHA1 (patch-configure.ac) = 929828e5c8ad340bfc4d6141aad45697d20fef20 +SHA1 (patch-src_Makefile.am) = 4bdd6a41a6fcdc72120d5a1ebd8a17f9d90881d6 +SHA1 (patch-src_getsize.c) = 221d201423b38a38486e4c91f4b9e28f6a1d0b52 +SHA1 (patch-test_Makefile.am) = ada26d5b518eb630ac7e6ba0d6a61ae5e3280157 diff --git a/sysutils/diskscrub/patches/patch-configure.ac b/sysutils/diskscrub/patches/patch-configure.ac new file mode 100644 index 00000000000..551fe0e3a38 --- /dev/null +++ b/sysutils/diskscrub/patches/patch-configure.ac @@ -0,0 +1,37 @@ +$NetBSD: patch-configure.ac,v 1.1 2013/12/11 19:07:47 prlw1 Exp $ + +- Make unimplemented getsize() function match prototype in getsize.h. +- Use ioctl names (feature tests) rather than OS names. + XXX for SIOC_CAPACITY consider using SIOC_STORAGE_CAPACITY. +- Implement getsize() based on DIOCGDISKINFO ioctl. + +--- configure.ac.orig 2013-12-11 17:23:58.000000000 +0000 ++++ configure.ac +@@ -43,7 +43,14 @@ AC_HEADER_STDC + AC_CHECK_HEADERS( \ + getopt.h \ + stdbool.h \ ++ stdint.h \ + pthread.h \ ++ linux/fs.h \ ++ sys/devinfo.h \ ++ sys/disk.h \ ++ sys/dkio.h \ ++ sys/ioctl.h \ ++ sys/scsi.h \ + ) + + AC_PROG_LIBTOOL +@@ -56,6 +63,12 @@ AC_C_BIGENDIAN + AC_C_CONST + + ## ++# Checks for libraries ++## ++AC_CHECK_LIB(prop, prop_dictionary_recv_ioctl, LIBPROP=-lprop) ++AC_SUBST(LIBPROP) ++ ++## + # Checks for library functions + ## + AC_CHECK_FUNCS( \ diff --git a/sysutils/diskscrub/patches/patch-src_Makefile.am b/sysutils/diskscrub/patches/patch-src_Makefile.am new file mode 100644 index 00000000000..86d6d17d24e --- /dev/null +++ b/sysutils/diskscrub/patches/patch-src_Makefile.am @@ -0,0 +1,15 @@ +$NetBSD: patch-src_Makefile.am,v 1.1 2013/12/11 19:07:47 prlw1 Exp $ + +- Make unimplemented getsize() function match prototype in getsize.h. +- Use ioctl names (feature tests) rather than OS names. + XXX for SIOC_CAPACITY consider using SIOC_STORAGE_CAPACITY. +- Implement getsize() based on DIOCGDISKINFO ioctl. + +--- src/Makefile.am.orig 2013-12-11 17:24:13.000000000 +0000 ++++ src/Makefile.am +@@ -23,4 +23,4 @@ scrub_SOURCES = \ + util.c \ + util.h + +-scrub_LDADD = $(LIBPTHREAD) ++scrub_LDADD = $(LIBPTHREAD) $(LIBPROP) diff --git a/sysutils/diskscrub/patches/patch-src_getsize.c b/sysutils/diskscrub/patches/patch-src_getsize.c new file mode 100644 index 00000000000..7ee186f5a71 --- /dev/null +++ b/sysutils/diskscrub/patches/patch-src_getsize.c @@ -0,0 +1,159 @@ +$NetBSD: patch-src_getsize.c,v 1.1 2013/12/11 19:07:47 prlw1 Exp $ + +- Make unimplemented getsize() function match prototype in getsize.h. +- Use ioctl names (feature tests) rather than OS names. + XXX for SIOC_CAPACITY consider using SIOC_STORAGE_CAPACITY. +- Implement getsize() based on DIOCGDISKINFO ioctl. + +--- src/getsize.c.orig 2013-12-11 17:24:25.000000000 +0000 ++++ src/getsize.c +@@ -36,16 +36,35 @@ + #include <stdlib.h> + #include <libgen.h> + #include <string.h> ++#if HAVE_STDINT_H ++#include <stdint.h> ++#endif ++#if HAVE_SYS_IOCTL_H ++#include <sys/ioctl.h> ++#endif ++#if HAVE_LINUX_FS_H ++#include <linux/fs.h> ++#endif ++#if HAVE_SYS_DEVINFO_H ++#include <sys/devinfo.h> ++#endif ++#if HAVE_SYS_DISK_H ++#include <sys/disk.h> ++#endif ++#if HAVE_SYS_DKIO_H ++#include <sys/dkio.h> ++#endif ++#if HAVE_SYS_SCSI_H ++#include <sys/scsi.h> ++#endif + + #include "getsize.h" + + extern char *prog; + +-#if defined(linux) ++#if defined (BLKGETSIZE) && defined(BLKGETSIZE64) + /* scrub-1.7 tested linux 2.6.11-1.1369_FC4 */ + /* scrub-1.8 tested Fedora Core 5 */ +-#include <sys/ioctl.h> +-#include <linux/fs.h> + #include <sys/utsname.h> + typedef unsigned long long u64; /* for BLKGETSIZE64 (slackware) */ + +@@ -86,11 +105,8 @@ error: + return -1; + } + +-#elif defined(__FreeBSD__) ++#elif defined(DIOCGMEDIASIZE) + /* scrub-1.7 tested freebsd 5.3-RELEASE-p5 */ +-#include <sys/ioctl.h> +-#include <sys/disk.h> +- + int + getsize(char *path, off_t *sizep) + { +@@ -111,10 +127,8 @@ error: + return -1; + } + +-#elif defined(sun) ++#elif defined(DKIOCGMEDIAINFO) + /* scrub-1.7 tested solaris 5.9 */ +-#include <sys/ioctl.h> +-#include <sys/dkio.h> + #include <sys/vtoc.h> + + int +@@ -137,11 +151,8 @@ error: + return -1; + } + +-#elif defined(__APPLE__) ++#elif defined(DKIOCGETBLOCKSIZE) && defined(DKIOCGETBLOCKCOUNT) + /* scrub-1.7 tested OS X 7.9.0 */ +-#include <stdint.h> +-#include <sys/ioctl.h> +-#include <sys/disk.h> + + int + getsize(char *path, off_t *sizep) +@@ -165,11 +176,10 @@ error: + (void)close(fd); + return -1; + } +-#elif defined(_AIX) ++ ++#elif defined(IOCINFO) + /* scrub-1.7 tested AIX 5.1 and 5.3 */ + /* scrub-1.8 tested AIX 5.2 */ +-#include <sys/ioctl.h> +-#include <sys/devinfo.h> + + int + getsize(char *path, off_t *sizep) +@@ -202,10 +212,10 @@ error: + (void)close(fd); + return -1; + } +-#elif defined (__hpux) ++ ++#elif defined (SIOC_CAPACITY) + + #include <stropts.h> +-#include <sys/scsi.h> + + int + getsize(char *path, off_t *sizep) +@@ -227,11 +237,43 @@ error: + return -1; + } + ++#elif defined(DIOCGDISKINFO) ++ ++int ++getsize(char *path, off_t *sizep) ++{ ++ int fd; ++ prop_dictionary_t disk_dict, geom_dict; ++ uint64_t secperunit; ++ uint32_t secsize; ++ ++ fd = open(path, O_RDONLY); ++ if (fd == -1) ++ return -1; ++ ++ if (prop_dictionary_recv_ioctl(fd, DIOCGDISKINFO, &disk_dict) != 0) ++ return -1; ++ if (close(fd) == -1) ++ return -1; ++ ++ geom_dict = prop_dictionary_get(disk_dict, "geometry"); ++ if (geom_dict == NULL) ++ return -1; ++ ++ if (!prop_dictionary_get_uint64(geom_dict, "sectors-per-unit", &secperunit)) ++ return -1; ++ if (!prop_dictionary_get_uint32(geom_dict, "sector-size", &secsize)) ++ return -1; ++ *sizep = secperunit * secsize; ++ ++ return 0; ++} ++ + #else + /* Unimplemented! Scrub will tell user to use -s. + */ +-off_t +-getsize(char *path) ++int ++getsize(char *path, off_t *sizep) + { + errno = ENOSYS; + return -1; diff --git a/sysutils/diskscrub/patches/patch-test_Makefile.am b/sysutils/diskscrub/patches/patch-test_Makefile.am new file mode 100644 index 00000000000..d50233ae258 --- /dev/null +++ b/sysutils/diskscrub/patches/patch-test_Makefile.am @@ -0,0 +1,16 @@ +$NetBSD: patch-test_Makefile.am,v 1.1 2013/12/11 19:07:47 prlw1 Exp $ + +- Make unimplemented getsize() function match prototype in getsize.h. +- Use ioctl names (feature tests) rather than OS names. + XXX for SIOC_CAPACITY consider using SIOC_STORAGE_CAPACITY. +- Implement getsize() based on DIOCGDISKINFO ioctl. + +--- test/Makefile.am.orig 2013-12-11 17:24:41.000000000 +0000 ++++ test/Makefile.am +@@ -28,4 +28,6 @@ tgetsize_SOURCES = tgetsize.c $(common_s + tsig_SOURCES = tsig.c $(common_sources) + pat_SOURCES = pat.c $(common_sources) + ++LDADD = $(LIBPROP) ++ + EXTRA_DIST = $(TESTS) $(EXPS) |