aboutsummaryrefslogtreecommitdiff
path: root/sysutils/recoverdm
diff options
context:
space:
mode:
authorAndrey Slusar <anray@FreeBSD.org>2006-01-23 15:14:52 +0000
committerAndrey Slusar <anray@FreeBSD.org>2006-01-23 15:14:52 +0000
commitb80a4e5d45530c3ff8a5f6b80769d16e5e6a0f68 (patch)
treec01b4244cd41e5d1bfd8a009498a04be906e3b51 /sysutils/recoverdm
parentbf66bc15d18907e1851b1b99d9718c30f4ee4837 (diff)
downloadports-b80a4e5d45530c3ff8a5f6b80769d16e5e6a0f68.tar.gz
ports-b80a4e5d45530c3ff8a5f6b80769d16e5e6a0f68.zip
This program will help you recover disks with bad sectors.
You can recover files as well complete devices. In case if finds sectors which simply cannot be recoverd, it writes an empty sector to the outputfile and continues. If you're recovering a CD or a DVD and the program cannot read the sector in "normal mode", then the program will try to read the sector in "RAW mode" (without error-checking etc.). This toolkit also has a utility called 'mergebad': mergebad merges multiple images into one. This can be usefull when you have, for example, multiple CD's with the same data which are all damaged. In such case, you can then first use recoverdm to retrieve the data from the damaged CD's into image-files and then combine them into one image with mergebad. WWW: http://www.vanheusden.com/recoverdm/ PR: ports/92148 Submitted by: Jeffrey H. Johnson <CPE1704TKS@bellsouth.net>
Notes
Notes: svn path=/head/; revision=154238
Diffstat (limited to 'sysutils/recoverdm')
-rw-r--r--sysutils/recoverdm/Makefile21
-rw-r--r--sysutils/recoverdm/distinfo3
-rw-r--r--sysutils/recoverdm/files/patch-Makefile38
-rw-r--r--sysutils/recoverdm/files/patch-io.c16
-rw-r--r--sysutils/recoverdm/files/patch-mergebad.c33
-rw-r--r--sysutils/recoverdm/files/patch-recoverdm.c38
-rw-r--r--sysutils/recoverdm/files/patch-utils.h15
-rw-r--r--sysutils/recoverdm/pkg-descr16
-rw-r--r--sysutils/recoverdm/pkg-plist2
9 files changed, 182 insertions, 0 deletions
diff --git a/sysutils/recoverdm/Makefile b/sysutils/recoverdm/Makefile
new file mode 100644
index 000000000000..f68b494a8e90
--- /dev/null
+++ b/sysutils/recoverdm/Makefile
@@ -0,0 +1,21 @@
+# New ports collection makefile for: recoverdm
+# Date created: 22 January 2004
+# Whom: Jeffrey H. Johnson <CPE1704TKS@bellsouth.net>
+#
+# $FreeBSD$
+#
+
+PORTNAME= recoverdm
+PORTVERSION= 0.19
+CATEGORIES= sysutils
+MASTER_SITES= http://www.vanheusden.com/recoverdm/
+EXTRACT_SUFX= .tgz
+
+MAINTAINER= CPE1704TKS@bellsouth.net
+COMMENT= Recover files and discs with damaged sectors
+
+MAN1= recoverdm.1
+
+PLIST_FILES= bin/mergebad bin/recoverdm
+
+.include <bsd.port.mk>
diff --git a/sysutils/recoverdm/distinfo b/sysutils/recoverdm/distinfo
new file mode 100644
index 000000000000..90f4d738864f
--- /dev/null
+++ b/sysutils/recoverdm/distinfo
@@ -0,0 +1,3 @@
+SIZE (recoverdm-0.19.tgz) = 9806
+MD5 (recoverdm-0.19.tgz) = f24050f1ab83584a2bf07e0ef6e5fc66
+SHA256 (recoverdm-0.19.tgz) = 6158eee718d172a655f6581cbda41bc2cc8a0438ce2ad08f2892cf8d31fbd9c5
diff --git a/sysutils/recoverdm/files/patch-Makefile b/sysutils/recoverdm/files/patch-Makefile
new file mode 100644
index 000000000000..002a6f885e2a
--- /dev/null
+++ b/sysutils/recoverdm/files/patch-Makefile
@@ -0,0 +1,38 @@
+*** Makefile.orig Sun Jan 22 05:15:13 2006
+--- Makefile Sun Jan 22 05:22:31 2006
+***************
+*** 1,14 ****
+ VERSION=0.19
+
+! CFLAGS=-Wall -Wshadow -Wconversion -Wwrite-strings -Winline -O2 -DVERSION=\"$(VERSION)\"
+ LDFLAGS=
+
+ OBJSr=recoverdm.o dev.o io.o utils.o error.o
+ OBJSm=mergebad.o io.o utils.o error.o
+
+ all: recoverdm mergebad
+
+ recoverdm: $(OBJSr)
+ $(CC) -Wall -W $(OBJSr) $(LDFLAGS) -o recoverdm
+ strip recoverdm
+ echo
+--- 1,19 ----
+ VERSION=0.19
+
+! CFLAGS+=-Wall -DVERSION=\"$(VERSION)\"
+ LDFLAGS=
+
+ OBJSr=recoverdm.o dev.o io.o utils.o error.o
+ OBJSm=mergebad.o io.o utils.o error.o
+
+ all: recoverdm mergebad
++
++ install:
++ ${INSTALL} -m 755 recoverdm ${PREFIX}/bin
++ ${INSTALL} -m 755 mergebad ${PREFIX}/bin
++ ${INSTALL} -m 644 recoverdm.1 ${PREFIX}/man/man1
+
+ recoverdm: $(OBJSr)
+ $(CC) -Wall -W $(OBJSr) $(LDFLAGS) -o recoverdm
+ strip recoverdm
+ echo
diff --git a/sysutils/recoverdm/files/patch-io.c b/sysutils/recoverdm/files/patch-io.c
new file mode 100644
index 000000000000..bbdf98fe1f7b
--- /dev/null
+++ b/sysutils/recoverdm/files/patch-io.c
@@ -0,0 +1,16 @@
+*** io.c.orig Sun Jan 22 05:18:41 2006
+--- io.c Sun Jan 22 05:18:54 2006
+***************
+*** 9,18 ****
+--- 9,19 ----
+ #include <sys/stat.h>
+
+ #include "io.h"
+ #include "error.h"
+ #include "gen.h"
++ #include "utils.h"
+
+ ssize_t READ(int fd, char *whereto, size_t len)
+ {
+ ssize_t cnt=0;
+
diff --git a/sysutils/recoverdm/files/patch-mergebad.c b/sysutils/recoverdm/files/patch-mergebad.c
new file mode 100644
index 000000000000..7317a12bbf07
--- /dev/null
+++ b/sysutils/recoverdm/files/patch-mergebad.c
@@ -0,0 +1,33 @@
+--- mergebad.c.orig Fri Dec 2 13:34:00 2005
++++ mergebad.c Mon Jan 23 17:00:14 2006
+@@ -193,7 +193,7 @@
+ bbs[n_bb].block_size = block_size;
+
+ if (verbose >= 4)
+- printf("%d] %lld %lld\n", n_bb, offset, block_size);
++ printf("%d] %lld %d\n", n_bb, offset, block_size);
+
+ n_bb++;
+ }
+@@ -293,7 +293,7 @@
+ }
+ else if (strcmp(argv[loop], "-o") == 0)
+ {
+- fd_out = open64(argv[++loop], O_WRONLY | O_CREAT | O_EXCL | O_SYNC, S_IRUSR | S_IWUSR);
++ fd_out = open64(argv[++loop], O_WRONLY | O_CREAT | O_EXCL | O_FSYNC, S_IRUSR | S_IWUSR);
+ if (fd_out == -1)
+ {
+ fprintf(stderr, "Failed to create file %s: %s (%d)\n", argv[loop], strerror(errno), errno);
+@@ -312,10 +312,10 @@
+ }
+ else if (strcmp(argv[loop], "-s") == 0)
+ {
+- length = atoll(argv[++loop]);
++ length = strtoll(argv[++loop], (char **)NULL, 10);
+
+ if (verbose)
+- printf("Length set to: %d\n", length);
++ printf("Length set to: %lld\n", length);
+ }
+ else if (strcmp(argv[loop], "-v") == 0)
+ {
diff --git a/sysutils/recoverdm/files/patch-recoverdm.c b/sysutils/recoverdm/files/patch-recoverdm.c
new file mode 100644
index 000000000000..a364c091e669
--- /dev/null
+++ b/sysutils/recoverdm/files/patch-recoverdm.c
@@ -0,0 +1,38 @@
+--- recoverdm.c.orig Fri Dec 2 13:34:00 2005
++++ recoverdm.c Mon Jan 23 16:51:28 2006
+@@ -179,7 +179,7 @@
+
+ if (rc == 0)
+ {
+- if (create_sector(sector_list, n_raw_retries, block_size, &dummy) == -1)
++ if (create_sector((unsigned char **)sector_list, n_raw_retries, block_size, &dummy) == -1)
+ rc = -1;
+ }
+
+@@ -261,7 +261,7 @@
+ case 'V':
+ return 0;
+ case 'b':
+- start_offset = atoll(optarg);
++ start_offset = strtoll(optarg, (char **)NULL, 10);
+ break;
+ case '?':
+ case 'h':
+@@ -295,7 +295,7 @@
+ buffer = (char *)mymalloc(block_size, "sectorbuffer");
+ buffer2 = (char *)mymalloc(block_size, "sectorbuffer for retries");
+
+- fdout = open64(file_out, O_WRONLY | O_CREAT | O_EXCL | O_SYNC, S_IRUSR | S_IWUSR);
++ fdout = open64(file_out, O_WRONLY | O_CREAT | O_EXCL | O_FSYNC, S_IRUSR | S_IWUSR);
+ if (fdout == -1)
+ {
+ printf("Cannot create file %s! (%s)\n", file_out, strerror(errno));
+@@ -430,7 +430,7 @@
+ /* always mark the sector as tricky */
+ if (dsecfile)
+ {
+- fprintf(dsecfile, "%lld %ld\n", curpos, block_size);
++ fprintf(dsecfile, "%lld %ld\n", curpos, (long)block_size);
+ fflush(dsecfile);
+ }
+
diff --git a/sysutils/recoverdm/files/patch-utils.h b/sysutils/recoverdm/files/patch-utils.h
new file mode 100644
index 000000000000..1e5e57bf0e9e
--- /dev/null
+++ b/sysutils/recoverdm/files/patch-utils.h
@@ -0,0 +1,15 @@
+*** utils.h.orig Sun Jan 22 05:13:01 2006
+--- utils.h Sun Jan 22 05:20:11 2006
+***************
+*** 1,5 ****
+--- 1,10 ----
++ #define off64_t off_t
++ #define stat64 stat
++ #define open64 open
++ #define lseek64 lseek
++
+ void * mymalloc(size_t size, char *what);
+ void * myrealloc(void *oldp, size_t newsize, char *what);
+ off64_t get_filesize(char *filename);
+ int copy_block(int fd_in, int fd_out, off64_t block_size);
+ void myseek(int fd, off64_t offset);
diff --git a/sysutils/recoverdm/pkg-descr b/sysutils/recoverdm/pkg-descr
new file mode 100644
index 000000000000..0e0fcf131447
--- /dev/null
+++ b/sysutils/recoverdm/pkg-descr
@@ -0,0 +1,16 @@
+This program will help you recover disks with bad sectors.
+You can recover files as well complete devices.
+
+In case if finds sectors which simply cannot be recoverd, it writes an
+empty sector to the outputfile and continues. If you're recovering a CD
+or a DVD and the program cannot read the sector in "normal mode", then
+the program will try to read the sector in "RAW mode" (without error-checking
+etc.).
+
+This toolkit also has a utility called 'mergebad': mergebad merges multiple
+images into one. This can be usefull when you have, for example, multiple CD's
+with the same data which are all damaged. In such case, you can then first use
+recoverdm to retrieve the data from the damaged CD's into image-files and then
+combine them into one image with mergebad.
+
+WWW: http://www.vanheusden.com/recoverdm/
diff --git a/sysutils/recoverdm/pkg-plist b/sysutils/recoverdm/pkg-plist
new file mode 100644
index 000000000000..5130f40a3481
--- /dev/null
+++ b/sysutils/recoverdm/pkg-plist
@@ -0,0 +1,2 @@
+bin/mergebad
+bin/recoverdm