Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 244617
Collapse All | Expand All

(-)partimage-0.6.7/README.lzo (+20 lines)
Line 0 Link Here
1
2
                          Partition Image LZO-PATCH              
3
                             -------------------                                         
4
    copyright            : (C) 2008 by Max Bidlingmaier
5
               
6
AUTHOR: Max Bidlingmaier
7
Contact: mbidlingmaier at esigma dash technology dot com
8
                       
9
This program is free software; you can redistribute it and/or modify
10
it under the terms of the GNU General Public License as published by 
11
the Free Software Foundation; either version 2 of the License, or
12
at your option) any later version.
13
14
This Patch enables LZO-compression for Partition Image. LZO is about 3-4 times faster
15
than gzip at the cost of some compression ration (http://www.oberhumer.com/opensource/lzo/)
16
17
To use LZO-compression apply the patch and use configure with --enable-lzo, additional tags are
18
--with-lzo-headers and --with-lzo-lib if configure is unable to find headers and libs
19
20
This Patch is against Partimage 0.6.7
(-)partimage-0.6.7/config.h.in (+5 lines)
Lines 148-153 Link Here
148
/* Define to 1 if you have the <unistd.h> header file. */
148
/* Define to 1 if you have the <unistd.h> header file. */
149
#undef HAVE_UNISTD_H
149
#undef HAVE_UNISTD_H
150
150
151
/* { { echo "$as_me:$LINENO: error: Define to 1 if LZO is enabled" >&5 echo
152
   "$as_me: error: Define to 1 if LZO is enabled" >&2;} { (exit 1); exit 1; };
153
   } */
154
#undef LZO_ENABLED
155
151
/* Define to 1 if you want partimaged to drop privilieges on start */
156
/* Define to 1 if you want partimaged to drop privilieges on start */
152
#undef MUST_CHEUID
157
#undef MUST_CHEUID
153
158
(-)partimage-0.6.7/configure (-33 / +185 lines)
Lines 1-7 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
# From configure.ac Revision: 1.4 .
2
# From configure.ac Revision: 1.4 .
3
# Guess values for system-dependent variables and create Makefiles.
3
# Guess values for system-dependent variables and create Makefiles.
4
# Generated by GNU Autoconf 2.61 for partimage 0.6.7.
4
# Generated by GNU Autoconf 2.61 for partimage 0.6.7-lzo.
5
#
5
#
6
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
6
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
7
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
7
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Lines 727-734 SHELL=${CONFIG_SHELL-/bin/sh} Link Here
727
# Identity of this package.
727
# Identity of this package.
728
PACKAGE_NAME='partimage'
728
PACKAGE_NAME='partimage'
729
PACKAGE_TARNAME='partimage'
729
PACKAGE_TARNAME='partimage'
730
PACKAGE_VERSION='0.6.7'
730
PACKAGE_VERSION='0.6.7-lzo'
731
PACKAGE_STRING='partimage 0.6.7'
731
PACKAGE_STRING='partimage 0.6.7-lzo'
732
PACKAGE_BUGREPORT=''
732
PACKAGE_BUGREPORT=''
733
733
734
# Factoring default headers for most tests.
734
# Factoring default headers for most tests.
Lines 1412-1418 if test "$ac_init_help" = "long"; then Link Here
1412
  # Omit some internal or obsolete options to make the list less imposing.
1412
  # Omit some internal or obsolete options to make the list less imposing.
1413
  # This message is too long to be a string in the A/UX 3.1 sh.
1413
  # This message is too long to be a string in the A/UX 3.1 sh.
1414
  cat <<_ACEOF
1414
  cat <<_ACEOF
1415
\`configure' configures partimage 0.6.7 to adapt to many kinds of systems.
1415
\`configure' configures partimage 0.6.7-lzo to adapt to many kinds of systems.
1416
1416
1417
Usage: $0 [OPTION]... [VAR=VALUE]...
1417
Usage: $0 [OPTION]... [VAR=VALUE]...
1418
1418
Lines 1483-1489 fi Link Here
1483
1483
1484
if test -n "$ac_init_help"; then
1484
if test -n "$ac_init_help"; then
1485
  case $ac_init_help in
1485
  case $ac_init_help in
1486
     short | recursive ) echo "Configuration of partimage 0.6.7:";;
1486
     short | recursive ) echo "Configuration of partimage 0.6.7-lzo:";;
1487
   esac
1487
   esac
1488
  cat <<\_ACEOF
1488
  cat <<\_ACEOF
1489
1489
Lines 1502-1507 Optional Features: Link Here
1502
  --disable-largefile     omit support for large files
1502
  --disable-largefile     omit support for large files
1503
--enable-efence Enable linking with libefence Memory Debugger
1503
--enable-efence Enable linking with libefence Memory Debugger
1504
--disable-ssl       Don't compile ssl mode
1504
--disable-ssl       Don't compile ssl mode
1505
--enable-lzo         Enable LZO-Compression
1505
--enable-devel Enable developpers options (debug, ...)
1506
--enable-devel Enable developpers options (debug, ...)
1506
--enable-pam Enable PAM to authenticate users
1507
--enable-pam Enable PAM to authenticate users
1507
--enable-all-static     build static binaries
1508
--enable-all-static     build static binaries
Lines 1522-1527 Optional Packages: Link Here
1522
  --with-tags[=TAGS]      include additional configurations [automatic]
1523
  --with-tags[=TAGS]      include additional configurations [automatic]
1523
--with-ssl-headers=DIR  SSL Include files location
1524
--with-ssl-headers=DIR  SSL Include files location
1524
--with-ssl-lib=DIR  SSL Library location
1525
--with-ssl-lib=DIR  SSL Library location
1526
--with-lzo-headers=DIR  LZO Include files location
1527
--with-lzo-lib=DIR  LZO Library location
1525
--with-slang-headers=DIR  SLang Include files location
1528
--with-slang-headers=DIR  SLang Include files location
1526
  --with-log-dir=PATH     logfiles /var/log
1529
  --with-log-dir=PATH     logfiles /var/log
1527
  --with-debug-level=X    default debut level used to write the debug logfile 1
1530
  --with-debug-level=X    default debut level used to write the debug logfile 1
Lines 1604-1610 fi Link Here
1604
test -n "$ac_init_help" && exit $ac_status
1607
test -n "$ac_init_help" && exit $ac_status
1605
if $ac_init_version; then
1608
if $ac_init_version; then
1606
  cat <<\_ACEOF
1609
  cat <<\_ACEOF
1607
partimage configure 0.6.7
1610
partimage configure 0.6.7-lzo
1608
generated by GNU Autoconf 2.61
1611
generated by GNU Autoconf 2.61
1609
1612
1610
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
1613
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
Lines 1618-1624 cat >config.log <<_ACEOF Link Here
1618
This file contains any messages produced by compilers while
1621
This file contains any messages produced by compilers while
1619
running configure, to aid debugging if configure makes a mistake.
1622
running configure, to aid debugging if configure makes a mistake.
1620
1623
1621
It was created by partimage $as_me 0.6.7, which was
1624
It was created by partimage $as_me 0.6.7-lzo, which was
1622
generated by GNU Autoconf 2.61.  Invocation command line was
1625
generated by GNU Autoconf 2.61.  Invocation command line was
1623
1626
1624
  $ $0 $@
1627
  $ $0 $@
Lines 2436-2442 fi Link Here
2436
2439
2437
# Define the identity of the package.
2440
# Define the identity of the package.
2438
 PACKAGE='partimage'
2441
 PACKAGE='partimage'
2439
 VERSION='0.6.7'
2442
 VERSION='0.6.7-lzo'
2440
2443
2441
2444
2442
cat >>confdefs.h <<_ACEOF
2445
cat >>confdefs.h <<_ACEOF
Lines 6272-6278 ia64-*-hpux*) Link Here
6272
  ;;
6275
  ;;
6273
*-*-irix6*)
6276
*-*-irix6*)
6274
  # Find out which ABI we are using.
6277
  # Find out which ABI we are using.
6275
  echo '#line 6275 "configure"' > conftest.$ac_ext
6278
  echo '#line 6278 "configure"' > conftest.$ac_ext
6276
  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
6279
  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
6277
  (eval $ac_compile) 2>&5
6280
  (eval $ac_compile) 2>&5
6278
  ac_status=$?
6281
  ac_status=$?
Lines 9070-9080 else Link Here
9070
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9073
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9071
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9074
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9072
   -e 's:$: $lt_compiler_flag:'`
9075
   -e 's:$: $lt_compiler_flag:'`
9073
   (eval echo "\"\$as_me:9073: $lt_compile\"" >&5)
9076
   (eval echo "\"\$as_me:9076: $lt_compile\"" >&5)
9074
   (eval "$lt_compile" 2>conftest.err)
9077
   (eval "$lt_compile" 2>conftest.err)
9075
   ac_status=$?
9078
   ac_status=$?
9076
   cat conftest.err >&5
9079
   cat conftest.err >&5
9077
   echo "$as_me:9077: \$? = $ac_status" >&5
9080
   echo "$as_me:9080: \$? = $ac_status" >&5
9078
   if (exit $ac_status) && test -s "$ac_outfile"; then
9081
   if (exit $ac_status) && test -s "$ac_outfile"; then
9079
     # The compiler can only warn and ignore the option if not recognized
9082
     # The compiler can only warn and ignore the option if not recognized
9080
     # So say no if there are warnings other than the usual output.
9083
     # So say no if there are warnings other than the usual output.
Lines 9360-9370 else Link Here
9360
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9363
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9361
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9364
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9362
   -e 's:$: $lt_compiler_flag:'`
9365
   -e 's:$: $lt_compiler_flag:'`
9363
   (eval echo "\"\$as_me:9363: $lt_compile\"" >&5)
9366
   (eval echo "\"\$as_me:9366: $lt_compile\"" >&5)
9364
   (eval "$lt_compile" 2>conftest.err)
9367
   (eval "$lt_compile" 2>conftest.err)
9365
   ac_status=$?
9368
   ac_status=$?
9366
   cat conftest.err >&5
9369
   cat conftest.err >&5
9367
   echo "$as_me:9367: \$? = $ac_status" >&5
9370
   echo "$as_me:9370: \$? = $ac_status" >&5
9368
   if (exit $ac_status) && test -s "$ac_outfile"; then
9371
   if (exit $ac_status) && test -s "$ac_outfile"; then
9369
     # The compiler can only warn and ignore the option if not recognized
9372
     # The compiler can only warn and ignore the option if not recognized
9370
     # So say no if there are warnings other than the usual output.
9373
     # So say no if there are warnings other than the usual output.
Lines 9464-9474 else Link Here
9464
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9467
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
9465
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9468
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
9466
   -e 's:$: $lt_compiler_flag:'`
9469
   -e 's:$: $lt_compiler_flag:'`
9467
   (eval echo "\"\$as_me:9467: $lt_compile\"" >&5)
9470
   (eval echo "\"\$as_me:9470: $lt_compile\"" >&5)
9468
   (eval "$lt_compile" 2>out/conftest.err)
9471
   (eval "$lt_compile" 2>out/conftest.err)
9469
   ac_status=$?
9472
   ac_status=$?
9470
   cat out/conftest.err >&5
9473
   cat out/conftest.err >&5
9471
   echo "$as_me:9471: \$? = $ac_status" >&5
9474
   echo "$as_me:9474: \$? = $ac_status" >&5
9472
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
9475
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
9473
   then
9476
   then
9474
     # The compiler can only warn and ignore the option if not recognized
9477
     # The compiler can only warn and ignore the option if not recognized
Lines 11826-11832 else Link Here
11826
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11829
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11827
  lt_status=$lt_dlunknown
11830
  lt_status=$lt_dlunknown
11828
  cat > conftest.$ac_ext <<EOF
11831
  cat > conftest.$ac_ext <<EOF
11829
#line 11829 "configure"
11832
#line 11832 "configure"
11830
#include "confdefs.h"
11833
#include "confdefs.h"
11831
11834
11832
#if HAVE_DLFCN_H
11835
#if HAVE_DLFCN_H
Lines 11926-11932 else Link Here
11926
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11929
  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11927
  lt_status=$lt_dlunknown
11930
  lt_status=$lt_dlunknown
11928
  cat > conftest.$ac_ext <<EOF
11931
  cat > conftest.$ac_ext <<EOF
11929
#line 11929 "configure"
11932
#line 11932 "configure"
11930
#include "confdefs.h"
11933
#include "confdefs.h"
11931
11934
11932
#if HAVE_DLFCN_H
11935
#if HAVE_DLFCN_H
Lines 14346-14356 else Link Here
14346
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14349
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14347
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
14350
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
14348
   -e 's:$: $lt_compiler_flag:'`
14351
   -e 's:$: $lt_compiler_flag:'`
14349
   (eval echo "\"\$as_me:14349: $lt_compile\"" >&5)
14352
   (eval echo "\"\$as_me:14352: $lt_compile\"" >&5)
14350
   (eval "$lt_compile" 2>conftest.err)
14353
   (eval "$lt_compile" 2>conftest.err)
14351
   ac_status=$?
14354
   ac_status=$?
14352
   cat conftest.err >&5
14355
   cat conftest.err >&5
14353
   echo "$as_me:14353: \$? = $ac_status" >&5
14356
   echo "$as_me:14356: \$? = $ac_status" >&5
14354
   if (exit $ac_status) && test -s "$ac_outfile"; then
14357
   if (exit $ac_status) && test -s "$ac_outfile"; then
14355
     # The compiler can only warn and ignore the option if not recognized
14358
     # The compiler can only warn and ignore the option if not recognized
14356
     # So say no if there are warnings other than the usual output.
14359
     # So say no if there are warnings other than the usual output.
Lines 14450-14460 else Link Here
14450
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14453
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14451
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
14454
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
14452
   -e 's:$: $lt_compiler_flag:'`
14455
   -e 's:$: $lt_compiler_flag:'`
14453
   (eval echo "\"\$as_me:14453: $lt_compile\"" >&5)
14456
   (eval echo "\"\$as_me:14456: $lt_compile\"" >&5)
14454
   (eval "$lt_compile" 2>out/conftest.err)
14457
   (eval "$lt_compile" 2>out/conftest.err)
14455
   ac_status=$?
14458
   ac_status=$?
14456
   cat out/conftest.err >&5
14459
   cat out/conftest.err >&5
14457
   echo "$as_me:14457: \$? = $ac_status" >&5
14460
   echo "$as_me:14460: \$? = $ac_status" >&5
14458
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
14461
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
14459
   then
14462
   then
14460
     # The compiler can only warn and ignore the option if not recognized
14463
     # The compiler can only warn and ignore the option if not recognized
Lines 16025-16035 else Link Here
16025
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16028
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16026
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
16029
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
16027
   -e 's:$: $lt_compiler_flag:'`
16030
   -e 's:$: $lt_compiler_flag:'`
16028
   (eval echo "\"\$as_me:16028: $lt_compile\"" >&5)
16031
   (eval echo "\"\$as_me:16031: $lt_compile\"" >&5)
16029
   (eval "$lt_compile" 2>conftest.err)
16032
   (eval "$lt_compile" 2>conftest.err)
16030
   ac_status=$?
16033
   ac_status=$?
16031
   cat conftest.err >&5
16034
   cat conftest.err >&5
16032
   echo "$as_me:16032: \$? = $ac_status" >&5
16035
   echo "$as_me:16035: \$? = $ac_status" >&5
16033
   if (exit $ac_status) && test -s "$ac_outfile"; then
16036
   if (exit $ac_status) && test -s "$ac_outfile"; then
16034
     # The compiler can only warn and ignore the option if not recognized
16037
     # The compiler can only warn and ignore the option if not recognized
16035
     # So say no if there are warnings other than the usual output.
16038
     # So say no if there are warnings other than the usual output.
Lines 16129-16139 else Link Here
16129
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16132
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16130
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
16133
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
16131
   -e 's:$: $lt_compiler_flag:'`
16134
   -e 's:$: $lt_compiler_flag:'`
16132
   (eval echo "\"\$as_me:16132: $lt_compile\"" >&5)
16135
   (eval echo "\"\$as_me:16135: $lt_compile\"" >&5)
16133
   (eval "$lt_compile" 2>out/conftest.err)
16136
   (eval "$lt_compile" 2>out/conftest.err)
16134
   ac_status=$?
16137
   ac_status=$?
16135
   cat out/conftest.err >&5
16138
   cat out/conftest.err >&5
16136
   echo "$as_me:16136: \$? = $ac_status" >&5
16139
   echo "$as_me:16139: \$? = $ac_status" >&5
16137
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
16140
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
16138
   then
16141
   then
16139
     # The compiler can only warn and ignore the option if not recognized
16142
     # The compiler can only warn and ignore the option if not recognized
Lines 18329-18339 else Link Here
18329
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
18332
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
18330
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
18333
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
18331
   -e 's:$: $lt_compiler_flag:'`
18334
   -e 's:$: $lt_compiler_flag:'`
18332
   (eval echo "\"\$as_me:18332: $lt_compile\"" >&5)
18335
   (eval echo "\"\$as_me:18335: $lt_compile\"" >&5)
18333
   (eval "$lt_compile" 2>conftest.err)
18336
   (eval "$lt_compile" 2>conftest.err)
18334
   ac_status=$?
18337
   ac_status=$?
18335
   cat conftest.err >&5
18338
   cat conftest.err >&5
18336
   echo "$as_me:18336: \$? = $ac_status" >&5
18339
   echo "$as_me:18339: \$? = $ac_status" >&5
18337
   if (exit $ac_status) && test -s "$ac_outfile"; then
18340
   if (exit $ac_status) && test -s "$ac_outfile"; then
18338
     # The compiler can only warn and ignore the option if not recognized
18341
     # The compiler can only warn and ignore the option if not recognized
18339
     # So say no if there are warnings other than the usual output.
18342
     # So say no if there are warnings other than the usual output.
Lines 18619-18629 else Link Here
18619
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
18622
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
18620
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
18623
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
18621
   -e 's:$: $lt_compiler_flag:'`
18624
   -e 's:$: $lt_compiler_flag:'`
18622
   (eval echo "\"\$as_me:18622: $lt_compile\"" >&5)
18625
   (eval echo "\"\$as_me:18625: $lt_compile\"" >&5)
18623
   (eval "$lt_compile" 2>conftest.err)
18626
   (eval "$lt_compile" 2>conftest.err)
18624
   ac_status=$?
18627
   ac_status=$?
18625
   cat conftest.err >&5
18628
   cat conftest.err >&5
18626
   echo "$as_me:18626: \$? = $ac_status" >&5
18629
   echo "$as_me:18629: \$? = $ac_status" >&5
18627
   if (exit $ac_status) && test -s "$ac_outfile"; then
18630
   if (exit $ac_status) && test -s "$ac_outfile"; then
18628
     # The compiler can only warn and ignore the option if not recognized
18631
     # The compiler can only warn and ignore the option if not recognized
18629
     # So say no if there are warnings other than the usual output.
18632
     # So say no if there are warnings other than the usual output.
Lines 18723-18733 else Link Here
18723
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
18726
   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
18724
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
18727
   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
18725
   -e 's:$: $lt_compiler_flag:'`
18728
   -e 's:$: $lt_compiler_flag:'`
18726
   (eval echo "\"\$as_me:18726: $lt_compile\"" >&5)
18729
   (eval echo "\"\$as_me:18729: $lt_compile\"" >&5)
18727
   (eval "$lt_compile" 2>out/conftest.err)
18730
   (eval "$lt_compile" 2>out/conftest.err)
18728
   ac_status=$?
18731
   ac_status=$?
18729
   cat out/conftest.err >&5
18732
   cat out/conftest.err >&5
18730
   echo "$as_me:18730: \$? = $ac_status" >&5
18733
   echo "$as_me:18733: \$? = $ac_status" >&5
18731
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
18734
   if (exit $ac_status) && test -s out/conftest2.$ac_objext
18732
   then
18735
   then
18733
     # The compiler can only warn and ignore the option if not recognized
18736
     # The compiler can only warn and ignore the option if not recognized
Lines 24841-24846 if test "${with_ssl_lib+set}" = set; the Link Here
24841
fi
24844
fi
24842
24845
24843
24846
24847
#lzo enabled
24848
# Check whether --enable-lzo was given.
24849
if test "${enable_lzo+set}" = set; then
24850
  enableval=$enable_lzo; LZO=$enableval
24851
else
24852
  LZO=no
24853
24854
fi
24855
24856
24857
24858
# Check whether --with-lzo-headers was given.
24859
if test "${with_lzo_headers+set}" = set; then
24860
  withval=$with_lzo_headers; LZO_HDR_DIR="$withval"
24861
    CPPFLAGS="$CPPFLAGS -I$withval"
24862
24863
fi
24864
24865
24866
24867
# Check whether --with-lzo-lib was given.
24868
if test "${with_lzo_lib+set}" = set; then
24869
  withval=$with_lzo_lib; LIBS="$LIBS -L$withval"
24870
24871
fi
24872
24873
24844
24874
24845
# Check whether --with-slang-headers was given.
24875
# Check whether --with-slang-headers was given.
24846
if test "${with_slang_headers+set}" = set; then
24876
if test "${with_slang_headers+set}" = set; then
Lines 28793-28798 echo "$as_me: error: SSL Headers not fo Link Here
28793
28823
28794
fi
28824
fi
28795
28825
28826
if test "$LZO" = "yes"; then
28827
28828
  { echo "$as_me:$LINENO: result: " >&5
28829
echo "${ECHO_T}" >&6; }
28830
  { echo "$as_me:$LINENO: checking  for LZO Library Header files ... ..." >&5
28831
echo "$as_me: checking  for LZO Library Header files ... ..." >&6;}
28832
28833
    { echo "$as_me:$LINENO: checking \"for lzo1x.h lzoconf.h\"" >&5
28834
echo $ECHO_N "checking \"for lzo1x.h lzoconf.h\"... $ECHO_C" >&6; }
28835
    ac_hdr_found=no
28836
    for p in $LZO_HDR_DIR /usr/include /usr/include/lzo; do
28837
28838
    ac_file_found=yes
28839
    for f in lzo1x.h lzoconf.h; do
28840
	if test ! -f $p/$f; then
28841
    	   ac_file_found=no
28842
	   break;
28843
	fi
28844
    done
28845
28846
    if test "$ac_file_found" = "yes" ; then
28847
28848
     	       ac_hdr_found=yes
28849
	       break
28850
28851
28852
    else
28853
	:
28854
    fi
28855
28856
    done
28857
    if test "$ac_hdr_found" = "yes" ; then
28858
 	CPPFLAGS="$CPPFLAGS -I$p"
28859
        { echo "$as_me:$LINENO: result: ($p) yes " >&5
28860
echo "${ECHO_T}($p) yes " >&6; }
28861
	 { echo "$as_me:$LINENO: checking for lzo1x_1_compress in -llzo" >&5
28862
echo $ECHO_N "checking for lzo1x_1_compress in -llzo... $ECHO_C" >&6; }
28863
if test "${ac_cv_lib_lzo_lzo1x_1_compress+set}" = set; then
28864
  echo $ECHO_N "(cached) $ECHO_C" >&6
28865
else
28866
  ac_check_lib_save_LIBS=$LIBS
28867
LIBS="-llzo  $LIBS"
28868
cat >conftest.$ac_ext <<_ACEOF
28869
/* confdefs.h.  */
28870
_ACEOF
28871
cat confdefs.h >>conftest.$ac_ext
28872
cat >>conftest.$ac_ext <<_ACEOF
28873
/* end confdefs.h.  */
28874
28875
/* Override any GCC internal prototype to avoid an error.
28876
   Use char because int might match the return type of a GCC
28877
   builtin and then its argument prototype would still apply.  */
28878
#ifdef __cplusplus
28879
extern "C"
28880
#endif
28881
char lzo1x_1_compress ();
28882
int
28883
main ()
28884
{
28885
return lzo1x_1_compress ();
28886
  ;
28887
  return 0;
28888
}
28889
_ACEOF
28890
rm -f conftest.$ac_objext conftest$ac_exeext
28891
if { (ac_try="$ac_link"
28892
case "(($ac_try" in
28893
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
28894
  *) ac_try_echo=$ac_try;;
28895
esac
28896
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
28897
  (eval "$ac_link") 2>conftest.er1
28898
  ac_status=$?
28899
  grep -v '^ *+' conftest.er1 >conftest.err
28900
  rm -f conftest.er1
28901
  cat conftest.err >&5
28902
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
28903
  (exit $ac_status); } && {
28904
	 test -z "$ac_c_werror_flag" ||
28905
	 test ! -s conftest.err
28906
       } && test -s conftest$ac_exeext &&
28907
       $as_test_x conftest$ac_exeext; then
28908
  ac_cv_lib_lzo_lzo1x_1_compress=yes
28909
else
28910
  echo "$as_me: failed program was:" >&5
28911
sed 's/^/| /' conftest.$ac_ext >&5
28912
28913
	ac_cv_lib_lzo_lzo1x_1_compress=no
28914
fi
28915
28916
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
28917
      conftest$ac_exeext conftest.$ac_ext
28918
LIBS=$ac_check_lib_save_LIBS
28919
fi
28920
{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo_lzo1x_1_compress" >&5
28921
echo "${ECHO_T}$ac_cv_lib_lzo_lzo1x_1_compress" >&6; }
28922
if test $ac_cv_lib_lzo_lzo1x_1_compress = yes; then
28923
  LIBS="$LIBS -llzo"
28924
else
28925
  { { echo "$as_me:$LINENO: error:  Required for LZO Compression Library not found. " >&5
28926
echo "$as_me: error:  Required for LZO Compression Library not found. " >&2;}
28927
   { (exit 1); exit 1; }; }
28928
28929
fi
28930
28931
28932
    else
28933
        { echo "$as_me:$LINENO: result: \"no\"" >&5
28934
echo "${ECHO_T}\"no\"" >&6; }
28935
	{ { echo "$as_me:$LINENO: error:  LZO Headers not found. " >&5
28936
echo "$as_me: error:  LZO Headers not found. " >&2;}
28937
   { (exit 1); exit 1; }; }
28938
28939
    fi
28940
28941
28942
cat >>confdefs.h <<\_ACEOF
28943
#define LZO_ENABLED 1
28944
_ACEOF
28945
28946
fi
28947
28796
# Check whether --enable-login was given.
28948
# Check whether --enable-login was given.
28797
if test "${enable_login+set}" = set; then
28949
if test "${enable_login+set}" = set; then
28798
  enableval=$enable_login;
28950
  enableval=$enable_login;
Lines 29358-29364 exec 6>&1 Link Here
29358
# report actual input values of CONFIG_FILES etc. instead of their
29510
# report actual input values of CONFIG_FILES etc. instead of their
29359
# values after options handling.
29511
# values after options handling.
29360
ac_log="
29512
ac_log="
29361
This file was extended by partimage $as_me 0.6.7, which was
29513
This file was extended by partimage $as_me 0.6.7-lzo, which was
29362
generated by GNU Autoconf 2.61.  Invocation command line was
29514
generated by GNU Autoconf 2.61.  Invocation command line was
29363
29515
29364
  CONFIG_FILES    = $CONFIG_FILES
29516
  CONFIG_FILES    = $CONFIG_FILES
Lines 29411-29417 Report bugs to <bug-autoconf@gnu.org>." Link Here
29411
_ACEOF
29563
_ACEOF
29412
cat >>$CONFIG_STATUS <<_ACEOF
29564
cat >>$CONFIG_STATUS <<_ACEOF
29413
ac_cs_version="\\
29565
ac_cs_version="\\
29414
partimage config.status 0.6.7
29566
partimage config.status 0.6.7-lzo
29415
configured by $0, generated by GNU Autoconf 2.61,
29567
configured by $0, generated by GNU Autoconf 2.61,
29416
  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
29568
  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
29417
29569
(-)partimage-0.6.7/configure.ac (-1 / +34 lines)
Lines 8-14 AC_REVISION([[$Revision: 1.4 $]]) Link Here
8
8
9
AC_PREREQ(2.59c)
9
AC_PREREQ(2.59c)
10
10
11
AC_INIT([partimage], [0.6.7])
11
AC_INIT([partimage], [0.6.7-lzo])
12
12
13
AC_CANONICAL_SYSTEM
13
AC_CANONICAL_SYSTEM
14
AC_CONFIG_MACRO_DIR([m4])
14
AC_CONFIG_MACRO_DIR([m4])
Lines 136-141 AC_ARG_WITH(ssl-lib, Link Here
136
  LIBS="$LIBS -L$withval"
136
  LIBS="$LIBS -L$withval"
137
)
137
)
138
138
139
#lzo enabled
140
AC_ARG_ENABLE(lzo,
141
    [--enable-lzo         Enable LZO-Compression],
142
    LZO=$enableval,
143
    LZO=no
144
)
145
146
AC_ARG_WITH(lzo-headers,
147
    [--with-lzo-headers=DIR  LZO Include files location],
148
    LZO_HDR_DIR="$withval"
149
    CPPFLAGS="$CPPFLAGS -I$withval"
150
)
151
152
AC_ARG_WITH(lzo-lib,
153
    [--with-lzo-lib=DIR  LZO Library location],
154
    LIBS="$LIBS -L$withval"
155
)
156
139
dnl SLang location
157
dnl SLang location
140
AC_ARG_WITH(slang-headers,
158
AC_ARG_WITH(slang-headers,
141
    [--with-slang-headers=DIR  SLang Include files location],
159
    [--with-slang-headers=DIR  SLang Include files location],
Lines 253-258 if test "$SSL" = "yes"; then Link Here
253
  )
271
  )
254
fi
272
fi
255
273
274
if test "$LZO" = "yes"; then
275
276
  AC_MSG_RESULT()
277
  AC_CHECKING([ for LZO Library Header files ... ])
278
  AC_SEARCH_HEADERS(lzo1x.h lzoconf.h, $LZO_HDR_DIR /usr/include /usr/include/lzo,
279
    [ AC_CHECK_LIB(lzo, lzo1x_1_compress, [LIBS="$LIBS -llzo"],
280
        AC_MSG_ERROR([ Required for LZO Compression Library not found. ])
281
      )
282
    ],
283
    AC_MSG_ERROR([ LZO Headers not found. ])
284
  )
285
  AC_DEFINE([LZO_ENABLED], 1,
286
    AC_MSG_ERROR([Define to 1 if LZO is enabled]))
287
fi
288
256
dnl Client must login.
289
dnl Client must login.
257
dnl Don't remove the comma, it's required.
290
dnl Don't remove the comma, it's required.
258
AC_ARG_ENABLE(login,
291
AC_ARG_ENABLE(login,
(-)partimage-0.6.7/src/client/gui_text.cpp (-1 / +12 lines)
Lines 332-337 int CSaveOptWindow::create(char *szImage Link Here
332
  m_radioCompNone = newtRadiobutton(1, 2, i18n("None (very fast + very big file)"), options.dwCompression == COMPRESS_NONE, NULL);
332
  m_radioCompNone = newtRadiobutton(1, 2, i18n("None (very fast + very big file)"), options.dwCompression == COMPRESS_NONE, NULL);
333
  m_radioCompGzip = newtRadiobutton(1, 3, "Gzip (.gz: medium speed + small image file)", options.dwCompression == COMPRESS_GZIP, m_radioCompNone);
333
  m_radioCompGzip = newtRadiobutton(1, 3, "Gzip (.gz: medium speed + small image file)", options.dwCompression == COMPRESS_GZIP, m_radioCompNone);
334
  m_radioCompBzip2 = newtRadiobutton(1, 4, "Bzip2 (.bz2: very slow + very small image file)", options.dwCompression == COMPRESS_BZIP2, m_radioCompGzip);
334
  m_radioCompBzip2 = newtRadiobutton(1, 4, "Bzip2 (.bz2: very slow + very small image file)", options.dwCompression == COMPRESS_BZIP2, m_radioCompGzip);
335
#ifdef LZO_ENABLED
336
  m_radioCompLzo = newtRadiobutton(1, 5, "LZO (.lzo: fast + not to small)", options.dwCompression == COMPRESS_LZO, m_radioCompBzip2);
337
#endif
335
338
336
  m_labelOptions = newtLabel(1, 7, i18n("Options"));
339
  m_labelOptions = newtLabel(1, 7, i18n("Options"));
337
  m_checkCheckBeforeSaving = newtCheckbox(1, 8, i18n("Check partition before saving"), (!!options.bCheckBeforeSaving ? 'X' : ' '), " X", NULL);
340
  m_checkCheckBeforeSaving = newtCheckbox(1, 8, i18n("Check partition before saving"), (!!options.bCheckBeforeSaving ? 'X' : ' '), " X", NULL);
Lines 357-363 int CSaveOptWindow::create(char *szImage Link Here
357
  
360
  
358
  m_formMain = newtForm(NULL, NULL, 0);
361
  m_formMain = newtForm(NULL, NULL, 0);
359
  newtFormAddComponents(m_formMain, m_labelCompression, m_labelOptions, m_labelSplit, NULL);
362
  newtFormAddComponents(m_formMain, m_labelCompression, m_labelOptions, m_labelSplit, NULL);
360
  newtFormAddComponents(m_formMain, m_radioCompNone, m_radioCompGzip, m_radioCompBzip2, m_checkCheckBeforeSaving, m_checkAskDesc, m_checkOverwrite, NULL);
363
  newtFormAddComponents(m_formMain, m_radioCompNone, m_radioCompGzip, m_radioCompBzip2, m_radioCompLzo, m_checkCheckBeforeSaving, m_checkAskDesc, m_checkOverwrite, NULL);
361
  newtFormAddComponents(m_formMain, m_labelFinish, m_radioFinishWait, m_radioFinishHalt, m_radioFinishReboot, m_radioFinishQuit, m_radioFinishLast, NULL);	
364
  newtFormAddComponents(m_formMain, m_labelFinish, m_radioFinishWait, m_radioFinishHalt, m_radioFinishReboot, m_radioFinishQuit, m_radioFinishLast, NULL);	
362
  newtFormAddComponents(m_formMain, m_radioSplitAuto, m_radioSplitSize, m_labelSplitSizeKB, m_editSplitSize, m_checkSplitWait, NULL);
365
  newtFormAddComponents(m_formMain, m_radioSplitAuto, m_radioSplitSize, m_labelSplitSizeKB, m_editSplitSize, m_checkSplitWait, NULL);
363
  addHotKeys();
366
  addHotKeys();
Lines 384-389 int CSaveOptWindow::getValues(COptions * Link Here
384
    options->dwCompression = COMPRESS_GZIP;
387
    options->dwCompression = COMPRESS_GZIP;
385
  else if (newtRadioGetCurrent(m_radioCompNone) == m_radioCompBzip2)
388
  else if (newtRadioGetCurrent(m_radioCompNone) == m_radioCompBzip2)
386
    options->dwCompression = COMPRESS_BZIP2;
389
    options->dwCompression = COMPRESS_BZIP2;
390
#ifdef LZO_ENABLED
391
  else if (newtRadioGetCurrent(m_radioCompNone) == m_radioCompLzo)
392
    options->dwCompression = COMPRESS_LZO;
393
#endif
387
  
394
  
388
  // get finish level
395
  // get finish level
389
  if (newtRadioGetCurrent(m_radioFinishWait) == m_radioFinishWait)
396
  if (newtRadioGetCurrent(m_radioFinishWait) == m_radioFinishWait)
Lines 485-493 int CSavingWindow::create(const char *sz Link Here
485
    case COMPRESS_BZIP2:
492
    case COMPRESS_BZIP2:
486
      SNPRINTF(szTemp, i18n("Compression level:...........bzip2"));
493
      SNPRINTF(szTemp, i18n("Compression level:...........bzip2"));
487
      break;
494
      break;
495
#ifdef LZO_ENABLED
488
    case COMPRESS_LZO:
496
    case COMPRESS_LZO:
489
      SNPRINTF(szTemp, i18n("Compression level:...........lzo"));
497
      SNPRINTF(szTemp, i18n("Compression level:...........lzo"));
490
      break;
498
      break;
499
#endif
491
    }
500
    }
492
  m_labelCompression = newtLabel(1, 6, szTemp);
501
  m_labelCompression = newtLabel(1, 6, szTemp);
493
502
Lines 898-907 void CRestoringWindow::showImageFileInfo Link Here
898
	  SNPRINTF(szTemp, i18n("Compression level:................bzip2"));
907
	  SNPRINTF(szTemp, i18n("Compression level:................bzip2"));
899
          SNPRINTF(szTemp2, i18n("bzip2"));
908
          SNPRINTF(szTemp2, i18n("bzip2"));
900
	  break;
909
	  break;
910
#ifdef LZO_ENABLED
901
	case COMPRESS_LZO:
911
	case COMPRESS_LZO:
902
	  SNPRINTF(szTemp, i18n("Compression level:................lzo"));
912
	  SNPRINTF(szTemp, i18n("Compression level:................lzo"));
903
          SNPRINTF(szTemp2, i18n("lzo"));
913
          SNPRINTF(szTemp2, i18n("lzo"));
904
	  break;
914
	  break;
915
#endif
905
	default:
916
	default:
906
          memset(szTemp2, 0, sizeof(szTemp2));
917
          memset(szTemp2, 0, sizeof(szTemp2));
907
        SNPRINTF(szTemp3, i18n("Compression level:................%s"),szTemp2);
918
        SNPRINTF(szTemp3, i18n("Compression level:................%s"),szTemp2);
(-)partimage-0.6.7/src/client/gui_text.h (-1 / +1 lines)
Lines 77-83 class CSaveOptWindow: public COptionsWin Link Here
77
 private:
77
 private:
78
  //newtComponent m_formMain;
78
  //newtComponent m_formMain;
79
  newtComponent m_labelCompression, m_labelOptions, m_labelSplit;
79
  newtComponent m_labelCompression, m_labelOptions, m_labelSplit;
80
  newtComponent m_radioCompNone, m_radioCompLzop, m_radioCompGzip, m_radioCompBzip2;
80
  newtComponent m_radioCompNone, m_radioCompLzop, m_radioCompGzip, m_radioCompBzip2, m_radioCompLzo;
81
  newtComponent m_radioSplitSize, m_labelSplitSizeKB, m_radioSplitAuto;
81
  newtComponent m_radioSplitSize, m_labelSplitSizeKB, m_radioSplitAuto;
82
  newtComponent m_checkCheckBeforeSaving, m_checkAskDesc, m_checkOverwrite;
82
  newtComponent m_checkCheckBeforeSaving, m_checkAskDesc, m_checkOverwrite;
83
  newtComponent m_editSplitSize, m_checkSplitWait;
83
  newtComponent m_editSplitSize, m_checkSplitWait;
(-)partimage-0.6.7/src/client/imagefile.cpp (-1 / +256 lines)
Lines 43-48 Link Here
43
43
44
#include <zlib.h> // gzip compression
44
#include <zlib.h> // gzip compression
45
#include <bzlib.h> // bzip2 compression
45
#include <bzlib.h> // bzip2 compression
46
#ifdef LZO_ENABLED
47
  #include <lzo1x.h> // lzo compression
48
  #include <lzoutil.h>
49
#endif
46
50
47
CParam g_param;
51
CParam g_param;
48
52
Lines 129-134 CImage::CImage(COptions * options) Link Here
129
  m_fImageFile = NULL;	
133
  m_fImageFile = NULL;	
130
  m_gzImageFile = NULL;
134
  m_gzImageFile = NULL;
131
  m_bzImageFile = NULL;
135
  m_bzImageFile = NULL;
136
  m_lzoImageFile = NULL;
132
137
133
  RETURN;
138
  RETURN;
134
}
139
}
Lines 274-279 void CImage::writeSplit() Link Here
274
279
275
  RETURN;
280
  RETURN;
276
}
281
}
282
#ifdef LZO_ENABLED 
283
lzo_uint CImage::xread(FILE *f, lzo_voidp buf, lzo_uint len, lzo_bool allow_eof)
284
{
285
        lzo_uint l;
286
287
        l = lzo_fread(f,buf,len);
288
        if (l > len)
289
        {
290
                fprintf(stderr,"\nsomething's wrong with your C library !!!\n");
291
                exit(1);
292
        }
293
        if (l != len && !allow_eof)
294
        {
295
                fprintf(stderr,"\nread error - premature end of file\n");
296
                exit(1);
297
        }
298
        return l;
299
}
300
301
lzo_uint CImage::xwrite(FILE *f, const lzo_voidp buf, lzo_uint len)
302
{
303
        if (f != NULL && lzo_fwrite(f,buf,len) != len)
304
        {
305
                fprintf(stderr,"\nwrite error  (disk full ?)\n");
306
                exit(1);
307
        }
308
        return len;
309
}
310
311
312
int CImage::xgetc(FILE *f)
313
{
314
        unsigned char c;
315
        xread(f,(lzo_bytep) &c,1,0);
316
        return c;
317
}
318
319
void CImage::xputc(FILE *f, int c)
320
{
321
        unsigned char cc = (unsigned char) c;
322
        xwrite(f,(lzo_bytep) &cc,1);
323
}
324
325
/* read and write portable 32-bit integers */
326
327
lzo_uint32 CImage::xread32(FILE *f)
328
{
329
        unsigned char b[4];
330
        lzo_uint32 v;
331
332
        xread(f,b,4,0);
333
        v  = (lzo_uint32) b[3] <<  0;
334
        v |= (lzo_uint32) b[2] <<  8;
335
        v |= (lzo_uint32) b[1] << 16;
336
        v |= (lzo_uint32) b[0] << 24;
337
        return v;
338
}
339
340
void CImage::xwrite32(FILE *f, lzo_uint32 v)
341
{
342
        unsigned char b[4];
343
344
        b[3] = (unsigned char) (v >>  0);
345
        b[2] = (unsigned char) (v >>  8);
346
        b[1] = (unsigned char) (v >> 16);
347
        b[0] = (unsigned char) (v >> 24);
348
        xwrite(f,b,4);
349
}
350
#endif
277
351
278
// =======================================================
352
// =======================================================
279
void CImage::write(void *vBuf, DWORD dwLength, bool bUpdateCRC)
353
void CImage::write(void *vBuf, DWORD dwLength, bool bUpdateCRC)
Lines 283-288 void CImage::write(void *vBuf, DWORD dwL Link Here
283
  QWORD qwFreeSpace; //, qwCurrentSize;
357
  QWORD qwFreeSpace; //, qwCurrentSize;
284
  char *cBuf;
358
  char *cBuf;
285
  DWORD dwRes;
359
  DWORD dwRes;
360
  DWORD outLen;
361
#ifdef LZO_ENABLED
362
  lzo_byte *outBuf;
363
  lzo_byte *cLzoBuffer;
364
#endif
365
  int nRes;
286
366
287
  BEGIN;
367
  BEGIN;
288
368
Lines 341-346 void CImage::write(void *vBuf, DWORD dwL Link Here
341
    dwRes = (DWORD) gzwrite(m_gzImageFile, cBuf, dwLength);
421
    dwRes = (DWORD) gzwrite(m_gzImageFile, cBuf, dwLength);
342
  else if (m_options.dwCompression == COMPRESS_BZIP2)
422
  else if (m_options.dwCompression == COMPRESS_BZIP2)
343
    dwRes = (DWORD) BZ2_bzwrite(m_bzImageFile, cBuf, dwLength); 
423
    dwRes = (DWORD) BZ2_bzwrite(m_bzImageFile, cBuf, dwLength); 
424
#ifdef LZO_ENABLED
425
  else if (m_options.dwCompression == COMPRESS_LZO)
426
    {
427
            outBuf = (lzo_bytep) lzo_malloc(dwLength + dwLength / 64 + 16 + 3);
428
            cLzoBuffer = (lzo_bytep) lzo_malloc(LZO1X_1_MEM_COMPRESS);
429
	    checksum = lzo_adler32(checksum, (BYTE*)cBuf, dwLength);
430
431
	    nRes = lzo1x_1_compress((BYTE*)cBuf, dwLength, outBuf, &outLen, cLzoBuffer);
432
	    if (nRes != LZO_E_OK) 
433
		showDebug(1, "ERROR: Compress LZO failed");
434
	    else
435
	      dwRes = dwLength;
436
	    //write uncompressed blocksize
437
	    xwrite32(m_lzoImageFile, dwLength);
438
	    if (outLen < dwLength)
439
	    {
440
	      //write compressed block
441
	      xwrite32(m_lzoImageFile, outLen); //blocklength
442
	      xwrite(m_lzoImageFile, outBuf, outLen); //write block
443
	    } 
444
	    else 
445
	    {
446
	      //uncompressible, write original block
447
	      xwrite32(m_lzoImageFile, dwLength); //blocklength
448
	      xwrite(m_lzoImageFile, (BYTE*)cBuf, dwLength); //write block
449
	    }
450
	    lzo_free(outBuf);
451
	    lzo_free(cLzoBuffer);
452
    }
453
#endif
344
  else
454
  else
345
    THROW(ERR_COMP);
455
    THROW(ERR_COMP);
346
  
456
  
Lines 381-386 void CImage::read(char *cBuf, DWORD dwLe Link Here
381
  static QWORD qwCount = 0LL;
491
  static QWORD qwCount = 0LL;
382
  DWORD dwRes;
492
  DWORD dwRes;
383
  int nRes;
493
  int nRes;
494
#ifdef LZO_ENABLED
495
  int lzoErr;
496
  DWORD unClen;
497
  lzo_byte *outBuf;
498
#endif
499
500
  DWORD outLen;
384
 
501
 
385
  if (dwLength != 1) // avoid having BUFFER_BLOCK_SIZE messages with imginfo and restmbr
502
  if (dwLength != 1) // avoid having BUFFER_BLOCK_SIZE messages with imginfo and restmbr
386
    showDebug(4, "begin of ci::read: size=%lu, pos=%lld\n", dwLength, qwTotalBytes);
503
    showDebug(4, "begin of ci::read: size=%lu, pos=%lld\n", dwLength, qwTotalBytes);
Lines 391-396 void CImage::read(char *cBuf, DWORD dwLe Link Here
391
    nRes = gzread(m_gzImageFile, cBuf, dwLength);
508
    nRes = gzread(m_gzImageFile, cBuf, dwLength);
392
  else if (m_options.dwCompression == COMPRESS_BZIP2)
509
  else if (m_options.dwCompression == COMPRESS_BZIP2)
393
    nRes = BZ2_bzread(m_bzImageFile, cBuf, dwLength);
510
    nRes = BZ2_bzread(m_bzImageFile, cBuf, dwLength);
511
#ifdef LZO_ENABLED
512
  else if (m_options.dwCompression == COMPRESS_LZO)
513
     {
514
	lzo_uint unCSize;
515
	lzo_uint coCSize;
516
	unCSize = xread32(m_lzoImageFile); // read uncompressed size
517
	if (unCSize == 0){
518
	  showDebug(3, "GOT LZO END OF FILE MARK");
519
          nRes = 0;
520
	  g_nThreadState = THREAD_EOF;
521
	}
522
	else
523
	{
524
	  coCSize = xread32(m_lzoImageFile); //read compressed size
525
          outBuf = (lzo_bytep) lzo_malloc(coCSize + 16);
526
	  xread(m_lzoImageFile, outBuf, coCSize, 0); // read block
527
	  if (coCSize < unCSize) //block has been compressed
528
	  {
529
            lzo_uint new_len = unCSize;
530
	    lzoErr = lzo1x_decompress(outBuf, nRes, (BYTE*)cBuf, &unClen, NULL);
531
  	    if (lzoErr != LZO_E_OK)
532
	      showDebug(3, "ERROR with demcompression %d", lzoErr);
533
	    checksum = lzo_adler32(checksum,(BYTE*)cBuf,unClen);
534
	  }
535
	  else
536
	  { //block has been incompressible
537
	    memcpy((BYTE*)cBuf, outBuf, unCSize);
538
	    unClen = unCSize;
539
	    checksum = lzo_adler32(checksum,(BYTE*)cBuf,unClen);
540
	  }
541
542
          nRes = unClen;
543
	  lzo_free(outBuf);
544
	}
545
     }
546
#endif
394
  else
547
  else
395
    THROW(ERR_COMP);
548
    THROW(ERR_COMP);
396
549
Lines 423-429 void CImage::read(char *cBuf, DWORD dwLe Link Here
423
	  read(cBuf+dwFirstRead, dwLength-dwFirstRead, bUpdateCRC);
576
	  read(cBuf+dwFirstRead, dwLength-dwFirstRead, bUpdateCRC);
424
          m_guiRestore -> showImageFileInfo(get_szImageFilename(), m_options.dwCompression, m_options.szFullyBatchMode);
577
          m_guiRestore -> showImageFileInfo(get_szImageFilename(), m_options.dwCompression, m_options.szFullyBatchMode);
425
        }
578
        }
426
      else if ((g_nThreadState == THREAD_ASKEXIT) || (g_nThreadState == THREAD_FINISHED) )
579
      else if ((g_nThreadState == THREAD_ASKEXIT) || (g_nThreadState == THREAD_FINISHED))
427
	{
580
	{
428
	  showDebug(1, "READ ERROR 2: dwLength=%lu and dwRes=%lu and g_nThreadState=%d\n", dwLength, dwRes, g_nThreadState);
581
	  showDebug(1, "READ ERROR 2: dwLength=%lu and dwRes=%lu and g_nThreadState=%d\n", dwLength, dwRes, g_nThreadState);
429
	}
582
	}
Lines 573-578 void CImage::closeReading(bool bForceExi Link Here
573
    }
726
    }
574
  else if (m_options.dwCompression == COMPRESS_BZIP2) // Bzip2 compression
727
  else if (m_options.dwCompression == COMPRESS_BZIP2) // Bzip2 compression
575
    BZ2_bzclose(m_bzImageFile);
728
    BZ2_bzclose(m_bzImageFile);
729
#ifdef LZO_ENABLED
730
  else if (m_options.dwCompression == COMPRESS_LZO) // LZO compression
731
    {
732
    lzo_uint32 cSumInFile;
733
    cSumInFile = xread32(m_lzoImageFile); //read EOF-Mark or checksum
734
    if (cSumInFile == 0) //if eof mark has been read, read checksum
735
      cSumInFile = xread32(m_lzoImageFile); //read checksum
736
      if (checksum == cSumInFile)
737
        showDebug(1, "Checksum verified OK");
738
      else
739
        showDebug(1, "Checksum verified NOT OK");
740
      nRes = fclose(m_lzoImageFile);
741
    }
742
#endif
576
  if (nRes)
743
  if (nRes)
577
    THROW(ERR_ERRNO, errno);
744
    THROW(ERR_ERRNO, errno);
578
745
Lines 604-609 void CImage::closeWriting() Link Here
604
    nRes = gzclose(m_gzImageFile);
771
    nRes = gzclose(m_gzImageFile);
605
  else if (m_options.dwCompression == COMPRESS_BZIP2) // Bzip2 compression
772
  else if (m_options.dwCompression == COMPRESS_BZIP2) // Bzip2 compression
606
    BZ2_bzclose(m_bzImageFile);
773
    BZ2_bzclose(m_bzImageFile);
774
#ifdef LZO_ENABLED
775
  else if (m_options.dwCompression == COMPRESS_LZO) // LZO Compression
776
  {
777
    xwrite32(m_lzoImageFile, 0); //write eof marker
778
    xwrite32(m_lzoImageFile, checksum); // write checksum
779
    nRes = fclose(m_lzoImageFile);
780
  }
781
#endif
782
607
  if (nRes)
783
  if (nRes)
608
    THROW(ERR_ERRNO, errno);
784
    THROW(ERR_ERRNO, errno);
609
  
785
  
Lines 793-798 void CImage::openWriting() Link Here
793
	  THROW(ERR_ERRNO, errno);
969
	  THROW(ERR_ERRNO, errno);
794
	}
970
	}
795
    }
971
    }
972
#ifdef LZO_ENABLED
973
  else if (m_options.dwCompression == COMPRESS_LZO) // LZO compression
974
    {
975
      showDebug(1, "open lzo\n");
976
      m_lzoImageFile = fdopen(m_nFdImage, "wb");
977
      if (m_lzoImageFile == NULL)
978
        {
979
	  showDebug(1, "error:%d %s\n", errno, strerror(errno));
980
	  THROW(ERR_ERRNO, errno);
981
	}
982
      //write magic
983
      static const unsigned char magic[7] =
984
                { 0x00, 0xe9, 0x4c, 0x5a, 0x4f, 0xff, 0x1a };
985
      xwrite(m_lzoImageFile, magic, sizeof(magic));
986
      xwrite32(m_lzoImageFile, 1); //flags
987
      xputc(m_lzoImageFile, 0x1); //method
988
      xputc(m_lzoImageFile, 1); //comp level
989
      xwrite32(m_lzoImageFile, (256*1024L)); //blocksize
990
      checksum = lzo_adler32(0,NULL,0);
991
    }
992
#endif
796
  else
993
  else
797
    THROW(ERR_COMP);
994
    THROW(ERR_COMP);
798
995
Lines 976-981 void CImage::readAndCheckMagic(char *szM Link Here
976
  showDebug(2, "end of ci::readAndCheckMagic: ok\n");
1173
  showDebug(2, "end of ci::readAndCheckMagic: ok\n");
977
}
1174
}
978
1175
1176
#ifdef LZO_ENABLED
1177
//try to read LZO header, retrun true if it ist LZO
1178
bool CImage::readLZOHead()
1179
{
1180
  static const unsigned char magic[7] =
1181
	                { 0x00, 0xe9, 0x4c, 0x5a, 0x4f, 0xff, 0x1a };
1182
  unsigned char m [ sizeof(magic) ];
1183
  if (xread(m_lzoImageFile, m, sizeof(magic), 1) != sizeof(magic) ||
1184
              memcmp(m, magic, sizeof(magic)) != 0)
1185
  {
1186
    showDebug(3, "No LZO magic found");
1187
    return false;
1188
  }
1189
1190
  lzo_uint32 tmp;
1191
  //read rest of header, information not needed now
1192
  tmp = xread32(m_lzoImageFile); //flags always 1
1193
  tmp = xgetc(m_lzoImageFile); //method always 1
1194
  tmp = xgetc(m_lzoImageFile); // level always 1, if not something is wrong
1195
  if (tmp != 1)
1196
  {
1197
    showDebug(4, "Unknown LZO-Level: %d", tmp);
1198
    return false;
1199
  }
1200
1201
  tmp = xread32(m_lzoImageFile); //blocksize
1202
  if (tmp < 1024 || tmp > 1024*1024L)
1203
  {
1204
    showDebug(3,"Unknown Blocksize: %d", tmp);
1205
    return false;
1206
  }
1207
1208
  //init checksum
1209
  checksum = lzo_adler32(0,NULL,0);
1210
1211
  return true;
1212
}//readLZOHead
1213
#endif
1214
979
// =======================================================
1215
// =======================================================
980
// may throw canceled
1216
// may throw canceled
981
// may throw opened, errno, comp (from cid)
1217
// may throw opened, errno, comp (from cid)
Lines 1105-1110 void CImage::openReading(CVolumeHeader * Link Here
1105
      else
1341
      else
1106
        showDebug(1, "bzip2 open\n");
1342
        showDebug(1, "bzip2 open\n");
1107
    }
1343
    }
1344
  else if (m_options.dwCompression == COMPRESS_LZO) // lzo compression
1345
    {
1346
#ifdef LZO_ENABLED
1347
      m_lzoImageFile = fdopen(m_nFdImage, "rb");
1348
      if (m_lzoImageFile == NULL)
1349
        THROW(ERR_ERRNO, errno);
1350
      else
1351
        showDebug(1, "lzo open\n");
1352
      readLZOHead();
1353
      if (lzo_init() != LZO_E_OK)
1354
        {
1355
          showDebug(1, "LZO init failed");
1356
	  THROW (errno);
1357
	}
1358
#else
1359
      showDebug(1, "NO LZO support, but this is an LZO compressed image");
1360
      THROW (1);
1361
#endif
1362
    }
1108
  else
1363
  else
1109
    THROW(ERR_COMP);
1364
    THROW(ERR_COMP);
1110
1365
(-)partimage-0.6.7/src/client/imagefile.h (+14 lines)
Lines 43-48 class CImage Link Here
43
  FILE *m_fImageFile;
43
  FILE *m_fImageFile;
44
  gzFile *m_gzImageFile;
44
  gzFile *m_gzImageFile;
45
  BZFILE *m_bzImageFile;
45
  BZFILE *m_bzImageFile;
46
  FILE *m_lzoImageFile;
46
47
47
  int m_nFdImage;
48
  int m_nFdImage;
48
49
Lines 51-56 class CImage Link Here
51
  char m_szMountDevice[MAXPATHLEN];
52
  char m_szMountDevice[MAXPATHLEN];
52
  char m_szMountPoint[MAXPATHLEN];
53
  char m_szMountPoint[MAXPATHLEN];
53
  char m_szMountFS[MAXPATHLEN];
54
  char m_szMountFS[MAXPATHLEN];
55
#ifdef LZO_ENABLED
56
  lzo_uint32 checksum;
57
  bool readLZOHead();
58
#endif
54
59
55
 public:
60
 public:
56
  CImage(COptions * options); 
61
  CImage(COptions * options); 
Lines 93-98 class CImage Link Here
93
  void closeReading(bool bForceExit = false);
98
  void closeReading(bool bForceExit = false);
94
  void closeWriting();
99
  void closeWriting();
95
100
101
#ifdef LZO_ENABLED
102
  lzo_uint xread(FILE *f, lzo_voidp buf, lzo_uint len, lzo_bool allow_eof);
103
  lzo_uint xwrite(FILE *f, const lzo_voidp buf, lzo_uint len);
104
  void xputc(FILE *f, int c);
105
  int xgetc(FILE *f);
106
  lzo_uint32 xread32(FILE *f);
107
  void xwrite32(FILE *f, lzo_uint32 v);
108
#endif
109
96
  // magic strings
110
  // magic strings
97
  void readAndCheckMagic(char *szMagicString);
111
  void readAndCheckMagic(char *szMagicString);
98
  void writeMagic(char *szMagicString);
112
  void writeMagic(char *szMagicString);
(-)partimage-0.6.7/src/client/main.cpp (+12 lines)
Lines 257-268 int main(int argc, char *argv[]) Link Here
257
	    break;
257
	    break;
258
	  case 'z': // compression level
258
	  case 'z': // compression level
259
	    options.dwCompression = atol(optarg);
259
	    options.dwCompression = atol(optarg);
260
#ifdef LZO_ENABLED
261
	    if ((options.dwCompression < 0) || (options.dwCompression > 3))
262
	      {	
263
		fprintf(stderr, i18n("Compression mode must be 0 (none), "
264
				     "1(gzip), 2(bzip2), 3(lzo)\n"));
265
		return EXIT_FAILURE;
266
	      }
267
#else
260
	    if ((options.dwCompression < 0) || (options.dwCompression > 2))
268
	    if ((options.dwCompression < 0) || (options.dwCompression > 2))
261
	      {	
269
	      {	
262
		fprintf(stderr, i18n("Compression mode must be 0 (none), "
270
		fprintf(stderr, i18n("Compression mode must be 0 (none), "
263
				     "1(gzip), 2(bzip2)\n"));
271
				     "1(gzip), 2(bzip2)\n"));
264
		return EXIT_FAILURE;
272
		return EXIT_FAILURE;
265
	      }
273
	      }
274
#endif
266
	    break;
275
	    break;
267
	  
276
	  
268
	  case 'f': // what to do when finished successfully ?
277
	  case 'f': // what to do when finished successfully ?
Lines 949-954 void usage() Link Here
949
	      "  -z0, --compress=0    don't compress: very fast but very big image file\n"
958
	      "  -z0, --compress=0    don't compress: very fast but very big image file\n"
950
	      "  -z1, --compress=1    compress using gzip: fast and small image file (default)\n"
959
	      "  -z1, --compress=1    compress using gzip: fast and small image file (default)\n"
951
	      "  -z2, --compress=2    (compress using bzip2: very slow and very small image file):\n"
960
	      "  -z2, --compress=2    (compress using bzip2: very slow and very small image file):\n"
961
#ifdef LZO_ENABLED
962
	      "  -z3, --compress=3    LZO compression\n"
963
#endif
952
	      "* -c,  --nocheck       don't check the partition before saving\n"
964
	      "* -c,  --nocheck       don't check the partition before saving\n"
953
	      "* -o,  --overwrite     overwrite the existing image file without confirmation\n"
965
	      "* -o,  --overwrite     overwrite the existing image file without confirmation\n"
954
	      "* -d,  --nodesc        don't ask any description for the image file\n"
966
	      "* -d,  --nodesc        don't ask any description for the image file\n"
(-)partimage-0.6.7/src/client/misc.cpp (+5 lines)
Lines 550-557 void savePartition(char *szDevice, char Link Here
550
    else if (options->dwCompression == 1) +      fprintf(stderr,"partimage: status: Image type: GZIP\n");
550
    else if (options->dwCompression == 1) +      fprintf(stderr,"partimage: status: Image type: GZIP\n");
551
    else if (options->dwCompression == 2)
551
    else if (options->dwCompression == 2)
552
      fprintf(stderr,"partimage: status: Image type: BZIP2\n");
552
      fprintf(stderr,"partimage: status: Image type: BZIP2\n");
553
#ifdef LZO_ENABLED
553
    else if (options->dwCompression == 3)
554
    else if (options->dwCompression == 3)
554
      fprintf(stderr,"partimage: status: Image type: LZO\n");
555
      fprintf(stderr,"partimage: status: Image type: LZO\n");
556
#endif
555
  }  
557
  }  
556
  try { image.write(&headMain, sizeof(CMainHeader), true); }
558
  try { image.write(&headMain, sizeof(CMainHeader), true); }
557
  catch ( CExceptions * excep )
559
  catch ( CExceptions * excep )
Lines 947-952 void restorePartition(char *szDevice, ch Link Here
947
  {
949
  {
948
          showDebug(3,"szFullyBatchMode=%s\n, len=%d",options->szFullyBatchMode,strlen(options->szFullyBatchMode));
950
          showDebug(3,"szFullyBatchMode=%s\n, len=%d",options->szFullyBatchMode,strlen(options->szFullyBatchMode));
949
    options->dwCompression = (DWORD) image.getCompressionLevelForImage(szImageName);
951
    options->dwCompression = (DWORD) image.getCompressionLevelForImage(szImageName);
952
  fprintf(stderr,"Komression: %d", options->dwCompression);
950
    fprintf(stderr,"partimage: status: Partimage: %s\n", headMain.szVersion);
953
    fprintf(stderr,"partimage: status: Partimage: %s\n", headMain.szVersion);
951
    if (options->dwCompression == 0)
954
    if (options->dwCompression == 0)
952
      fprintf(stderr,"partimage: status: Image type: NONE\n");
955
      fprintf(stderr,"partimage: status: Image type: NONE\n");
Lines 954-961 void restorePartition(char *szDevice, ch Link Here
954
      fprintf(stderr,"partimage: status: Image type: GZIP\n");
957
      fprintf(stderr,"partimage: status: Image type: GZIP\n");
955
    else if (options->dwCompression == 2)
958
    else if (options->dwCompression == 2)
956
      fprintf(stderr,"partimage: status: Image type: BZIP2\n");
959
      fprintf(stderr,"partimage: status: Image type: BZIP2\n");
960
#ifdef LZO_ENABLED
957
    else if (options->dwCompression == 3)
961
    else if (options->dwCompression == 3)
958
      fprintf(stderr,"partimage: status: Image type: LZO\n");
962
      fprintf(stderr,"partimage: status: Image type: LZO\n");
963
#endif
959
  }
964
  }
960
  g_interface -> StatusLine(i18n("Restoring partition from the image file..."));
965
  g_interface -> StatusLine(i18n("Restoring partition from the image file..."));
961
966
(-)partimage-0.6.7/src/shared/common.cpp (+3 lines)
Lines 45-50 Link Here
45
45
46
#include <zlib.h> // gzip compression
46
#include <zlib.h> // gzip compression
47
#include <bzlib.h> // bzip2 compression
47
#include <bzlib.h> // bzip2 compression
48
#ifdef LZO_ENABLED
49
  #include <lzo1x.h> //lzo compression
50
#endif
48
#include <string.h>
51
#include <string.h>
49
52
50
#include "common.h"
53
#include "common.h"
(-)partimage-0.6.7/src/shared/image_disk.cpp (-1 / +1 lines)
Lines 319-325 int CImageDisk::getCompressionLevelForIm Link Here
319
  fclose(fImageFile);	
319
  fclose(fImageFile);	
320
  if (dwRes != 16)
320
  if (dwRes != 16)
321
    goto checkBzip2;
321
    goto checkBzip2;
322
  if (strncmp(cBuf+1, "LZO", 3) == 0)
322
  if (strncmp(cBuf+2, "LZO", 3) == 0)
323
    RETURN_int(COMPRESS_LZO);
323
    RETURN_int(COMPRESS_LZO);
324
324
325
  showDebug(3, "TRACE_002\n");
325
  showDebug(3, "TRACE_002\n");
(-)partimage-0.6.7/src/shared/image_disk.h (+1 lines)
Lines 25-30 Link Here
25
25
26
#include <zlib.h> // gzip compression
26
#include <zlib.h> // gzip compression
27
#include <bzlib.h> // bzip2 compression
27
#include <bzlib.h> // bzip2 compression
28
#include <lzo1x.h> // lzo compression
28
#include <string.h>
29
#include <string.h>
29
30
30
// ================================================
31
// ================================================

Return to bug 244617