151 lines
6.3 KiB
Diff
151 lines
6.3 KiB
Diff
|
Index: Makefile
|
||
|
===================================================================
|
||
|
RCS file: /share/MD0_DATA/cvsroot/dd_rescue/Makefile,v
|
||
|
retrieving revision 1.153
|
||
|
retrieving revision 1.154
|
||
|
diff -u -p -r1.153 -r1.154
|
||
|
--- Makefile 20 May 2014 07:28:01 -0000 1.153
|
||
|
+++ Makefile 21 May 2014 08:27:22 -0000 1.154
|
||
|
@@ -1,6 +1,6 @@
|
||
|
# Makefile for dd_rescue
|
||
|
# (c) garloff@suse.de, 99/10/09, GNU GPL
|
||
|
-# $Id: Makefile,v 1.153 2014/05/20 07:28:01 garloff Exp $
|
||
|
+# $Id: Makefile,v 1.154 2014/05/21 08:27:22 garloff Exp $
|
||
|
|
||
|
VERSION = 1.43
|
||
|
|
||
|
@@ -15,7 +15,8 @@ INSTALLFLAGS = -s
|
||
|
prefix = $(DESTDIR)/usr
|
||
|
INSTALLDIR = $(prefix)/bin
|
||
|
#INSTALLDIR = $(DESTDIR)/bin
|
||
|
-INSTALLLIBDIR = $(prefix)/$(LIB)
|
||
|
+#INSTALLLIBDIR = $(prefix)/$(LIB)
|
||
|
+INSTALLLIBDIR = $(DESTDIR)/$(LIBDIR)
|
||
|
MANDIR = $(prefix)/share/man
|
||
|
#MYDIR = dd_rescue-$(VERSION)
|
||
|
MYDIR = dd_rescue
|
||
|
@@ -279,11 +280,11 @@ check_lzo: $(TARGETS)
|
||
|
$(LZOP) -fd dd_rescue.ddr.lzo
|
||
|
cmp dd_rescue dd_rescue.ddr
|
||
|
@rm -f dd_rescue.ddr dd_rescue.ddr.lzo
|
||
|
- ./dd_rescue -b1M -L ./libddr_MD5.so=output,./libddr_lzo.so=compress,./libddr_MD5.so=output dd_rescue dd_rescue.ddr.lzo > dd_rescue.ddr.MD5SUM
|
||
|
+ ./dd_rescue -b256k -L ./libddr_MD5.so=output,./libddr_lzo.so=compress,./libddr_MD5.so=output dd_rescue dd_rescue.ddr.lzo > dd_rescue.ddr.MD5SUM
|
||
|
md5sum -c dd_rescue.ddr.MD5SUM
|
||
|
md5sum dd_rescue dd_rescue.ddr.lzo
|
||
|
$(LZOP) -Nvl dd_rescue.ddr.lzo
|
||
|
- ./dd_rescue -b1M -TL ./libddr_MD5.so=output,./libddr_lzo.so=compress,./libddr_MD5.so,./libddr_lzo.so=decompress,./libddr_MD5.so=outfd=1 dd_rescue dd_rescue.ddr > dd_rescue.ddr.MD5
|
||
|
+ ./dd_rescue -b256k -TL ./libddr_MD5.so=output,./libddr_lzo.so=compress,./libddr_MD5.so,./libddr_lzo.so=decompress,./libddr_MD5.so=outfd=1 dd_rescue dd_rescue.ddr > dd_rescue.ddr.MD5
|
||
|
cmp dd_rescue dd_rescue.ddr
|
||
|
md5sum -c dd_rescue.ddr.MD5
|
||
|
./dd_rescue -b16k -TL ./libddr_MD5.so=output,./libddr_lzo.so=compress,./libddr_MD5.so,./libddr_lzo.so=decompress,./libddr_MD5.so=outfd=1 dd_rescue dd_rescue.ddr > dd_rescue.ddr.MD5
|
||
|
@@ -292,7 +293,7 @@ check_lzo: $(TARGETS)
|
||
|
@cp -p dd_rescue.ddr.lzo dd_rescue.lzo
|
||
|
@rm -f dd_rescue.ddr dd_rescue.ddr.lzo dd_rescue.ddr.MD5
|
||
|
$(LZOP) -f dd_rescue
|
||
|
- ./dd_rescue -b1M -TL ./libddr_lzo.so dd_rescue.lzo dd_rescue.cmp
|
||
|
+ ./dd_rescue -b256k -TL ./libddr_lzo.so dd_rescue.lzo dd_rescue.cmp
|
||
|
cmp dd_rescue dd_rescue.cmp
|
||
|
@rm -f dd_rescue.cmp dd_rescue.lzo
|
||
|
./dd_rescue -b16k -L ./libddr_MD5.so=output,./libddr_lzo.so,./libddr_MD5.so=output dd_rescue dd_rescue.lzo > MD5.1
|
||
|
Index: ddr_lzo.1
|
||
|
===================================================================
|
||
|
RCS file: /share/MD0_DATA/cvsroot/dd_rescue/ddr_lzo.1,v
|
||
|
retrieving revision 1.8
|
||
|
retrieving revision 1.9
|
||
|
diff -u -p -r1.8 -r1.9
|
||
|
--- ddr_lzo.1 19 May 2014 19:59:25 -0000 1.8
|
||
|
+++ ddr_lzo.1 21 May 2014 08:27:22 -0000 1.9
|
||
|
@@ -1,4 +1,4 @@
|
||
|
-.\" $Id: ddr_lzo.1,v 1.8 2014/05/19 19:59:25 garloff Exp $
|
||
|
+.\" $Id: ddr_lzo.1,v 1.9 2014/05/21 08:27:22 garloff Exp $
|
||
|
.
|
||
|
.TH ddr_lzo 1 "2014-05-12" "Kurt Garloff" "LZO de/compression plugin for dd_rescue"
|
||
|
.
|
||
|
@@ -176,10 +176,11 @@ resulting lzop file to ddr_lzo's own ver
|
||
|
incompatibility with lzop (as of 1.03).
|
||
|
.br
|
||
|
lzop by default uses block sizes of 256kiB (on Unix systems), but
|
||
|
-supports de/compression with different block sizes as well. The
|
||
|
-maximum possible is 64MiB; for reasons of error resilience, it is
|
||
|
-however NOT recommended to use blocks larger than 16MiB, see
|
||
|
-below.
|
||
|
+supports de/compression with smaller block sizes as well. It needs
|
||
|
+to be recompiled to support block sizes up to a possible maximum
|
||
|
+of 64MiB. Thus staying below or at 256kiB is recommended; even
|
||
|
+when lzop compatibility is no concern, blocks larger than 16MiB
|
||
|
+are not recommended, see below.
|
||
|
.
|
||
|
.SS Blocksize considerations
|
||
|
When decompressing, the (soft) block size chosen in dd_rescue must be
|
||
|
@@ -196,8 +197,10 @@ The default from dd_rescue (128kiB) is a
|
||
|
recommended to increase the block size too much -- when an lzo file gets
|
||
|
corrupted, at least one block will be lost; larger blocks result in larger
|
||
|
damage. Also, blocks larger than 16MiB will not work well with the error
|
||
|
-tolerance features of ddr_lzo. Also note that blocks larger than 64MiB
|
||
|
-prevent decompression with lzop.
|
||
|
+tolerance features of ddr_lzo. Also note that blocks larger than 256kiB
|
||
|
+need recompilation of lzop if you want to be able to use lzop to
|
||
|
+process the .lzo files; blocks larger than 64MiB prevent decompression
|
||
|
+even with a recompiled lzop.
|
||
|
.
|
||
|
.SH BUGS/LIMITATIONS
|
||
|
.SS Maturity
|
||
|
@@ -205,7 +208,7 @@ The plugin is new as of dd_rescue 1.43.
|
||
|
saved with ddr_lzo as the only backup for valuable data. Also
|
||
|
expect some changes to ddr_lzo in the not too distant future.
|
||
|
(This should not break the file format, as we're following lzop ....)
|
||
|
-.br
|
||
|
+.br
|
||
|
Compressed data is more sensitive to data corruption than plain data.
|
||
|
Note that the checksums (adler32 or crc32) in the lzop file format
|
||
|
do NOT allow to correct for errors; they just allow a somewhat reliable
|
||
|
Index: libddr_lzo.c
|
||
|
===================================================================
|
||
|
RCS file: /share/MD0_DATA/cvsroot/dd_rescue/libddr_lzo.c,v
|
||
|
retrieving revision 1.107
|
||
|
retrieving revision 1.110
|
||
|
diff -u -p -r1.107 -r1.110
|
||
|
--- libddr_lzo.c 20 May 2014 09:12:23 -0000 1.107
|
||
|
+++ libddr_lzo.c 21 May 2014 09:22:01 -0000 1.110
|
||
|
@@ -6,6 +6,10 @@
|
||
|
* License: GNU GPLv2 or v3
|
||
|
*/
|
||
|
|
||
|
+#ifndef _GNU_SOURCE
|
||
|
+# define _GNU_SOURCE 1
|
||
|
+#endif
|
||
|
+
|
||
|
#define _LARGEFILE64_SOURCE 1
|
||
|
#define _FILE_OFFSET_BITS 64
|
||
|
|
||
|
@@ -41,9 +45,9 @@
|
||
|
#endif
|
||
|
|
||
|
#ifdef HAVE_BASENAME
|
||
|
-const char* basename(const char*);
|
||
|
+//const char* basename(const char*);
|
||
|
#else
|
||
|
-static char* basename(const char *nm)
|
||
|
+static const char* basename(const char *nm)
|
||
|
{
|
||
|
const char* ptr = strrchr(nm, '/'); /* Not on DOS */
|
||
|
if (ptr)
|
||
|
@@ -531,9 +535,14 @@ int lzo_open(const opt_t *opt, int ilnch
|
||
|
state->dbuf = (unsigned char*)slackalloc(state->dbuflen, state);
|
||
|
if (state->do_bench)
|
||
|
state->cpu = 0;
|
||
|
- if (opt->softbs > MAXBLOCKSZ)
|
||
|
- FPLOG(WARN, "Blocks larger than %iMiB not recommended %iMiB specified)\n",
|
||
|
- MAXBLOCKSZ>>20, opt->softbs);
|
||
|
+ if (state->mode == COMPRESS) {
|
||
|
+ if (opt->softbs > MAXBLOCKSZ)
|
||
|
+ FPLOG(WARN, "Blocks larger than %iMiB not recommended (%iMiB specified)\n",
|
||
|
+ MAXBLOCKSZ>>20, opt->softbs>>20);
|
||
|
+ else if (opt->softbs > 256*1024)
|
||
|
+ FPLOG(WARN, "Blocks larger than 256kiB need recompilation of lzop (%ikiB specified)\n",
|
||
|
+ opt->softbs>>10);
|
||
|
+ }
|
||
|
state->next_ipos = opt->init_ipos;
|
||
|
return 0;
|
||
|
/* This breaks MD5 in chain before us
|