fsarchiver-0.8.4/0000755000176100017610000000000013242524501010662 500000000000000fsarchiver-0.8.4/INSTALL0000644000176100017610000003661413242524466011657 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. fsarchiver-0.8.4/install-sh0000755000176100017610000003452413242524466012630 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2016-01-11.22; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fsarchiver-0.8.4/config.sub0000755000176100017610000010724313242524466012606 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2017 Free Software Foundation, Inc. timestamp='2017-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; wasm32) basic_machine=wasm32-unknown ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: fsarchiver-0.8.4/AUTHORS0000644000176100017610000000000012461437135011650 00000000000000fsarchiver-0.8.4/depcomp0000755000176100017610000005601713242524466012202 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2016-01-11.22; # UTC # Copyright (C) 1999-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fsarchiver-0.8.4/COPYING0000644000176100017610000003543312461437135011655 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS fsarchiver-0.8.4/src/0000755000176100017610000000000013242524501011451 500000000000000fsarchiver-0.8.4/src/writebuf.h0000644000176100017610000000223713242523705013402 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __WRITEBUF_H__ #define __WRITEBUF_H__ struct s_dico; struct s_blockinfo; struct s_writebuf; typedef struct s_writebuf cwritebuf; struct s_writebuf { char *data; u64 size; }; cwritebuf *writebuf_alloc(); int writebuf_destroy(cwritebuf *wb); int writebuf_add_data(cwritebuf *wb, void *data, u64 size); int writebuf_add_dico(cwritebuf *wb, struct s_dico *d, char *magic); int writebuf_add_header(cwritebuf *wb, struct s_dico *d, char *magic, u32 archid, u16 fsid); int writebuf_add_block(cwritebuf *wb, struct s_blockinfo *blkinfo, u32 archid, u16 fsid); #endif // __WRITEBUF_H__ fsarchiver-0.8.4/src/fs_reiserfs.c0000644000176100017610000001363313242523705014062 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include "fsarchiver.h" #include "fsarchiver.h" #include "dico.h" #include "common.h" #include "fs_reiserfs.h" #include "filesys.h" #include "strlist.h" #include "error.h" int reiserfs_mkfs(cdico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid) { char command[2048]; char buffer[2048]; char options[2048]; int exitst; u64 temp64; // ---- check mkreiserfs is available if (exec_command(command, sizeof(command), NULL, NULL, 0, NULL, 0, "mkreiserfs -V")!=0) { errprintf("mkreiserfs not found. please install reiserfsprogs-3.6 on your system or check the PATH.\n"); return -1; } // ---- set the advanced filesystem settings from the dico memset(options, 0, sizeof(options)); strlcatf(options, sizeof(options), " %s ", fsoptions); if (strlen(mkfslabel) > 0) strlcatf(options, sizeof(options), " -l '%.16s' ", mkfslabel); else if (dico_get_string(d, 0, FSYSHEADKEY_FSLABEL, buffer, sizeof(buffer))==0 && strlen(buffer)>0) strlcatf(options, sizeof(options), " -l '%.16s' ", buffer); if (dico_get_u64(d, 0, FSYSHEADKEY_FSREISERBLOCKSIZE, &temp64)==0) strlcatf(options, sizeof(options), " -b %ld ", (long)temp64); if (strlen(mkfsuuid) > 0) strlcatf(options, sizeof(options), " -u %s ", mkfsuuid); else if (dico_get_string(d, 0, FSYSHEADKEY_FSUUID, buffer, sizeof(buffer))==0 && strlen(buffer)==36) strlcatf(options, sizeof(options), " -u %s ", buffer); if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 0, "mkreiserfs -f %s %s", partition, options)!=0 || exitst!=0) { errprintf("command [%s] failed\n", command); return -1; } return 0; } int reiserfs_getinfo(cdico *d, char *devname) { struct reiserfs_super_block sb; char uuid[512]; u16 temp16; int ret=0; int fd=-1; int res; if ((fd=open64(devname, O_RDONLY|O_LARGEFILE))<0) { ret=-1; errprintf("cannot open(%s, O_RDONLY)\n", devname); goto reiserfs_read_sb_return; } if (lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET)!=REISERFS_DISK_OFFSET_IN_BYTES) { ret=-2; errprintf("cannot lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET) on %s\n", devname); goto reiserfs_read_sb_close; } res=read(fd, &sb, sizeof(sb)); if (res!=sizeof(sb)) { ret=-3; errprintf("cannot read the reiserfs superblock on device [%s]\n", devname); goto reiserfs_read_sb_close; } if (strncmp(sb.s_v1.s_magic, REISERFS_SUPER_MAGIC_STRING, strlen(REISERFS_SUPER_MAGIC_STRING)) == 0) dico_add_string(d, 0, FSYSHEADKEY_FSVERSION, "reiserfs-3.5"); else if (strncmp(sb.s_v1.s_magic, REISER2FS_SUPER_MAGIC_STRING, strlen(REISER2FS_SUPER_MAGIC_STRING)) == 0) dico_add_string(d, 0, FSYSHEADKEY_FSVERSION, "reiserfs-3.6"); else { ret=-4; errprintf("magic different from expectations superblock on %s: magic=[%s]\n", devname, sb.s_v1.s_magic); goto reiserfs_read_sb_close; } msgprintf(MSG_DEBUG1, "reiserfs_magic=[%s]\n", sb.s_v1.s_magic); // ---- label msgprintf(MSG_DEBUG1, "reiserfs_label=[%s]\n", sb.s_label); dico_add_string(d, 0, FSYSHEADKEY_FSLABEL, (char*)sb.s_label); // ---- uuid /*if ((str=e2p_uuid2str(sb.s_uuid))!=NULL) dico_add_string(d, 0, FSYSHEADKEY_FSUUID, str);*/ memset(uuid, 0, sizeof(uuid)); uuid_unparse_lower((u8*)sb.s_uuid, uuid); dico_add_string(d, 0, FSYSHEADKEY_FSUUID, uuid); msgprintf(MSG_DEBUG1, "reiserfs_uuid=[%s]\n", uuid); // ---- block size temp16=le16_to_cpu(sb.s_v1.s_blocksize); dico_add_u64(d, 0, FSYSHEADKEY_FSREISERBLOCKSIZE, temp16); msgprintf(MSG_DEBUG1, "reiserfs_blksize=[%ld]\n", (long)temp16); // ---- minimum fsarchiver version required to restore dico_add_u64(d, 0, FSYSHEADKEY_MINFSAVERSION, FSA_VERSION_BUILD(0, 6, 4, 0)); reiserfs_read_sb_close: close(fd); reiserfs_read_sb_return: return ret; } int reiserfs_mount(char *partition, char *mntbuf, char *fsbuf, int flags, char *mntinfo) { return generic_mount(partition, mntbuf, fsbuf, "user_xattr,acl", flags); } int reiserfs_umount(char *partition, char *mntbuf) { return generic_umount(mntbuf); } int reiserfs_test(char *devname) { struct reiserfs_super_block sb; int fd=-1; if ((fd=open64(devname, O_RDONLY|O_LARGEFILE))<0) return false; if (lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET)!=REISERFS_DISK_OFFSET_IN_BYTES) { close(fd); return false; } if (read(fd, &sb, sizeof(sb))!=sizeof(sb)) { close(fd); return false; } if ((strncmp(sb.s_v1.s_magic, REISERFS_SUPER_MAGIC_STRING, strlen(REISERFS_SUPER_MAGIC_STRING)) != 0) && (strncmp(sb.s_v1.s_magic, REISER2FS_SUPER_MAGIC_STRING, strlen(REISER2FS_SUPER_MAGIC_STRING)) != 0)) { close(fd); return false; } close(fd); return true; } int reiserfs_get_reqmntopt(char *partition, cstrlist *reqopt, cstrlist *badopt) { if (!reqopt || !badopt) return -1; strlist_add(badopt, "nouser_xattr"); strlist_add(badopt, "noacl"); return 0; } fsarchiver-0.8.4/src/fs_ntfs.h0000644000176100017610000000300113242523705013203 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __FS_NTFS_H__ #define __FS_NTFS_H__ struct s_dico; struct s_strlist; #define NTFS3G_VERSION(year, month, day) ((u64)((((u64)year&0xFFFF)<<48)+(((u64)month&0xFFFF)<<32)+(((u64)day&0xFFFF)<<16))) #define NTFS3G_MINVER_Y 2009 #define NTFS3G_MINVER_M 11 #define NTFS3G_MINVER_D 14 struct s_ntfsinfo { u32 bytes_per_sector; u32 sectors_per_clusters; u32 bytes_per_cluster; u64 uuid; }; int ntfs_mkfs(struct s_dico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid); int ntfs_getinfo(struct s_dico *d, char *devname); int ntfs_mount(char *partition, char *mntbuf, char *fsbuf, int flags, char *mntinfo); int ntfs_get_reqmntopt(char *partition, struct s_strlist *reqopt, struct s_strlist *badopt); int ntfs_replace_uuid(char *devname, u64 uuid); int ntfs_umount(char *partition, char *mntbuf); int ntfs_test(char *devname); #endif // __FS_NTFS_H__ fsarchiver-0.8.4/src/error.h0000644000176100017610000000456213242523705012707 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __ERROR_H__ #define __ERROR_H__ struct s_stats; typedef struct s_stats cstats; struct s_stats { u64 cnt_regfile; u64 cnt_dir; u64 cnt_symlink; u64 cnt_hardlink; u64 cnt_special; u64 err_regfile; u64 err_dir; u64 err_symlink; u64 err_hardlink; u64 err_special; }; int fsaprintf(int level, bool showerrno, bool showloc, const char *file, const char *fct, int line, char *format, ...) __attribute__ ((format (printf, 7, 8))); // ---- message levels enum {MSG_FORCE=0, // always show this messages whatever the level is MSG_VERB1=1, // normal messages that have to be shown when verbose>=1 (fsarchive -v) MSG_VERB2=2, // detailed messages that have to be shown when verbose>=2 (fsarchive -vv) MSG_STACK=3, // messages shown when a function exists (propagate error at upper level) MSG_DEBUG1=4, // debugging messages level 1 (very basic info) MSG_DEBUG2=5, // debugging messages level 2 MSG_DEBUG3=6, // debugging messages level 3 MSG_DEBUG4=7, // debugging messages level 4 MSG_DEBUG5=8 // debugging messages level 5 (very detailed debug) }; char *error_int_to_string(s64 err); // use sysprintf to print an error that follows a libc function and to show errno #define sysprintf(fmt, args...) fsaprintf(0, true, true, __FILE__, __FUNCTION__, __LINE__, fmt, ## args) // use errprintf to print an error that does not come from a libc function #define errprintf(fmt, args...) fsaprintf(0, false, true, __FILE__, __FUNCTION__, __LINE__, fmt, ## args) // use msgprintf with a level to show normal messages or debug messages #define msgprintf(level, fmt, args...) fsaprintf(level, false, level>=3, __FILE__, __FUNCTION__, __LINE__, fmt, ## args) #endif // __ERROR_H__ fsarchiver-0.8.4/src/crypto.h0000644000176100017610000000153513242523705013073 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __CRYPTO_H__ #define __CRYPTO_H__ #include "types.h" int crypto_init(); int crypto_blowfish(u64 insize, u64 *outsize, u8 *inbuf, u8 *outbuf, u8 *password, int passlen, int enc); int crypto_random(u8 *buf, int bufsize); int crypto_cleanup(); #endif // __CRYPTO_H__ fsarchiver-0.8.4/src/logfile.c0000644000176100017610000000356413242523705013173 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include #include #include #include "fsarchiver.h" #include "logfile.h" #include "common.h" #include "error.h" int g_logfile=-1; int logfile_open() { char logpath[PATH_MAX]; char timestamp[1024]; char *logdir="/var/log"; format_time(timestamp, sizeof(timestamp), time(NULL)); snprintf(logpath, sizeof(logpath), "%s/fsarchiver_%s_%ld.log", logdir, timestamp, (long)getpid()); mkdir_recursive(logdir); g_logfile=open64(logpath, O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); if (g_logfile>=0) { msgprintf(MSG_VERB1, "Creating logfile in %s\n", logpath); msgprintf(MSG_VERB1, "Running fsarchiver version=[%s], fileformat=[%s]\n", FSA_VERSION, FSA_FILEFORMAT); return FSAERR_SUCCESS; } else { sysprintf("Cannot create logfile in %s\n", logpath); return FSAERR_UNKNOWN; } } int logfile_close() { close(g_logfile); return FSAERR_SUCCESS; } int logfile_write(char *str, int len) { if (g_logfile>=0) return write(g_logfile, str, len); else return FSAERR_UNKNOWN; } fsarchiver-0.8.4/src/strdico.h0000644000176100017610000000253613242523705013224 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __STRDICO_H__ #define __STRDICO_H__ struct s_strdico; struct s_strdicoitem; typedef struct s_strdico cstrdico; typedef struct s_strdicoitem cstrdicoitem; struct s_strdico { cstrdicoitem *head; char *validkeys; }; struct s_strdicoitem { char *key; char *value; cstrdicoitem *next; }; cstrdico *strdico_alloc(); int strdico_destroy(cstrdico *d); int strdico_set_valid_keys(cstrdico *d, const char *keys); int strdico_parse_string(cstrdico *d, const char *strdefs); int strdico_set_value(cstrdico *d, const char *key, const char *value); int strdico_get_string(cstrdico *d, char *outbuffer, int outbufsize, const char *key); int strdico_get_s64(cstrdico *d, s64 *value, const char *key); int strdico_print(cstrdico *d); #endif // __STRDICO_H__ fsarchiver-0.8.4/src/comp_lz4.h0000644000176100017610000000167113217127345013305 00000000000000 /* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2017 Cristian Vazquez. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __COMPRESS_LZ4_H__ #define __COMPRESS_LZ4_H__ #ifdef OPTION_LZ4_SUPPORT #include int compress_block_lz4(u64 origsize, u64 *compsize, u8 *origbuf, u8 *compbuf, u64 compbufsize, int level); int uncompress_block_lz4(u64 compsize, u64 *origsize, u8 *origbuf, u64 origbufsize, u8 *compbuf); #endif // OPTION_LZ4_SUPPORT #endif // __COMPRESS_LZ4_H__ fsarchiver-0.8.4/src/oper_restore.c0000644000176100017610000017252313242523705014264 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "fsarchiver.h" #include "strdico.h" #include "dico.h" #include "common.h" #include "options.h" #include "oper_restore.h" #include "archreader.h" #include "archinfo.h" #include "filesys.h" #include "fs_ext2.h" #include "fs_reiserfs.h" #include "fs_reiser4.h" #include "fs_btrfs.h" #include "fs_xfs.h" #include "fs_jfs.h" #include "fs_ntfs.h" #include "thread_comp.h" #include "thread_archio.h" #include "syncthread.h" #include "regmulti.h" #include "crypto.h" #include "error.h" #include "datafile.h" #include "queue.h" typedef struct s_extractar { carchreader ai; int fsid; cstats stats; u64 cost_global; u64 cost_current; } cextractar; // returns true if this file of a parent directory has been excluded int is_filedir_excluded(char *relpath) { char dirpath[PATH_MAX]; char basename[PATH_MAX]; int pos; // check if that particular file has been excluded extract_basename(relpath, basename, sizeof(basename)); if ((exclude_check(&g_options.exclude, basename)==true) // is filename excluded ? || (exclude_check(&g_options.exclude, relpath)==true)) // is filepath excluded ? { msgprintf(MSG_VERB2, "file/dir=[%s] excluded because of its own name/path\n", relpath); return true; } // check if that file belongs to a directory which has been excluded snprintf(dirpath, sizeof(dirpath), "%s", relpath); for (pos=0; dirpath[pos]; pos++); // go to the end of the string while (pos>0) { // dirpath=parent_directory(dirpath) while ((pos>=0) && (dirpath[pos]!='/')) dirpath[pos--]=0; if ((pos>0) && (dirpath[pos]=='/')) dirpath[pos]=0; extract_basename(dirpath, basename, sizeof(basename)); if (strlen(dirpath)>1 && strlen(basename)>0) { if ((exclude_check(&g_options.exclude, basename)==true) || (exclude_check(&g_options.exclude, dirpath)==true)) { msgprintf(MSG_VERB2, "file/dir=[%s] excluded because of its parent=[%s]\n", relpath, dirpath); return true; // a parent directory is excluded } } } return false; // no exclusion found for that file } // convert an array of strings "id=x,dest=/dev/xxx,..." to an array of strdico int convert_argv_to_strdicos(cstrdico *dicoargv[], int argc, char *cmdargv[]) { cstrdico *tmpdico=NULL; char buffer[1024]; struct stat64 st; s64 temp64; int fsid; int i; for (i=0; (iFSA_MAX_FSPERARCH-1)) { errprintf("invalid filesystem id [%d]: it must match a valid filesystem id as shown by archinfo\n", fsid); strdico_destroy(tmpdico); return -1; } // read and check "dest=" key in the argument if (strdico_get_string(tmpdico, buffer, sizeof(buffer), "dest")!=0) { errprintf("cannot find \"dest=\" key in \"%s\"\n", cmdargv[i]); strdico_destroy(tmpdico); return -1; } if ((stat64(buffer, &st)!=0) || (!S_ISBLK(st.st_mode))) { errprintf("\"%s\" is not a valid block device\n", buffer); strdico_destroy(tmpdico); return -1; } // add the current argument to the list of the strdico objects if (dicoargv[fsid]!=NULL) { errprintf("you mentioned filesystem with id=%d multiple times, cannot continue\n", fsid); strdico_destroy(tmpdico); return -1; } dicoargv[fsid]=tmpdico; } return 0; } int extractar_listing_print_file(cextractar *exar, int objtype, char *relpath) { char strprogress[256]; s64 progress; memset(strprogress, 0, sizeof(strprogress)); if (exar->cost_global>0) { progress=(((exar->cost_current)*100)/(exar->cost_global)); if (progress>=0 && progress<=100) snprintf(strprogress, sizeof(strprogress), "[%3d%%]", (int)progress); } msgprintf(MSG_VERB1, "-[%.2d]%s[%s] %s\n", exar->fsid, strprogress, get_objtype_name(objtype), relpath); return 0; } int extractar_restore_attr_xattr(cextractar *exar, u32 objtype, char *fullpath, char *relpath, cdico *dicoattr) { char xattrname[2048]; char xattrvalue[65535]; u16 xattrdatasize; int xattrdicsize; int ret=0; int res; int i; // ---- restore extended attributes xattrdicsize=dico_count_one_section(dicoattr, DICO_OBJ_SECTION_XATTR); for (i=0; i < xattrdicsize; i+=2) { if (dico_get_string(dicoattr, DICO_OBJ_SECTION_XATTR, (u64)(i+0), xattrname, sizeof(xattrname))!=0) { errprintf("Cannot retrieve the name of an xattr for file %s: DICO_OBJ_SECTION_XATTR, key=%ld\n", relpath, (long)(i+0)); dico_show(dicoattr, DICO_OBJ_SECTION_XATTR, "xattr"); ret=-1; continue; } memset(xattrvalue, 0, sizeof(xattrvalue)); if (dico_get_data(dicoattr, DICO_OBJ_SECTION_XATTR, (u64)(i+1), xattrvalue, sizeof(xattrvalue), &xattrdatasize)!=0) { errprintf("Cannot retrieve the value of an xattr for file %s: DICO_OBJ_SECTION_XATTR, key=%ld\n", relpath, (long)(i+1)); dico_show(dicoattr, DICO_OBJ_SECTION_XATTR, "xattr"); ret=-1; continue; } if ((res=lsetxattr(fullpath, xattrname, xattrvalue, xattrdatasize, 0))!=0) { sysprintf("xattr:lsetxattr(%s,%s) failed\n", relpath, xattrname); ret=-1; } else // success { msgprintf(MSG_VERB2, " xattr:lsetxattr(%s, %s)=%d\n", relpath, xattrname, res); } } return ret; } int extractar_restore_attr_windows(cextractar *exar, u32 objtype, char *fullpath, char *relpath, cdico *dicoattr) { char xattrname[2048]; char xattrvalue[65535]; u16 xattrdatasize; int xattrdicsize; int ret=0; int res; int i; xattrdicsize=dico_count_one_section(dicoattr, DICO_OBJ_SECTION_WINATTR); for (i=0; i < xattrdicsize; i+=2) { if (dico_get_string(dicoattr, DICO_OBJ_SECTION_WINATTR, (u64)(i+0), xattrname, sizeof(xattrname))!=0) { errprintf("Cannot retrieve the name of an winattr for file %s\n", relpath); dico_show(dicoattr, DICO_OBJ_SECTION_WINATTR, "winattr"); ret=-1; continue; } memset(xattrvalue, 0, sizeof(xattrvalue)); if (dico_get_data(dicoattr, DICO_OBJ_SECTION_WINATTR, (u64)(i+1), xattrvalue, sizeof(xattrvalue), &xattrdatasize)!=0) { errprintf("Cannot retrieve the value of an winattr for file %s\n", relpath); ret=-1; continue; } if ((res=lsetxattr(fullpath, xattrname, xattrvalue, xattrdatasize, 0))!=0) { sysprintf("winattr:lsetxattr(%s,%s) failed\n", relpath, xattrname); ret=-1; } else // success { msgprintf(MSG_VERB2, " winattr:lsetxattr(%s, %s)=%d\n", relpath, xattrname, res); } } return ret; } int extractar_restore_attr_std(cextractar *exar, u32 objtype, char *fullpath, char *relpath, cdico *dicoattr) { u32 mode, uid, gid; u64 atime, mtime; // ---- restore standard attributes (permissions, owner, ...) if (dico_get_u32(dicoattr, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_MODE, &mode)!=0) return -1; if (dico_get_u32(dicoattr, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_UID, &uid)!=0) return -2; if (dico_get_u32(dicoattr, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_GID, &gid)!=0) return -3; if (dico_get_u64(dicoattr, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_ATIME, &atime)!=0) return -4; if (dico_get_u64(dicoattr, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_MTIME, &mtime)!=0) return -5; if (lchown(fullpath, (uid_t)uid, (gid_t)gid)!=0) { sysprintf("Cannot lchown(%s) which is %s\n", fullpath, get_objtype_name(objtype)); return -6; } if (objtype!=OBJTYPE_SYMLINK) { if (chmod(fullpath, (mode_t)mode)!=0) { sysprintf("chmod(%s, %lld) failed\n", fullpath, (long long)mode); return -7; } } // set the values for atime/mtime struct timeval tv[2]; tv[0].tv_usec=0; tv[0].tv_sec=atime; tv[1].tv_usec=0; tv[1].tv_sec=mtime; if (objtype!=OBJTYPE_SYMLINK) // not a symlink { if (utimes(fullpath, tv)!=0) { sysprintf("utimes(%s) failed\n", relpath); return -8; } } #ifdef HAVE_LUTIMES else // object is a symlink { // lutimes not implemented on rhel5: don't fail for symlinks lutimes(fullpath, tv); } #endif // HAVE_LUTIMES return 0; } int extractar_restore_attr_everything(cextractar *exar, int objtype, char *fullpath, char *relpath, cdico *dicoattr) { int res=0; // ---- restore standard attributes res+=extractar_restore_attr_std(exar, objtype, fullpath, relpath, dicoattr); // ---- restore extended attributes res+=extractar_restore_attr_xattr(exar, objtype, fullpath, relpath, dicoattr); // ---- restore windows attributes res+=extractar_restore_attr_windows(exar, objtype, fullpath, relpath, dicoattr); return (res==0)?(0):(-1); } int extractar_restore_obj_symlink(cextractar *exar, char *fullpath, char *relpath, char *destdir, cdico *d, int objtype, int fstype) { char parentdir[PATH_MAX]; struct timeval tv[2]; char buffer[PATH_MAX]; u64 targettype; int fdtemp; // update cost statistics and progress bar exar->cost_current+=FSA_COST_PER_FILE; // check the list of excluded files/dirs if (is_filedir_excluded(relpath)==true) goto extractar_restore_obj_symlink_err; // update progress bar extractar_listing_print_file(exar, objtype, relpath); // create parent directory first extract_dirpath(fullpath, parentdir, sizeof(parentdir)); mkdir_recursive(parentdir); // backup parent dir atime/mtime get_parent_dir_time_attrib(fullpath, parentdir, sizeof(parentdir), tv); if (dico_get_string(d, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_SYMLINK, buffer, PATH_MAX)<0) { errprintf("Cannot read field=symlink for file=[%s]\n", fullpath); goto extractar_restore_obj_symlink_err; } // in ntfs a symlink has to be recreated as a standard file or directory (depending on what the target is) if ((dico_get_u64(d, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_LINKTARGETTYPE, &targettype)==0) && (strcmp(filesys[fstype].name, "ntfs")==0)) { switch (targettype) { case OBJTYPE_DIR: msgprintf(MSG_DEBUG1, "LINK: mklink=[%s], target=[%s], targettype=DIR\n", relpath, buffer); if (mkdir_recursive(fullpath)!=0) { errprintf("Cannot create directory for ntfs symlink: path=[%s]\n", fullpath); goto extractar_restore_obj_symlink_err; } break; case OBJTYPE_REGFILEUNIQUE: msgprintf(MSG_DEBUG1, "LINK: mklink=[%s], target=[%s], targettype=REGFILE\n", relpath, buffer); if ( (fdtemp=creat(fullpath, 0644)) < 0) { errprintf("Cannot create file for ntfs symlink: path=[%s]\n", fullpath); goto extractar_restore_obj_symlink_err; } close(fdtemp); break; default: msgprintf(MSG_DEBUG1, "LINK: mklink=[%s], target=[%s], targettype=UNKNOWN\n", relpath, buffer); errprintf("Unexpected target type for ntfs symlink: path=[%s]\n", fullpath); goto extractar_restore_obj_symlink_err; break; } } else // normal symbolic link for linux filesystems { msgprintf(MSG_DEBUG1, "LINK: symlink=[%s], target=[%s] (normal symlink)\n", relpath, buffer); if (symlink(buffer, fullpath)<0) { sysprintf("symlink(%s, %s) failed\n", buffer, fullpath); goto extractar_restore_obj_symlink_err; } } if (extractar_restore_attr_everything(exar, objtype, fullpath, relpath, d)!=0) { msgprintf(MSG_STACK, "cannot restore file attributes for file [%s]\n", relpath); goto extractar_restore_obj_symlink_err; } // restore parent dir mtime/atime if (utimes(parentdir, tv)!=0) { sysprintf("utimes(%s) failed\n", parentdir); goto extractar_restore_obj_symlink_err; } dico_destroy(d); exar->stats.cnt_symlink++; return 0; // success extractar_restore_obj_symlink_err: dico_destroy(d); exar->stats.err_symlink++; return 0; // non fatal error } int extractar_restore_obj_hardlink(cextractar *exar, char *fullpath, char *relpath, char *destdir, cdico *d, int objtype, int fstype) { char parentdir[PATH_MAX]; struct timeval tv[2]; char buffer[PATH_MAX]; char regfile[PATH_MAX]; int res; // update cost statistics and progress bar exar->cost_current+=FSA_COST_PER_FILE; // check the list of excluded files/dirs if (is_filedir_excluded(relpath)==true) goto extractar_restore_obj_hardlink_err; // create parent directory first extract_dirpath(fullpath, parentdir, sizeof(parentdir)); mkdir_recursive(parentdir); // backup parent dir atime/mtime get_parent_dir_time_attrib(fullpath, parentdir, sizeof(parentdir), tv); // update progress bar extractar_listing_print_file(exar, objtype, relpath); if (dico_get_string(d, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_HARDLINK, buffer, PATH_MAX)<0) { msgprintf(MSG_STACK, "dico_get_string(DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_HARDLINK) failed\n"); goto extractar_restore_obj_hardlink_err; } concatenate_paths(regfile, PATH_MAX, destdir, buffer); if ((res=link(regfile, fullpath))!=0) { sysprintf("link(%s, %s) failed\n", regfile, fullpath); goto extractar_restore_obj_hardlink_err; } if (extractar_restore_attr_everything(exar, objtype, fullpath, relpath, d)!=0) { msgprintf(MSG_STACK, "cannot restore file attributes for file [%s]\n", relpath); goto extractar_restore_obj_hardlink_err; } // restore parent dir mtime/atime if (utimes(parentdir, tv)!=0) { sysprintf("utimes(%s) failed\n", parentdir); goto extractar_restore_obj_hardlink_err; } dico_destroy(d); exar->stats.cnt_hardlink++; return 0; // success extractar_restore_obj_hardlink_err: dico_destroy(d); exar->stats.err_hardlink++; return 0; // non fatal error } int extractar_restore_obj_devfile(cextractar *exar, char *fullpath, char *relpath, char *destdir, cdico *d, int objtype, int fstype) { char parentdir[PATH_MAX]; struct timeval tv[2]; u64 dev; u32 mode; // update cost statistics and progress bar exar->cost_current+=FSA_COST_PER_FILE; // check the list of excluded files/dirs if (is_filedir_excluded(relpath)==true) goto extractar_restore_obj_devfile_err; // create parent directory first extract_dirpath(fullpath, parentdir, sizeof(parentdir)); mkdir_recursive(parentdir); // backup parent dir atime/mtime get_parent_dir_time_attrib(fullpath, parentdir, sizeof(parentdir), tv); // update progress bar extractar_listing_print_file(exar, objtype, relpath); if (dico_get_u64(d, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_RDEV, &dev)!=0) goto extractar_restore_obj_devfile_err; if (dico_get_u32(d, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_MODE, &mode)!=0) goto extractar_restore_obj_devfile_err; if (mknod(fullpath, mode, dev)!=0) { sysprintf("mknod failed on [%s]\n", relpath); goto extractar_restore_obj_devfile_err; } if (extractar_restore_attr_everything(exar, objtype, fullpath, relpath, d)!=0) { msgprintf(MSG_STACK, "cannot restore file attributes for file [%s]\n", relpath); goto extractar_restore_obj_devfile_err; } // restore parent dir mtime/atime if (utimes(parentdir, tv)!=0) { sysprintf("utimes(%s) failed\n", parentdir); goto extractar_restore_obj_devfile_err; } dico_destroy(d); exar->stats.cnt_special++; return 0; // success extractar_restore_obj_devfile_err: dico_destroy(d); exar->stats.err_special++; return 0; // non fatal error } int extractar_restore_obj_directory(cextractar *exar, char *fullpath, char *relpath, char *destdir, cdico *d, int objtype, int fstype) { char parentdir[PATH_MAX]; struct timeval tv[2]; // update cost statistics and progress bar exar->cost_current+=FSA_COST_PER_FILE; // check the list of excluded files/dirs if (is_filedir_excluded(relpath)==true) goto extractar_restore_obj_directory_err; // create parent directory first extract_dirpath(fullpath, parentdir, sizeof(parentdir)); mkdir_recursive(parentdir); // backup parent dir atime/mtime get_parent_dir_time_attrib(fullpath, parentdir, sizeof(parentdir), tv); // update progress bar extractar_listing_print_file(exar, objtype, relpath); mkdir_recursive(fullpath); if (extractar_restore_attr_everything(exar, objtype, fullpath, relpath, d)!=0) { msgprintf(MSG_STACK, "cannot restore file attributes for file [%s]\n", relpath); goto extractar_restore_obj_directory_err; } // restore parent dir mtime/atime if (utimes(parentdir, tv)!=0) { sysprintf("utimes(%s) failed\n", parentdir); goto extractar_restore_obj_directory_err; } dico_destroy(d); exar->stats.cnt_dir++; return 0; // success extractar_restore_obj_directory_err: dico_destroy(d); exar->stats.err_dir++; return 0; // non fatal error } int extractar_restore_obj_regfile_multi(cextractar *exar, char *destdir, cdico *dicofirstfile, int objtype, int fstype) // d = obj-header of first small file { cdatafile *datafile=NULL; char databuf[FSA_MAX_SMALLFILESIZE]; char basename[PATH_MAX]; cdico *filehead=NULL; char magic[FSA_SIZEOF_MAGIC+1]; char fullpath[PATH_MAX]; char relpath[PATH_MAX]; char parentdir[PATH_MAX]; struct timeval tv[2]; struct s_blockinfo blkinfo; cregmulti regmulti; u8 md5sumcalc[16]; u8 md5sumorig[16]; int errors; u32 filescount; u32 tmpobjtype; u64 datsize; s64 lres; int res; int i; // init errors=0; memset(&blkinfo, 0, sizeof(blkinfo)); regmulti_init(®multi, FSA_MAX_BLKSIZE); datafile=datafile_alloc(); // ---- dequeue header for each small file which is part of that group if (dico_get_u32(dicofirstfile, 0, DISKITEMKEY_MULTIFILESCOUNT, &filescount)!=0) { errprintf("cannot read DISKITEMKEY_MULTIFILESCOUNT from header in archive\n"); return -1; } if (regmulti_rest_addheader(®multi, dicofirstfile)!=0) { errprintf("rest_addheader() failed\n"); return -1; } for (i=1; i < filescount; i++) // first header was a special case (received from calling function) { if (queue_dequeue_header(&g_queue, &filehead, magic, NULL)<=0) { errprintf("queue_dequeue_header() failed: cannot read multireg object header\n"); errors++; return -1; } if (memcmp(magic, FSA_MAGIC_OBJT, FSA_SIZEOF_MAGIC)!=0) { errprintf("header is not what we expected: found=[%s] and expected=[%s]\n", magic, FSA_MAGIC_OBJT); return -1; } if (regmulti_rest_addheader(®multi, filehead)!=0) { errprintf("rest_addheader() failed for file %d\n", i); return -1; } } // ---- dequeue the block which contains data for several small files if ((lres=queue_dequeue_block(&g_queue, &blkinfo))<=0) { errprintf("queue_dequeue_block()=%ld=%s failed\n", (long)lres, error_int_to_string(lres)); return -1; } if (regmulti_rest_setdatablock(®multi, blkinfo.blkdata, blkinfo.blkrealsize)!=0) { errprintf("regmulti_rest_setdatablock() failed\n"); return -1; } free(blkinfo.blkdata); // free memory allocated by the thread_io_reader // ---- create the set of small files using the regmulti structure for (i=0; i < filescount; i++) { // get header and data for a small file from the regmulti structure if (regmulti_rest_getfile(®multi, i, &filehead, databuf, &datsize, sizeof(databuf))!=0) { errprintf("rest_addheader() failed for file %d\n", i); filehead=NULL; // else dico_destroy would fail goto extractar_restore_obj_regfile_multi_err; } if (dico_get_u32(filehead, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_OBJTYPE, &tmpobjtype)!=0) { errprintf("Cannot read object type\n"); goto extractar_restore_obj_regfile_multi_err; } if ((res=dico_get_data(filehead, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_PATH, relpath, sizeof(relpath), NULL))!=0) { errprintf("Cannot read DISKITEMKEY_PATH from header, res=%d, key=%d\n", res, DISKITEMKEY_PATH); dico_show(filehead, DICO_OBJ_SECTION_STDATTR, "DISKITEMKEY_PATH"); goto extractar_restore_obj_regfile_multi_err; } concatenate_paths(fullpath, sizeof(fullpath), destdir, relpath); extract_basename(fullpath, basename, sizeof(basename)); // update cost statistics and progress bar exar->cost_current+=FSA_COST_PER_FILE; exar->cost_current+=datsize; // filesize // check the list of excluded files/dirs if (is_filedir_excluded(relpath)!=true) { // create parent directory if necessary extract_dirpath(fullpath, parentdir, sizeof(parentdir)); mkdir_recursive(parentdir); // backup parent dir atime/mtime get_parent_dir_time_attrib(fullpath, parentdir, sizeof(parentdir), tv); extractar_listing_print_file(exar, tmpobjtype, relpath); if (dico_get_data(filehead, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_MD5SUM, md5sumorig, 16, NULL)) { errprintf("cannot get md5sum from file footer for file=[%s]\n", relpath); dico_show(filehead, DICO_OBJ_SECTION_STDATTR, "filehead"); goto extractar_restore_obj_regfile_multi_err; } if (datafile_open_write(datafile, fullpath, false, false)<0) goto extractar_restore_obj_regfile_multi_err; res=datafile_write(datafile, databuf, datsize); datafile_close(datafile, md5sumcalc, sizeof(md5sumcalc)); if (res!=FSAERR_SUCCESS) { errprintf("removing %s\n", fullpath); unlink(fullpath); return -1; } if (memcmp(md5sumcalc, md5sumorig, 16)!=0) { errprintf("cannot restore file %s, the data block (which is shared by multiple files) is corrupt\n", relpath); res=truncate(fullpath, 0); // don't leave corrupt data in the file goto extractar_restore_obj_regfile_multi_err; } if (extractar_restore_attr_everything(exar, objtype, fullpath, relpath, filehead)!=0) { msgprintf(MSG_STACK, "cannot restore file attributes for file [%s]\n", relpath); goto extractar_restore_obj_regfile_multi_err; } // restore parent dir mtime/atime if (utimes(parentdir, tv)!=0) { sysprintf("utimes(%s) failed\n", parentdir); goto extractar_restore_obj_regfile_multi_err; } exar->stats.cnt_regfile++; } dico_destroy(filehead); continue; // success on that file extractar_restore_obj_regfile_multi_err: dico_destroy(filehead); exar->stats.err_regfile++; continue; } datafile_destroy(datafile); return 0; } int extractar_restore_obj_regfile_unique(cextractar *exar, char *fullpath, char *relpath, char *destdir, cdico *d, int objtype, int fstype) // large or empty files { char magic[FSA_SIZEOF_MAGIC+1]; struct s_blockinfo blkinfo; char parentdir[PATH_MAX]; cdatafile *datafile=NULL; cdico *footerdico=NULL; bool fatalerr=false; // error for restoration globally bool minorerr=false; // error for current file only bool delfile=false; struct timeval tv[2]; u8 md5sumcalc[16]; u8 md5sumorig[16]; int excluded=false; bool sparse=false; u64 filesize=0; u64 filepos=0; u64 flags=0; s64 lres; // init memset(&blkinfo, 0, sizeof(blkinfo)); memset(magic, 0, sizeof(magic)); datafile=datafile_alloc(); if (dico_get_u64(d, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_SIZE, &filesize)!=0) { errprintf("Cannot read filesize DISKITEMKEY_SIZE from archive for file=[%s]\n", relpath); minorerr=true; } sparse=((dico_get_u64(d, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_FLAGS, &flags)==0) && (flags&FSA_FILEFLAGS_SPARSE)); // update cost statistics and progress bar exar->cost_current+=FSA_COST_PER_FILE; exar->cost_current+=filesize; // check the list of excluded files/dirs if (is_filedir_excluded(relpath)==true) { excluded=true; } else if (minorerr==false) // file not excluded and no error yet { // create parent directory first extract_dirpath(fullpath, parentdir, sizeof(parentdir)); mkdir_recursive(parentdir); // backup parent dir atime/mtime get_parent_dir_time_attrib(fullpath, parentdir, sizeof(parentdir), tv); // show progress bar extractar_listing_print_file(exar, objtype, relpath); } if ((minorerr==false) && (datafile_open_write(datafile, fullpath, excluded, sparse)<0)) minorerr=true; msgprintf(MSG_DEBUG2, "restore_obj_regfile_unique(file=%s, size=%lld)\n", relpath, (long long)filesize); for (filepos=0; (minorerr==false) && (filesize>0) && (filepos < filesize) && (get_interrupted()==false); filepos+=blkinfo.blkrealsize) { if ((lres=queue_dequeue_block(&g_queue, &blkinfo))<=0) { errprintf("queue_dequeue_block()=%ld=%s for file(%s) failed\n", (long)lres, error_int_to_string(lres), relpath); delfile=true; minorerr=true; break; } if (blkinfo.blkoffset!=filepos) { errprintf("file offset do not match for file(%s) failed: filepos=%lld, blkinfo.blkoffset=%lld, blkinfo.blkrealsize=%lld\n", relpath, (long long)filepos, (long long)blkinfo.blkoffset, (long long)blkinfo.blkrealsize); free(blkinfo.blkdata); delfile=true; minorerr=true; break; } if (datafile_write(datafile, blkinfo.blkdata, blkinfo.blkrealsize)!=FSAERR_SUCCESS) { free(blkinfo.blkdata); delfile=true; minorerr=true; fatalerr=true; break; } free(blkinfo.blkdata); } if ((minorerr==false) && (datafile_close(datafile, md5sumcalc, sizeof(md5sumcalc))!=0)) minorerr=true; if ((minorerr==false) && (excluded==false)) { if (extractar_restore_attr_everything(exar, objtype, fullpath, relpath, d)!=0) { msgprintf(MSG_STACK, "cannot restore file attributes for file [%s]\n", relpath); minorerr=true; } // restore parent dir mtime/atime if (utimes(parentdir, tv)!=0) { sysprintf("utimes(%s) failed\n", parentdir); minorerr=true; } } // empty files have no footer (no need for a checksum) if ((fatalerr==false) && (filesize>0)) { if (queue_dequeue_header(&g_queue, &footerdico, magic, NULL)<=0) { errprintf("queue_dequeue_header() failed: cannot read footer dico\n"); minorerr=true; goto restore_obj_regfile_unique_end; } if (excluded!=true) { if (memcmp(magic, FSA_MAGIC_FILF, FSA_SIZEOF_MAGIC)!=0) { errprintf("header is not what we expected: found=[%s] and expected=[%s]\n", magic, FSA_MAGIC_FILF); minorerr=true; goto restore_obj_regfile_unique_end; } if (dico_get_data(footerdico, 0, BLOCKFOOTITEMKEY_MD5SUM, md5sumorig, 16, NULL)) { errprintf("cannot get md5sum from file footer for file=[%s]\n", relpath); minorerr=true; goto restore_obj_regfile_unique_end; } if (memcmp(md5sumcalc, md5sumorig, 16)!=0) { errprintf("cannot restore file %s, file is corrupt\n", relpath); delfile=true; // don't leave corrupt data in the file minorerr=true; goto restore_obj_regfile_unique_end; } } } restore_obj_regfile_unique_end: if (delfile==true) { errprintf("removing %s\n", fullpath); unlink(fullpath); } if (excluded!=true) { if (minorerr==true) exar->stats.err_regfile++; else exar->stats.cnt_regfile++; } if (get_interrupted()==true) errprintf("operation has been interrupted\n"); dico_destroy(footerdico); dico_destroy(d); datafile_destroy(datafile); return (fatalerr==false)?(0):(-1); } int extractar_restore_object(cextractar *exar, int *errors, char *destdir, cdico *dicoattr, int fstype) { char relpath[PATH_MAX]; char fullpath[PATH_MAX]; u64 filesize; u32 objtype; int res; // init *errors=0; if (dico_get_data(dicoattr, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_PATH, relpath, sizeof(relpath), NULL)!=0) return -1; if (dico_get_u32(dicoattr, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_OBJTYPE, &objtype)!=0) return -2; if (dico_get_u64(dicoattr, DICO_OBJ_SECTION_STDATTR, DISKITEMKEY_SIZE, &filesize)!=0) return -3; concatenate_paths(fullpath, sizeof(fullpath), destdir, relpath); // ---- recreate specific object on the filesystem switch (objtype) { case OBJTYPE_DIR: msgprintf(MSG_DEBUG2, "objtype=OBJTYPE_DIR, path=[%s]\n", relpath); res=extractar_restore_obj_directory(exar, fullpath, relpath, destdir, dicoattr, objtype, fstype); break; case OBJTYPE_SYMLINK: msgprintf(MSG_DEBUG2, "objtype=OBJTYPE_SYMLINK, path=[%s]\n", relpath); res=extractar_restore_obj_symlink(exar, fullpath, relpath, destdir, dicoattr, objtype, fstype); break; case OBJTYPE_HARDLINK: msgprintf(MSG_DEBUG2, "objtype=OBJTYPE_HARDLINK, path=[%s]\n", relpath); res=extractar_restore_obj_hardlink(exar, fullpath, relpath, destdir, dicoattr, objtype, fstype); break; case OBJTYPE_CHARDEV: msgprintf(MSG_DEBUG2, "objtype=OBJTYPE_CHARDEV, path=[%s]\n", relpath); res=extractar_restore_obj_devfile(exar, fullpath, relpath, destdir, dicoattr, objtype, fstype); break; case OBJTYPE_BLOCKDEV: msgprintf(MSG_DEBUG2, "objtype=OBJTYPE_BLOCKDEV, path=[%s]\n", relpath); res=extractar_restore_obj_devfile(exar, fullpath, relpath, destdir, dicoattr, objtype, fstype); break; case OBJTYPE_FIFO: msgprintf(MSG_DEBUG2, "objtype=OBJTYPE_FIFO, path=[%s]\n", relpath); res=extractar_restore_obj_devfile(exar, fullpath, relpath, destdir, dicoattr, objtype, fstype); break; case OBJTYPE_SOCKET: msgprintf(MSG_DEBUG2, "objtype=OBJTYPE_SOCKET, path=[%s]\n", relpath); res=extractar_restore_obj_devfile(exar, fullpath, relpath, destdir, dicoattr, objtype, fstype); break; case OBJTYPE_REGFILEUNIQUE: msgprintf(MSG_DEBUG2, "objtype=OBJTYPE_REGFILEUNIQUE, path=[%s]\n", relpath); if ((res=extractar_restore_obj_regfile_unique(exar, fullpath, relpath, destdir, dicoattr, objtype, fstype))<0) { msgprintf(MSG_STACK, "restore_obj_regfile_unique(%s) failed with res=%d\n", relpath, res); return -1; } break; case OBJTYPE_REGFILEMULTI: msgprintf(MSG_DEBUG2, "objtype=OBJTYPE_REGFILEMULTI, path=[%s]\n", relpath); if ((res=extractar_restore_obj_regfile_multi(exar, destdir, dicoattr, objtype, fstype))<0) { msgprintf(MSG_STACK, "restore_obj_regfile_multi(%s) failed with res=%d\n", relpath, res); return -1; } break; default: errprintf("Unknown objtype %d\n", objtype); return -3; } if (res!=0) // value returned by restore_obj_xxx() { errprintf("Restoring file=[%s], objtype=[%s] failed\n", fullpath, get_objtype_name(objtype)); return -1; } return 0; } int extractar_extract_read_objects(cextractar *exar, int *errors, char *destdir, int fstype) { char magic[FSA_SIZEOF_MAGIC+1]; cdico *dicoattr=NULL; int headerisend; int headerisobj; u16 checkfsid; int curerr; int type; int res; // init memset(magic, 0, sizeof(magic)); *errors=0; do { // skip the garbage (just ignore everything until the next FSA_MAGIC_OBJT) // in case the archive is corrupt and random data has been added / removed in the archive do { if (queue_check_next_item(&g_queue, &type, magic)!=0) { errprintf("queue_check_next_item() failed: cannot read object from archive\n"); return -1; } headerisobj=(memcmp(magic, FSA_MAGIC_OBJT, FSA_SIZEOF_MAGIC)==0); headerisend=(memcmp(magic, FSA_MAGIC_DATF, FSA_SIZEOF_MAGIC)==0); if (headerisobj!=true && headerisend!=true) // did not find expected header: skip garbage in archive { errprintf("unexpected header found in archive, skipping it: type=%d, magic=[%s]\n", type, (type==QITEM_TYPE_HEADER)?(magic):"-block-"); if (queue_destroy_first_item(&g_queue)!=0) { errprintf("queue_destroy_first_item() failed: cannot read object from archive\n"); return -1; } } } while ((headerisobj!=true) && (headerisend!=true)); if (headerisobj==true) // if it's an object header { // read object header from archive while (queue_dequeue_header(&g_queue, &dicoattr, magic, &checkfsid)<=0) { errprintf("queue_dequeue_header() failed\n"); (*errors)++; } if (checkfsid==exar->fsid) // if filesystem-id is correct { if ((res=extractar_restore_object(exar, &curerr, destdir, dicoattr, fstype))!=0) { msgprintf(MSG_STACK, "restore_object() failed with res=%d\n", res); //dico_destroy(dicoattr); return -1; // fatal error } } else // wrong filesystem-id { errprintf("restore_object(): object has a wrong filesystem id: found=[%d], expected=[%d]\n", checkfsid, exar->fsid); (*errors)++; } //dico_destroy(dicoattr); } } while ((headerisend!=true) && (get_abort()==false)); return 0; } int extractar_read_mainhead(cextractar *exar, cdico **dicomainhead) { u8 bufcheckclear[FSA_CHECKPASSBUF_SIZE+8]; u8 bufcheckcrypt[FSA_CHECKPASSBUF_SIZE+8]; char magic[FSA_SIZEOF_MAGIC+1]; u16 cryptbufsize; u8 md5sumar[16]; u8 md5sumnew[16]; u64 clearsize; int passlen; u32 temp32; assert(exar); assert(dicomainhead); // init memset(magic, 0, sizeof(magic)); if (queue_dequeue_header(&g_queue, dicomainhead, magic, NULL)<=0) { errprintf("queue_dequeue_header() failed: cannot read main header\n"); return -1; } if (memcmp(magic, FSA_MAGIC_MAIN, FSA_SIZEOF_MAGIC)!=0) { errprintf("header is not what we expected: found=[%s] and expected=[%s]\n", magic, FSA_MAGIC_MAIN); return -1; } if (dico_get_u32(*dicomainhead, 0, MAINHEADKEY_ARCHTYPE, &exar->ai.archtype)!=0) { errprintf("cannot find MAINHEADKEY_ARCHTYPE in main-header\n"); return -1; } if (exar->ai.archtype==ARCHTYPE_FILESYSTEMS && dico_get_u64(*dicomainhead, 0, MAINHEADKEY_FSCOUNT, &exar->ai.fscount)!=0) { errprintf("cannot find MAINHEADKEY_FSCOUNT in main-header\n"); return -1; } if (dico_get_u32(*dicomainhead, 0, MAINHEADKEY_ARCHIVEID, &exar->ai.archid)!=0) { errprintf("cannot find MAINHEADKEY_ARCHIVEID in main-header\n"); return -1; } if (dico_get_data(*dicomainhead, 0, MAINHEADKEY_FILEFORMATVER, exar->ai.filefmt, FSA_MAX_FILEFMTLEN, NULL)!=0) { errprintf("cannot find MAINHEADKEY_FILEFORMATVER in main-header\n"); return -1; } if (dico_get_data(*dicomainhead, 0, MAINHEADKEY_PROGVERCREAT, exar->ai.creatver, FSA_MAX_PROGVERLEN, NULL)!=0) { errprintf("cannot find MAINHEADKEY_PROGVERCREAT in main-header\n"); return -1; } if (dico_get_data(*dicomainhead, 0, MAINHEADKEY_ARCHLABEL, exar->ai.label, FSA_MAX_LABELLEN, NULL)!=0) { errprintf("cannot find MAINHEADKEY_ARCHLABEL in main-header\n"); return -1; } if (dico_get_u32(*dicomainhead, 0, MAINHEADKEY_COMPRESSALGO, &exar->ai.compalgo)!=0) { errprintf("cannot find MAINHEADKEY_COMPRESSALGO in main-header\n"); return -1; } if (dico_get_u32(*dicomainhead, 0, MAINHEADKEY_ENCRYPTALGO, &exar->ai.cryptalgo)!=0) { errprintf("cannot find MAINHEADKEY_ENCRYPTALGO in main-header\n"); return -1; } if (dico_get_u32(*dicomainhead, 0, MAINHEADKEY_COMPRESSLEVEL, &exar->ai.complevel)!=0) { errprintf("cannot find MAINHEADKEY_COMPRESSLEVEL in main-header\n"); return -1; } if (dico_get_u32(*dicomainhead, 0, MAINHEADKEY_FSACOMPLEVEL, &exar->ai.fsacomp)!=0) { errprintf("cannot find MAINHEADKEY_FSACOMPLEVEL in main-header\n"); return -1; } if (dico_get_u64(*dicomainhead, 0, MAINHEADKEY_CREATTIME, &exar->ai.creattime)!=0) { errprintf("cannot find MAINHEADKEY_CREATTIME in main-header\n"); return -1; } // MAINHEADKEY_HASDIRSINFOHEAD has been introduced in fsarchiver-0.6.7: don't fail if missing if (dico_get_u32(*dicomainhead, 0, MAINHEADKEY_HASDIRSINFOHEAD, &temp32)==0) exar->ai.hasdirsinfohead=temp32; // check the file format. New versions based on "FsArCh_002" also understand "FsArCh_001" which is very close (and "FsArCh_00Y"=="FsArCh_001") if (strcmp(exar->ai.filefmt, FSA_FILEFORMAT)!=0 && strcmp(exar->ai.filefmt, "FsArCh_00Y")!=0 && strcmp(exar->ai.filefmt, "FsArCh_001")!=0) { errprintf("This archive is based on a different file format: [%s]. Cannot continue.\n", exar->ai.filefmt); errprintf("It has been created with fsarchiver [%s], you should extrat the archive using that version.\n", exar->ai.creatver); errprintf("The current version of the program is [%s], and it's based on format [%s]\n", FSA_VERSION, FSA_FILEFORMAT); return -1; } // read minimum fsarchiver version requirement if (dico_get_u64(*dicomainhead, 0, MAINHEADKEY_MINFSAVERSION, &exar->ai.minfsaver)!=0) exar->ai.minfsaver=FSA_VERSION_BUILD(0, 0, 0, 0); // not defined // if encryption is enabled, check the password is correct using the encrypted random buffer saved in the archive if (exar->ai.cryptalgo!=ENCRYPT_NONE) { memset(md5sumar, 0, sizeof(md5sumar)); memset(md5sumnew, 0, sizeof(md5sumnew)); if (dico_get_data(*dicomainhead, 0, MAINHEADKEY_BUFCHECKPASSCRYPTBUF, bufcheckcrypt, sizeof(bufcheckcrypt), &cryptbufsize)!=0) { errprintf("cannot find MAINHEADKEY_BUFCHECKPASSCRYPTBUF in main-header\n"); return -1; } if (dico_get_data(*dicomainhead, 0, MAINHEADKEY_BUFCHECKPASSCLEARMD5, md5sumar, sizeof(md5sumar)+99, NULL)!=0) { errprintf("cannot find MAINHEADKEY_BUFCHECKPASSCLEARMD5 in main-header\n"); return -1; } passlen=(g_options.encryptpass==NULL)?(0):(strlen((char*)g_options.encryptpass)); if ((g_options.encryptpass==NULL) || (passlenFSA_MAX_PASSLEN)) { errprintf("you have to provide the password which was used to create archive, no password given on the command line\n"); return -1; } if (crypto_blowfish(cryptbufsize, &clearsize, bufcheckcrypt, bufcheckclear, g_options.encryptpass, strlen((char*)g_options.encryptpass), false)==0) gcry_md_hash_buffer(GCRY_MD_MD5, md5sumnew, bufcheckclear, clearsize); if (memcmp(md5sumar, md5sumnew, 16)!=0) { errprintf("you have to provide the password which was used to create archive, cannot decrypt the test buffer.\n"); return -1; } } return 0; } int extractar_filesystem_extract(cextractar *exar, cdico *dicofs, cstrdico *dicocmdline) { char filesystem[FSA_MAX_FSNAMELEN]; char text[FSA_MAX_FSNAMELEN]; char fsbuf[FSA_MAX_FSNAMELEN]; char magic[FSA_SIZEOF_MAGIC+1]; char mountinfo[4096]; char partition[1024]; char mkfsoptions[1024]; char mkfslabel[1024]; char mkfsuuid[1024]; char tempbuf[1024]; cdico *dicobegin=NULL; cdico *dicoend=NULL; char mntbuf[PATH_MAX]; u64 fsbytestotal; u64 fsbytesused; char optbuf[128]; int readwrite; int errors=0; u64 minver; u64 curver; int fstype; int ret=0; int res; // init memset(magic, 0, sizeof(magic)); memset(partition, 0, sizeof(partition)); memset(mkfslabel, 0, sizeof(mkfslabel)); memset(mkfsuuid, 0, sizeof(mkfsuuid)); // read destination partition from dicocmdline if (strdico_get_string(dicocmdline, partition, sizeof(partition), "dest")!=0) { errprintf("strdico_get_string(dicocmdline, 'dest') failed\n"); return -1; } // check that the minimum fsarchiver version required is ok if (dico_get_u64(dicofs, 0, FSYSHEADKEY_MINFSAVERSION, &minver)!=0) minver=FSA_VERSION_BUILD(0, 6, 4, 0); // fsarchiver-0.6.4 is the first fsa version having fileformat="FsArCh_002" curver=FSA_VERSION_BUILD(PACKAGE_VERSION_A, PACKAGE_VERSION_B, PACKAGE_VERSION_C, PACKAGE_VERSION_D); msgprintf(MSG_VERB2, "Current fsarchiver version: %d.%d.%d.%d\n", (int)FSA_VERSION_GET_A(curver), (int)FSA_VERSION_GET_B(curver), (int)FSA_VERSION_GET_C(curver), (int)FSA_VERSION_GET_D(curver)); msgprintf(MSG_VERB2, "Minimum fsarchiver version for that filesystem: %d.%d.%d.%d\n", (int)FSA_VERSION_GET_A(minver), (int)FSA_VERSION_GET_B(minver), (int)FSA_VERSION_GET_C(minver), (int)FSA_VERSION_GET_D(minver)); if (curver < minver) { errprintf("This filesystem can only be restored with fsarchiver %d.%d.%d.%d or more recent\n", (int)FSA_VERSION_GET_A(minver), (int)FSA_VERSION_GET_B(minver), (int)FSA_VERSION_GET_C(minver), (int)FSA_VERSION_GET_D(minver)); return -1; } // check the partition is not mounted res=generic_get_mntinfo(partition, &readwrite, mntbuf, sizeof(mntbuf), optbuf, sizeof(optbuf), fsbuf, sizeof(fsbuf)); if (res==0) { errprintf("partition [%s] is mounted on [%s].\ncannot restore an archive to a partition " "which is mounted, unmount it first: umount %s\n", partition, mntbuf, mntbuf); return -1; } // ---- read filesystem-header from archive if (queue_dequeue_header(&g_queue, &dicobegin, magic, NULL)<=0) { errprintf("queue_dequeue_header() failed: cannot read file system dico\n"); return -1; } dico_destroy(dicobegin); if (memcmp(magic, FSA_MAGIC_FSYB, FSA_SIZEOF_MAGIC)!=0) { errprintf("header is not what we expected: found=[%s] and expected=[%s]\n", magic, FSA_MAGIC_FSYB); return -1; } // if a filesystem to use was specified: overwrite the default one if (strdico_get_string(dicocmdline, tempbuf, sizeof(tempbuf), "mkfs")==0) { snprintf(filesystem, sizeof(filesystem), "%s", tempbuf); } else if ((dico_get_string(dicofs, 0, FSYSHEADKEY_FILESYSTEM, filesystem, sizeof(filesystem)))<0) { errprintf("dico_get_string(FSYSHEADKEY_FILESYSTEM) failed\n"); return -1; } // read make file system options from dicocmdline if (strdico_get_string(dicocmdline, mkfsoptions, sizeof(mkfsoptions), "mkfsopt")!=0) { msgprintf(MSG_VERB2,"strdico_get_string(dicocmdline, 'mkfsopt') doesn't exist\n"); } if (strdico_get_string(dicocmdline, mkfslabel, sizeof(mkfslabel), "label")!=0) { msgprintf(MSG_VERB2,"strdico_get_string(dicocmdline, 'label') doesn't exist\n"); } if (strdico_get_string(dicocmdline, mkfsuuid, sizeof(mkfsuuid), "uuid")!=0) { msgprintf(MSG_VERB2,"strdico_get_string(dicocmdline, 'uuid') doesn't exist\n"); } if (dico_get_u64(dicofs, 0, FSYSHEADKEY_BYTESTOTAL, &fsbytestotal)!=0) { errprintf("dico_get_string(FSYSHEADKEY_BYTESTOTAL) failed\n"); return -1; } if (dico_get_u64(dicofs, 0, FSYSHEADKEY_BYTESUSED, &fsbytesused)!=0) { errprintf("dico_get_string(FSYSHEADKEY_BYTESUSED) failed\n"); return -1; } msgprintf(MSG_VERB2, "filesystem_type=[%s]\n", filesystem); msgprintf(MSG_VERB2, "filesystem_mkfsoptions=[%s]\n", mkfsoptions); msgprintf(MSG_VERB2, "filesystem_mkfslabel=[%s]\n", mkfslabel); msgprintf(MSG_VERB2, "filesystem_mkfsuuid=[%s]\n", mkfsuuid); msgprintf(MSG_VERB2, "filesystem_space_total=[%s]\n", format_size(fsbytestotal, text, sizeof(text), 'h')); msgprintf(MSG_VERB2, "filesystem_space_used=[%s]\n", format_size(fsbytesused, text, sizeof(text), 'h')); // get index of the filesystem in the filesystem table if (generic_get_fstype(filesystem, &fstype)!=0) { errprintf("filesystem [%s] is not supported by fsarchiver\n", filesystem); return -1; } // ---- make the filesystem if (filesys[fstype].mkfs(dicofs, partition, mkfsoptions, mkfslabel, mkfsuuid)!=0) { errprintf("cannot make filesystem %s on partition %s\n", filesystem, partition); return -1; } // ---- mount the new filesystem mkdir_recursive(mntbuf); generate_random_tmpdir(mntbuf, sizeof(mntbuf), 0); mkdir_recursive(mntbuf); if ((dico_get_string(dicofs, 0, FSYSHEADKEY_MOUNTINFO, mountinfo, sizeof(mountinfo)))<0) memset(mountinfo, 0, sizeof(mountinfo)); msgprintf(MSG_VERB1, "Mount information: [%s]\n", mountinfo); if (filesys[fstype].mount(partition, mntbuf, filesys[fstype].name, 0, mountinfo)!=0) { errprintf("partition [%s] cannot be mounted on %s. cannot continue.\n", partition, mntbuf); return -1; } if (extractar_extract_read_objects(exar, &errors, mntbuf, fstype)!=0) { msgprintf(MSG_STACK, "extract_read_objects(%s) failed\n", mntbuf); ret=-1; goto filesystem_extract_umount; } else if (errors>0) { msgprintf(MSG_DEBUG1, "extract_read_objects(%s) worked with errors\n", mntbuf); ret=-1; goto filesystem_extract_umount; } // read "end of file-system" header from archive if (queue_dequeue_header(&g_queue, &dicoend, magic, NULL)<=0) { errprintf("queue_dequeue_header() failed\n"); ret=-1; goto filesystem_extract_umount; } dico_destroy(dicoend); if ((get_interrupted()==false) && (memcmp(magic, FSA_MAGIC_DATF, FSA_SIZEOF_MAGIC)!=0)) { errprintf("header is not what we expected: found=[%s] and expected=[%s]\n", magic, FSA_MAGIC_DATF); goto filesystem_extract_umount; } filesystem_extract_umount: if (filesys[fstype].umount(partition, mntbuf)!=0) { sysprintf("cannot umount %s\n", mntbuf); ret=-1; } else { rmdir(mntbuf); // remove temp dir created by fsarchiver } return ret; } int oper_restore(char *archive, int argc, char **argv, int oper) { cdico *dicofsinfo[FSA_MAX_FSPERARCH]; cstrdico *dicoargv[FSA_MAX_FSPERARCH]; pthread_t thread_decomp[FSA_MAX_COMPJOBS]; char magic[FSA_SIZEOF_MAGIC+1]; cdico *dicomainhead=NULL; cdico *dirsinfo=NULL; pthread_t thread_reader; struct stat64 st; char *destdir; cextractar exar; u64 totalerr=0; u64 fscost; u64 curver; int errors=0; int ret=0; int i; // init memset(&exar, 0, sizeof(exar)); exar.cost_global=0; exar.cost_current=0; archreader_init(&exar.ai); // init misc data struct to zero for (i=0; i 0) { msgprintf(MSG_VERB2, "Current fsarchiver version: %d.%d.%d.%d\n", (int)FSA_VERSION_GET_A(curver), (int)FSA_VERSION_GET_B(curver), (int)FSA_VERSION_GET_C(curver), (int)FSA_VERSION_GET_D(curver)); msgprintf(MSG_VERB2, "Minimum fsarchiver version for that archive: %d.%d.%d.%d\n", (int)FSA_VERSION_GET_A(exar.ai.minfsaver), (int)FSA_VERSION_GET_B(exar.ai.minfsaver), (int)FSA_VERSION_GET_C(exar.ai.minfsaver), (int)FSA_VERSION_GET_D(exar.ai.minfsaver)); } if (((oper==OPER_RESTFS) || (oper==OPER_RESTDIR)) && (curver < exar.ai.minfsaver)) { errprintf("This archive can only be restored with fsarchiver %d.%d.%d.%d or more recent\n", (int)FSA_VERSION_GET_A(exar.ai.minfsaver), (int)FSA_VERSION_GET_B(exar.ai.minfsaver), (int)FSA_VERSION_GET_C(exar.ai.minfsaver), (int)FSA_VERSION_GET_D(exar.ai.minfsaver)); goto do_extract_error; } // show archive information if command is OPER_ARCHINFO if (oper==OPER_ARCHINFO && archinfo_show_mainhead(&exar.ai, dicomainhead)!=0) { errprintf("archinfo_show_mainhead(%s) failed\n", archive); goto do_extract_error; } // check that the operation requested on the command line matches the archive type switch (exar.ai.archtype) { case ARCHTYPE_DIRECTORIES: if (oper==OPER_RESTFS) { errprintf("this archive does not contain filesystems, cannot use \"restfs\". Try \"restdir\" instead.\n"); goto do_extract_error; } break; case ARCHTYPE_FILESYSTEMS: if (oper==OPER_RESTDIR) { errprintf("this archive does not contain simple directories, cannot use \"restdir\". Try \"restfs\" instead.\n"); goto do_extract_error; } break; default: errprintf("this archive has an unknown type: %d, cannot continue\n", exar.ai.archtype); goto do_extract_error; } // check the user did not specify an invalid filesystem id (id >= fscount) for (i=0; (i= exar.ai.fscount)) { errprintf("invalid filesystem id: [%d]. the filesystem id must be an integer between 0 and %d\n", (int)i, (int)(exar.ai.fscount-1)); goto do_extract_error; } } // read the fsinfo header for each filesystem for (i=0; (exar.ai.archtype==ARCHTYPE_FILESYSTEMS) && (i < exar.ai.fscount) && (i= 0.6.7 // so that they don't have error when they try to restore an archive which has that header if ((exar.ai.archtype==ARCHTYPE_DIRECTORIES) && (exar.ai.hasdirsinfohead==true)) { if (queue_dequeue_header(&g_queue, &dirsinfo, magic, NULL)<=0) { errprintf("queue_dequeue_header() failed: cannot read the dirsinfo header\n"); goto do_extract_error; } if (memcmp(magic, FSA_MAGIC_DIRS, FSA_SIZEOF_MAGIC)!=0) { errprintf("header is not what we expected: found=[%s] and expected=[%s]\n", magic, FSA_MAGIC_DIRS); goto do_extract_error; } if ((dirsinfo!=NULL) && (dico_get_u64(dirsinfo, 0, DIRSINFOKEY_TOTALCOST, &exar.cost_global)!=0)) { errprintf("cannot read DIRSINFOKEY_TOTALCOST in dirsinfo\n"); goto do_extract_error; } } if ((oper==OPER_RESTFS) || (oper==OPER_RESTDIR)) { if ((exar.ai.cryptalgo!=ENCRYPT_NONE) && (g_options.encryptalgo!=ENCRYPT_BLOWFISH)) { errprintf("this archive has been encrypted, you have to provide a password on the command line using option '-c'\n"); goto do_extract_error; } if (exar.ai.archtype==ARCHTYPE_FILESYSTEMS) { // extract filesystem contents for (i=0; (i < exar.ai.fscount) && (i < FSA_MAX_FSPERARCH) && (get_abort()==false); i++) { if (dicoargv[i]!=NULL) // that filesystem has been requested on the command line { exar.fsid=i; memset(&exar.stats, 0, sizeof(exar.stats)); // init stats to zero msgprintf(MSG_VERB1, "============= extracting filesystem %d =============\n", i); if (extractar_filesystem_extract(&exar, dicofsinfo[i], dicoargv[i])!=0) { msgprintf(MSG_STACK, "extract_filesystem(%d) failed\n", i); goto do_extract_error; } if (get_abort()==false) stats_show(exar.stats, i); totalerr+=stats_errcount(exar.stats); } // else: the thread_archio automatically skips filesystem when g_fsbitmap[fsid]==0 } } else if (exar.ai.archtype==ARCHTYPE_DIRECTORIES) { exar.fsid=0; destdir=argv[0]; if (stat64(destdir, &st)!=0) { switch (errno) { case ENOENT: sysprintf("%s does not exist, cannot continue\n", destdir); break; default: sysprintf("fstat64(%s) failed\n", destdir); break; } goto do_extract_error; } if (!S_ISDIR(st.st_mode)) { errprintf("%s is not a valid directory, cannot continue\n", destdir); goto do_extract_error; } memset(&exar.stats, 0, sizeof(exar.stats)); // init stats to zero if (extractar_extract_read_objects(&exar, &errors, destdir, 0)!=0) // TODO: get the right fstype { errprintf("extract_read_objects(%s) failed\n", destdir); goto do_extract_error; } stats_show(exar.stats, 0); totalerr+=stats_errcount(exar.stats); } else { errprintf("unsupported archtype: %d\n", exar.ai.archtype); goto do_extract_error; } } if (get_abort()==true) msgprintf(MSG_FORCE, "operation aborted by user\n"); if (get_abort()==false && get_stopfillqueue()==false) goto do_extract_success; do_extract_error: msgprintf(MSG_DEBUG1, "THREAD-MAIN2: exit error\n"); ret=-1; do_extract_success: msgprintf(MSG_DEBUG1, "THREAD-MAIN2: exit\n"); set_stopfillqueue(); // ask thread-archio to terminate msgprintf(MSG_DEBUG2, "queue_count_items_todo(&g_queue)=%d\n", (int)queue_count_items_todo(&g_queue)); while (queue_count_items_todo(&g_queue)>0) // let thread_compress process all the pending blocks { msgprintf(MSG_DEBUG2, "queue_count_items_todo(): %ld\n", (long)queue_count_items_todo(&g_queue)); usleep(10000); } msgprintf(MSG_DEBUG2, "queue_count_items_todo(&g_queue)=%d\n", (int)queue_count_items_todo(&g_queue)); // now we are sure that thread_compress is not working on an item in the queue so we can empty the queue while (get_secthreads()>0 && queue_get_end_of_queue(&g_queue)==false) queue_destroy_first_item(&g_queue); msgprintf(MSG_DEBUG1, "THREAD-MAIN2: queue is now empty\n"); // the queue is empty, so thread_compress should now exit for (i=0; (i0) ret=-1; dico_destroy(dicomainhead); archreader_destroy(&exar.ai); return ret; } fsarchiver-0.8.4/src/logfile.h0000644000176100017610000000136713242523705013177 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __LOGFILE_H__ #define __LOGFILE_H__ extern int g_logfile; int logfile_open(); int logfile_close(); int logfile_write(char *str, int len); #endif // __LOGFILE_H__ fsarchiver-0.8.4/src/fs_ext2.h0000644000176100017610000003261413242523705013127 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __FS_EXT2_H__ #define __FS_EXT2_H__ struct s_dico; struct s_strlist; enum {EXTFSTYPE_EXT2, EXTFSTYPE_EXT3, EXTFSTYPE_EXT4}; int ext2_mkfs(struct s_dico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid); int ext3_mkfs(struct s_dico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid); int ext4_mkfs(struct s_dico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid); int extfs_getinfo(struct s_dico *d, char *devname); int extfs_get_fstype_from_compat_flags(u32 compat, u32 incompat, u32 ro_compat); int extfs_get_reqmntopt(char *partition, struct s_strlist *reqopt, struct s_strlist *badopt); int extfs_mkfs(struct s_dico *d, char *partition, int extfstype, char *fsoptions, char *mkfslabel, char *mkfsuuid); int extfs_mount(char *partition, char *mntbuf, char *fsbuf, int flags, char *mntinfo); int extfs_umount(char *partition, char *mntbuf); int extfs_test(char *partition, int extfstype); int ext2_test(char *partition); int ext3_test(char *partition); int ext4_test(char *partition); u64 check_prog_version(char *prog); /* for s_feature_compat */ #define FSA_EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 #define FSA_EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 #define FSA_EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 #define FSA_EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 #define FSA_EXT2_FEATURE_COMPAT_RESIZE_INODE 0x0010 #define FSA_EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 #define FSA_EXT2_FEATURE_COMPAT_LAZY_BG 0x0040 #define FSA_EXT4_FEATURE_COMPAT_SPARSE_SUPER2 0x0200 /* for s_feature_ro_compat */ #define FSA_EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 #define FSA_EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 #define FSA_EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 #define FSA_EXT4_FEATURE_RO_COMPAT_HUGE_FILE 0x0008 #define FSA_EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010 #define FSA_EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020 #define FSA_EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040 #define FSA_EXT4_FEATURE_RO_COMPAT_QUOTA 0x0100 #define FSA_EXT4_FEATURE_RO_COMPAT_BIGALLOC 0x0200 #define FSA_EXT4_FEATURE_RO_COMPAT_METADATA_CSUM 0x0400 #define FSA_EXT4_FEATURE_RO_COMPAT_READONLY 0x1000 #define FSA_EXT4_FEATURE_RO_COMPAT_PROJECT 0x2000 /* for s_feature_incompat */ #define FSA_EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 #define FSA_EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 #define FSA_EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 #define FSA_EXT2_FEATURE_INCOMPAT_META_BG 0x0010 #define FSA_EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040 #define FSA_EXT4_FEATURE_INCOMPAT_64BIT 0x0080 #define FSA_EXT4_FEATURE_INCOMPAT_MMP 0x0100 #define FSA_EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 #define FSA_EXT4_FEATURE_INCOMPAT_EA_INODE 0x0400 #define FSA_EXT4_FEATURE_INCOMPAT_DIRDATA 0x1000 #define FSA_EXT4_FEATURE_INCOMPAT_CSUM_SEED 0x2000 #define FSA_EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 #define FSA_EXT4_FEATURE_INCOMPAT_INLINEDATA 0x8000 #define FSA_EXT4_FEATURE_INCOMPAT_ENCRYPT 0x10000 #define FSA_EXT2_FEATURE_COMPAT_SUPP FSA_EXT2_FEATURE_COMPAT_EXT_ATTR #define FSA_EXT2_FEATURE_INCOMPAT_SUPP (FSA_EXT2_FEATURE_INCOMPAT_FILETYPE| \ FSA_EXT2_FEATURE_INCOMPAT_META_BG) #define FSA_EXT2_FEATURE_RO_COMPAT_SUPP (FSA_EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ FSA_EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ FSA_EXT2_FEATURE_RO_COMPAT_BTREE_DIR) #define FSA_EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~FSA_EXT2_FEATURE_INCOMPAT_SUPP #define FSA_EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~FSA_EXT2_FEATURE_RO_COMPAT_SUPP #define FSA_EXT3_FEATURE_COMPAT_SUPP FSA_EXT2_FEATURE_COMPAT_EXT_ATTR #define FSA_EXT3_FEATURE_INCOMPAT_SUPP (FSA_EXT2_FEATURE_INCOMPAT_FILETYPE| \ FSA_EXT3_FEATURE_INCOMPAT_RECOVER| \ FSA_EXT2_FEATURE_INCOMPAT_META_BG) #define FSA_EXT3_FEATURE_RO_COMPAT_SUPP (FSA_EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ FSA_EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ FSA_EXT2_FEATURE_RO_COMPAT_BTREE_DIR) #define FSA_EXT3_FEATURE_INCOMPAT_UNSUPPORTED ~FSA_EXT3_FEATURE_INCOMPAT_SUPP #define FSA_EXT3_FEATURE_RO_COMPAT_UNSUPPORTED ~FSA_EXT3_FEATURE_RO_COMPAT_SUPP // -------------- features supported by the current fsarchiver version -------------------- #define FSA_FEATURE_COMPAT_SUPP (u64)(FSA_EXT2_FEATURE_COMPAT_DIR_PREALLOC| \ FSA_EXT2_FEATURE_COMPAT_IMAGIC_INODES| \ FSA_EXT3_FEATURE_COMPAT_HAS_JOURNAL| \ FSA_EXT2_FEATURE_COMPAT_EXT_ATTR| \ FSA_EXT2_FEATURE_COMPAT_RESIZE_INODE| \ FSA_EXT2_FEATURE_COMPAT_DIR_INDEX| \ FSA_EXT2_FEATURE_COMPAT_LAZY_BG| \ FSA_EXT4_FEATURE_COMPAT_SPARSE_SUPER2) #define FSA_FEATURE_RO_COMPAT_SUPP (u64)(FSA_EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER|\ FSA_EXT2_FEATURE_RO_COMPAT_LARGE_FILE|\ FSA_EXT2_FEATURE_RO_COMPAT_BTREE_DIR|\ FSA_EXT4_FEATURE_RO_COMPAT_HUGE_FILE|\ FSA_EXT4_FEATURE_RO_COMPAT_GDT_CSUM|\ FSA_EXT4_FEATURE_RO_COMPAT_DIR_NLINK|\ FSA_EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE|\ FSA_EXT4_FEATURE_RO_COMPAT_QUOTA|\ FSA_EXT4_FEATURE_RO_COMPAT_BIGALLOC|\ FSA_EXT4_FEATURE_RO_COMPAT_METADATA_CSUM|\ FSA_EXT4_FEATURE_RO_COMPAT_READONLY|\ FSA_EXT4_FEATURE_RO_COMPAT_PROJECT) #define FSA_FEATURE_INCOMPAT_SUPP (u64)(FSA_EXT2_FEATURE_INCOMPAT_FILETYPE|\ FSA_EXT3_FEATURE_INCOMPAT_RECOVER|\ FSA_EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|\ FSA_EXT2_FEATURE_INCOMPAT_META_BG|\ FSA_EXT4_FEATURE_INCOMPAT_EXTENTS|\ FSA_EXT4_FEATURE_INCOMPAT_64BIT|\ FSA_EXT4_FEATURE_INCOMPAT_MMP|\ FSA_EXT4_FEATURE_INCOMPAT_FLEX_BG|\ FSA_EXT4_FEATURE_INCOMPAT_EA_INODE|\ FSA_EXT4_FEATURE_INCOMPAT_DIRDATA|\ FSA_EXT4_FEATURE_INCOMPAT_CSUM_SEED|\ FSA_EXT4_FEATURE_INCOMPAT_LARGEDIR|\ FSA_EXT4_FEATURE_INCOMPAT_INLINEDATA) // FSA_FEATURE_INCOMPAT_SUPP does not include FSA_EXT4_FEATURE_INCOMPAT_ENCRYPT // as it would require special handling to mount an encrypted filesystem // EXT2_FLAG_SOFTSUPP_FEATURES not defined on old e2fsprogs versions #ifndef EXT2_FLAG_SOFTSUPP_FEATURES #define EXT2_FLAG_SOFTSUPP_FEATURES 0x8000 #endif // this struct is incomplete in e2fsprogs-1.39.x/ext2fs.h struct fsa_ext2_sb { u32 s_inodes_count; /* Inodes count */ u32 s_blocks_count; /* Blocks count */ u32 s_r_blocks_count; /* Reserved blocks count */ u32 s_free_blocks_count; /* Free blocks count */ u32 s_free_inodes_count; /* Free inodes count */ u32 s_first_data_block; /* First Data Block */ u32 s_log_block_size; /* Block size */ s32 s_log_frag_size; /* Fragment size */ u32 s_blocks_per_group; /* # Blocks per group */ u32 s_frags_per_group; /* # Fragments per group */ u32 s_inodes_per_group; /* # Inodes per group */ u32 s_mtime; /* Mount time */ u32 s_wtime; /* Write time */ u16 s_mnt_count; /* Mount count */ s16 s_max_mnt_count; /* Maximal mount count */ u16 s_magic; /* Magic signature */ u16 s_state; /* File system state */ u16 s_errors; /* Behaviour when detecting errors */ u16 s_minor_rev_level; /* minor revision level */ u32 s_lastcheck; /* time of last check */ u32 s_checkinterval; /* max. time between checks */ u32 s_creator_os; /* OS */ u32 s_rev_level; /* Revision level */ u16 s_def_resuid; /* Default uid for reserved blocks */ u16 s_def_resgid; /* Default gid for reserved blocks */ /* * These fields are for EXT2_DYNAMIC_REV superblocks only. * * Note: the difference between the compatible feature set and * the incompatible feature set is that if there is a bit set * in the incompatible feature set that the kernel doesn't * know about, it should refuse to mount the filesystem. * * e2fsck's requirements are more strict; if it doesn't know * about a feature in either the compatible or incompatible * feature set, it must abort and not try to meddle with * things it doesn't understand... */ u32 s_first_ino; /* First non-reserved inode */ u16 s_inode_size; /* size of inode structure */ u16 s_block_group_nr; /* block group # of this superblock */ u32 s_feature_compat; /* compatible feature set */ u32 s_feature_incompat; /* incompatible feature set */ u32 s_feature_ro_compat; /* readonly-compatible feature set */ u8 s_uuid[16]; /* 128-bit uuid for volume */ char s_volume_name[16]; /* volume name */ char s_last_mounted[64]; /* directory where last mounted */ u32 s_algorithm_usage_bitmap; /* For compression */ /* * Performance hints. Directory preallocation should only * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on. */ u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ u16 s_reserved_gdt_blocks; /* Per group table for online growth */ /* * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set. */ u8 s_journal_uuid[16]; /* uuid of journal superblock */ u32 s_journal_inum; /* inode number of journal file */ u32 s_journal_dev; /* device number of journal file */ u32 s_last_orphan; /* start of list of inodes to delete */ u32 s_hash_seed[4]; /* HTREE hash seed */ u8 s_def_hash_version; /* Default hash version to use */ u8 s_jnl_backup_type; /* Default type of journal backup */ u16 s_desc_size; /* Group desc. size: INCOMPAT_64BIT */ u32 s_default_mount_opts; u32 s_first_meta_bg; /* First metablock group */ u32 s_mkfs_time; /* When the filesystem was created */ u32 s_jnl_blocks[17]; /* Backup of the journal inode */ u32 s_blocks_count_hi; /* Blocks count high 32bits */ u32 s_r_blocks_count_hi; /* Reserved blocks count high 32 bits*/ u32 s_free_blocks_hi; /* Free blocks count */ u16 s_min_extra_isize; /* All inodes have at least # bytes */ u16 s_want_extra_isize; /* New inodes should reserve # bytes */ u32 s_flags; /* Miscellaneous flags */ u16 s_raid_stride; /* RAID stride */ u16 s_mmp_interval; /* # seconds to wait in MMP checking */ u64 s_mmp_block; /* Block for multi-mount protection */ u32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/ u8 s_log_groups_per_flex; /* FLEX_BG group size */ u8 s_reserved_char_pad; u16 s_reserved_pad; /* Padding to next 32bits */ u32 s_reserved[162]; /* Padding to the end of the block */ }; #endif // __FS_EXT2_H__ fsarchiver-0.8.4/src/devinfo.h0000644000176100017610000000214013242523705013176 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __DEVINFO_H__ #define __DEVINFO_H__ enum {BLKDEV_INVALID=-1, BLKDEV_PHYSDISK=0, BLKDEV_FILESYSDEV=1}; struct s_devinfo { int devtype; char devname[FSA_MAX_DEVLEN]; char longname[FSA_MAX_DEVLEN]; char label[FSA_MAX_LABELLEN]; char uuid[FSA_MAX_UUIDLEN]; char fsname[FSA_MAX_FSNAMELEN]; char name[512]; char txtsize[64]; u64 devsize; int minor; int major; u64 rdev; }; int get_devinfo(struct s_devinfo *outdev, char *indevname, int min, int maj); #endif // __DEVINFO_H__ fsarchiver-0.8.4/src/dico.c0000644000176100017610000002073013242523705012462 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include "fsarchiver.h" #include "dico.h" #include "common.h" #include "error.h" cdico *dico_alloc() { cdico *d; if ((d=malloc(sizeof(cdico)))==NULL) return NULL; d->head=NULL; return d; } int dico_destroy(cdico *d) { cdicoitem *item, *next; if (d==NULL) return -1; item=d->head; while (item!=NULL) { next=item->next; if (item->data!=NULL) free(item->data); free(item); item=next; } free(d); return 0; } int dico_add_data(cdico *d, u8 section, u16 key, const void *data, u16 size) { return dico_add_generic(d, section, key, data, size, DICTYPE_DATA); } // add an item to the dico, fails if an item with that (section,key) already exists int dico_add_generic(cdico *d, u8 section, u16 key, const void *data, u16 size, u8 type) { cdicoitem *item, *lnew, *last; assert (d); // allocate object lnew=malloc(sizeof(cdicoitem)); if (!lnew) { errprintf("malloc(%ld) failed: out of memory\n", (long)sizeof(cdicoitem)); return -3; } memset(lnew, 0, sizeof(cdicoitem)); // go to the end of the item and check for duplicates if (d->head==NULL) // item is empty { d->head=lnew; } else // item is not empty { for (item=d->head; item!=NULL; item=item->next) { last=item; if (item->section==section && item->key==key) { errprintf("dico_add_generic(): item with key=%ld is already in dico\n", (long)item->key); return -3; } } last->next=lnew; } // copy key lnew->key=key; lnew->section=section; lnew->size=size; lnew->type=type; lnew->data=NULL; // allocate memory for data if (size > 0) { lnew->data=malloc(size); if (!lnew->data) { errprintf("malloc(%ld) failed: out of memory\n", (long)size); return -3; } // copy data memcpy(lnew->data, data, size); } return 0; } int dico_get_data(cdico *d, u8 section, u16 key, void *data, u16 maxsize, u16 *size) { return dico_get_generic(d, section, key, data, maxsize, size); } int dico_get_generic(cdico *d, u8 section, u16 key, void *data, u16 maxsize, u16 *size) { cdicoitem *item; assert(d); assert(data); // size can be NULL if the user does not want to know the size if (size!=NULL) *size=0; if (d->head==NULL) { msgprintf(MSG_DEBUG1, "dico is empty\n"); return -1; } if (maxsize<1) { msgprintf(MSG_DEBUG1, "case1: maxsize=%d\n", maxsize); return -3; } for (item=d->head; item!=NULL; item=item->next) { if ((item!=NULL) && (item->key==key && item->section==section)) { if (item->size > maxsize) // item is too big { msgprintf(MSG_DEBUG1, "case2: (item->size > maxsize): item->size =%d, maxsize=%d\n", item->size, maxsize); return -4; } if ((item->size>0) && (item->data!=NULL)) // there may be no data (size==0) memcpy(data, item->data, item->size); if (size!=NULL) *size=item->size; return 0; } } msgprintf(MSG_DEBUG1, "case3: not found\n"); return -5; // not found } int dico_count_one_section(cdico *d, u8 section) { cdicoitem *item; int count; assert(d); count=0; for (item=d->head; item!=NULL; item=item->next) if (item->section==section) count++; return count; } int dico_count_all_sections(cdico *d) { cdicoitem *item; int count; assert(d); count=0; for (item=d->head; item!=NULL; item=item->next) count++; return count; } int dico_add_u16(cdico *d, u8 section, u16 key, u16 data) { u16 ledata; assert(d); ledata=cpu_to_le16(data); return dico_add_generic(d, section, key, &ledata, sizeof(ledata), DICTYPE_U16); } int dico_add_u32(cdico *d, u8 section, u16 key, u32 data) { u32 ledata; assert(d); ledata=cpu_to_le32(data); return dico_add_generic(d, section, key, &ledata, sizeof(ledata), DICTYPE_U32); } int dico_add_u64(cdico *d, u8 section, u16 key, u64 data) { u64 ledata; assert (d); ledata=cpu_to_le64(data); return dico_add_generic(d, section, key, &ledata, sizeof(ledata), DICTYPE_U64); } int dico_add_string(cdico *d, u8 section, u16 key, const char *szstring) { u16 len; assert(d); assert(szstring); len=strlen(szstring); return dico_add_generic(d, section, key, szstring, len+1, DICTYPE_STRING); } int dico_get_u16(cdico *d, u8 section, u16 key, u16 *data) { u16 ledata; u16 size; assert(d); assert(data); *data=0; if (dico_get_data(d, section, key, &ledata, sizeof(ledata), &size)!=0) return -1; *data=le16_to_cpu(ledata); return 0; } int dico_get_u32(cdico *d, u8 section, u16 key, u32 *data) { u32 ledata; u16 size; assert(d); assert(data); *data=0; if (dico_get_data(d, section, key, &ledata, sizeof(ledata), &size)!=0) return -1; *data=le32_to_cpu(ledata); return 0; } int dico_get_u64(cdico *d, u8 section, u16 key, u64 *data) { u64 ledata; u16 size; assert(d); assert(data); *data=0; if (dico_get_data(d, section, key, &ledata, sizeof(ledata), &size)!=0) return -1; *data=le64_to_cpu(ledata); return 0; } int dico_get_string(cdico *d, u8 section, u16 key, char *buffer, u16 bufsize) { u16 size; assert(d); assert(buffer); memset(buffer, 0, bufsize); return dico_get_data(d, section, key, buffer, bufsize, &size); } int dico_show(cdico *d, u8 section, char *debugtxt) { char buffer[2048]; char text[2048]; cdicoitem *item; assert(d); msgprintf(MSG_FORCE, "\n-----------------debug-dico-begin(%s)---------------\n", debugtxt); if (d->head) { for (item=d->head; item!=NULL; item=item->next) { if (item->section==section) { snprintf(buffer, sizeof(buffer), "key=[%ld], sizeof(data)=[%d], ", (long)item->key, (int)item->size); switch (item->type) { case DICTYPE_U8: snprintf(text, sizeof(text), "type=u8, size=[%d]", (int)item->size); break; case DICTYPE_U16: snprintf(text, sizeof(text), "type=u16, size=[%d]", (int)item->size); break; case DICTYPE_U32: snprintf(text, sizeof(text), "type=u32, size=[%d]", (int)item->size); break; case DICTYPE_U64: snprintf(text, sizeof(text), "type=u64, size=[%d]", (int)item->size); break; case DICTYPE_STRING: snprintf(text, sizeof(text), "type=str, size=[%d], data=[%s]", (int)item->size, (char*)item->data); break; case DICTYPE_DATA: snprintf(text, sizeof(text), "type=dat, size=[%d]", (int)item->size); break; default: snprintf(text, sizeof(text), "type=unknown"); break; } strlcatf(buffer, sizeof(buffer) ,"%s", text); msgprintf(MSG_FORCE, "%s\n", buffer); } } } else { msgprintf(MSG_FORCE, "dico is empty\n"); } msgprintf(MSG_FORCE, "-----------------debug-dico-end(%s)------------------\n\n", debugtxt); return 0; } fsarchiver-0.8.4/src/archinfo.h0000644000176100017610000000160413242523705013341 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __ARCHINFO_H__ #define __ARCHINFO_H__ struct s_dico; struct s_archreader; int archinfo_show_mainhead(struct s_archreader *ai, struct s_dico *dicomainhead); int archinfo_show_fshead(struct s_dico *dicofshead, int fsid); char *compalgostr(int algo); char *cryptalgostr(int algo); #endif // __ARCHINFO_H__ fsarchiver-0.8.4/src/oper_save.h0000644000176100017610000000133113242523705013530 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __OPER_SAVE_H__ #define __OPER_SAVE_H__ int oper_save(char *archive, int argc, char **argv, int archtype); #endif // __OPER_SAVE_H__ fsarchiver-0.8.4/src/thread_archio.h0000644000176100017610000000140213242523705014340 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __THREAD_WRITER_H__ #define __THREAD_WRITER_H__ #include void *thread_writer_fct(void *args); void *thread_reader_fct(void *args); #endif // __THREAD_WRITER_H__ fsarchiver-0.8.4/src/filesys.h0000644000176100017610000000407313242523705013231 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __FILESYS_H__ #define __FILESYS_H__ #define PROGVER(x, y, z) (((u64)x)<<16)+(((u64)y)<<8)+(((u64)z)<<0) struct s_strlist; struct s_dico; struct s_filesys; typedef struct s_filesys cfilesys; struct s_filesys { char *name; int (*mount)(char *partition, char *mntbuf, char *fsname, int flags, char *mntinfo); int (*umount)(char *partition, char *mntbuf); int (*getinfo)(struct s_dico *d, char *devname); int (*mkfs)(struct s_dico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid); int (*test)(char *partition); int (*reqmntopt)(char *partition, struct s_strlist *reqopt, struct s_strlist *badopt); bool support_for_xattr; bool support_for_acls; bool winattr; bool savesymtargettype; // we have to know the type of the target to recreate a symlink on ntfs bool stable; // say if the fsarchiver support for this filesystem is considered stable or not }; extern cfilesys filesys[]; int devcmp(char *dev1, char *dev2); int generic_get_spacestats(char *dev, char *mnt, char *text, int textlen); int generic_get_fsrwstatus(char *options); int generic_get_fstype(char *fsname, int *fstype); int generic_get_mntinfo(char *devname, int *readwrite, char *mntbuf, int maxmntbuf, char *optbuf, int maxoptbuf, char *fsbuf, int maxfsbuf); int generic_mount(char *partition, char *mntbuf, char *fsbuf, char *mntopt, int flags); char *format_prog_version(u64 version, char *bufdat, int buflen); int generic_umount(char *mntbuf); #endif // __FILESYS_H__ fsarchiver-0.8.4/src/filesys.c0000644000176100017610000003033613242523705013225 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "fsarchiver.h" #include "common.h" #include "filesys.h" #include "fs_ext2.h" #include "fs_reiserfs.h" #include "fs_reiser4.h" #include "fs_btrfs.h" #include "fs_xfs.h" #include "fs_jfs.h" #include "fs_ntfs.h" #include "fs_vfat.h" #include "error.h" cfilesys filesys[]= { {"ext2", extfs_mount, extfs_umount, extfs_getinfo, ext2_mkfs, ext2_test, extfs_get_reqmntopt, true, true, false, false, true}, {"ext3", extfs_mount, extfs_umount, extfs_getinfo, ext3_mkfs, ext3_test, extfs_get_reqmntopt, true, true, false, false, true}, {"ext4", extfs_mount, extfs_umount, extfs_getinfo, ext4_mkfs, ext4_test, extfs_get_reqmntopt, true, true, false, false, true}, {"reiserfs", reiserfs_mount, reiserfs_umount, reiserfs_getinfo, reiserfs_mkfs, reiserfs_test, reiserfs_get_reqmntopt, true, true, false, false, true}, {"reiser4", reiser4_mount, reiser4_umount, reiser4_getinfo, reiser4_mkfs, reiser4_test, reiser4_get_reqmntopt, true, true, false, false, true}, {"btrfs", btrfs_mount, btrfs_umount, btrfs_getinfo, btrfs_mkfs, btrfs_test, btrfs_get_reqmntopt, true, true, false, false, true}, {"xfs", xfs_mount, xfs_umount, xfs_getinfo, xfs_mkfs, xfs_test, xfs_get_reqmntopt, true, true, false, false, true}, {"jfs", jfs_mount, jfs_umount, jfs_getinfo, jfs_mkfs, jfs_test, jfs_get_reqmntopt, true, true, false, false, true}, {"ntfs", ntfs_mount, ntfs_umount, ntfs_getinfo, ntfs_mkfs, ntfs_test, ntfs_get_reqmntopt, false, false, true, true, false}, {"vfat", vfat_mount, vfat_umount, vfat_getinfo, vfat_mkfs, vfat_test, vfat_get_reqmntopt, false, false, false, false, true}, {NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, false, false, false, false} }; // return the index of a filesystem in the filesystem table int generic_get_fstype(char *fsname, int *fstype) { int i; for (i=0; filesys[i].name; i++) { if (strcmp(filesys[i].name, fsname)==0) { *fstype=i; return 0; } } *fstype=-1; return -1; } int generic_get_spacestats(char *dev, char *mnt, char *text, int textlen) { struct statfs stf; struct stat64 st; // init memset(text, 0, textlen); if (stat64(dev, &st)!=0) return -1; if (statfs(dev, &stf)!=0) return -1; if (!S_ISBLK(st.st_mode)) return -1; else return 0; } int generic_get_fsrwstatus(char *options) { char temp[FSA_MAX_FSNAMELEN]; char delims[]=","; char *saveptr; char *result; snprintf(temp, sizeof(temp), "%s", options); result=strtok_r(temp, delims, &saveptr); while(result != NULL) { if (strcmp(result, "rw")==0) return 1; // true result = strtok_r(NULL, delims, &saveptr); } return 0; // false } int devcmp(char *dev1, char *dev2) { struct stat64 devstat[2]; char *devname[]={dev1, dev2}; int i; for (i=0; i<2; i++) { if (strncmp(devname[i], "/dev/", 5)!=0) return -1; errno=0; if (stat64(devname[i], &devstat[i]) != 0) { if (errno == ENOENT) errprintf("Warning: node for device [%s] does not exist in /dev/\n", devname[i]); else errprintf("Warning: cannot get details for device [%s]\n", devname[i]); return -1; } if (!S_ISBLK(devstat[0].st_mode)) { errprintf("Warning: [%s] is not a block device\n", devname[i]); return -1; } } return (devstat[0].st_rdev==devstat[1].st_rdev) ? 0 : 1; } int generic_get_mntinfo(char *devname, int *readwrite, char *mntbuf, int maxmntbuf, char *optbuf, int maxoptbuf, char *fsbuf, int maxfsbuf) { char col_fs[FSA_MAX_FSNAMELEN]; int devisroot=false; struct stat64 devstat; struct stat64 rootstat; long major, minor; char delims[]=" \t\n:"; struct utsname suname; char col_dev[128]; char col_mnt[128]; char col_opt[128]; char line[1024]; char temp[2048]; char *saveptr; char *result; FILE *f; int sep; int i; // init uname(&suname); *readwrite=-1; // unknown memset(mntbuf, 0, maxmntbuf); memset(optbuf, 0, maxoptbuf); // ---- 1. attempt to find device in "/proc/self/mountinfo" if ((stat64(devname, &devstat)==0) && ((f=fopen("/proc/self/mountinfo","rb"))!=NULL)) { msgprintf(MSG_DEBUG1, "device=[%s] has major=[%ld] and minor=[%ld]\n", devname, (long)major(devstat.st_rdev), (long)minor(devstat.st_rdev)); while(!feof(f)) { if (stream_readline(f, line, 1024)>1) { result=strtok_r(line, delims, &saveptr); major = -1; minor = -1; sep = -1; col_dev[0]=col_mnt[0]=col_fs[0]=col_opt[0]=0; for(i=0; result != NULL; i++) { if (strcmp(result, "-") == 0) // found separator sep = i; switch (i) { case 2: major = atol(result); break; case 3: minor = atol(result); break; case 5: snprintf(col_mnt, sizeof(col_mnt), "%s", result); break; } if ((sep != -1) && (i == sep + 1)) snprintf(col_fs, sizeof(col_fs), "%s", result); if ((sep != -1) && (i == sep + 3)) snprintf(col_opt, sizeof(col_opt), "%s", result); result = strtok_r(NULL, delims, &saveptr); } msgprintf(MSG_DEBUG1, "mountinfo entry: major=[%ld] minor=[%ld] filesys=[%s] col_opt=[%s] col_mnt=[%s]\n", major, minor, col_fs, col_opt, col_mnt); if ((major==major(devstat.st_rdev)) && (minor==minor(devstat.st_rdev))) { if (generic_get_spacestats(devname, col_mnt, temp, sizeof(temp))==0) { msgprintf(MSG_DEBUG1, "found mountinfo entry for device=[%s]: mnt=[%s] fs=[%s] opt=[%s]\n", devname, col_mnt, col_fs, col_opt); *readwrite=generic_get_fsrwstatus(col_opt); snprintf(mntbuf, maxmntbuf, "%s", col_mnt); snprintf(optbuf, maxoptbuf, "%s", col_opt); snprintf(fsbuf, maxfsbuf, "%s", col_fs); fclose(f); return 0; } } } } fclose(f); } // ---- 2. if there is no /proc/self/mountinfo then use "/proc/mounts" instead // workaround for systems not having the "/dev/root" node entry. // There are systems showing "/dev/root" in "/proc/mounts" instead // of the actual root partition such as "/dev/sda1". // The consequence is that fsarchiver won't be able to realize // that the device it is archiving (such as "/dev/sda1") is the // same as "/dev/root" and that it is actually mounted. This // function would then say that the "/dev/sda1" device is not mounted // and fsarchiver would try to mount it and mount() fails with EBUSY if (stat64(devname, &devstat)==0 && stat64("/", &rootstat)==0 && (devstat.st_rdev==rootstat.st_dev)) { devisroot=true; msgprintf(MSG_VERB1, "device [%s] is the root device\n", devname); } // 2. check device in "/proc/mounts" (typical case) if ((f=fopen("/proc/mounts","rb"))==NULL) { sysprintf("Cannot open /proc/mounts\n"); return 1; } while(!feof(f)) { if (stream_readline(f, line, 1024)>1) { result=strtok_r(line, delims, &saveptr); col_dev[0]=col_mnt[0]=col_fs[0]=col_opt[0]=0; for(i=0; result != NULL && i<=3; i++) { switch (i) // only the second word is a mount-point { case 0: snprintf(col_dev, sizeof(col_dev), "%s", result); break; case 1: snprintf(col_mnt, sizeof(col_mnt), "%s", result); break; case 2: snprintf(col_fs, sizeof(col_fs), "%s", result); break; case 3: snprintf(col_opt, sizeof(col_opt), "%s", result); break; } result = strtok_r(NULL, delims, &saveptr); } if ((devisroot==true) && (strcmp(col_mnt, "/")==0) && (strcmp(col_fs, "rootfs")!=0)) snprintf(col_dev, sizeof(col_dev), "%s", devname); msgprintf(MSG_DEBUG1, "mount entry: col_dev=[%s] col_mnt=[%s] col_fs=[%s] col_opt=[%s]\n", col_dev, col_mnt, col_fs, col_opt); if (devcmp(col_dev, devname)==0) { if (generic_get_spacestats(col_dev, col_mnt, temp, sizeof(temp))==0) { msgprintf(MSG_DEBUG1, "found mount entry for device=[%s]: mnt=[%s] fs=[%s] opt=[%s]\n", devname, col_mnt, col_fs, col_opt); *readwrite=generic_get_fsrwstatus(col_opt); snprintf(mntbuf, maxmntbuf, "%s", col_mnt); snprintf(optbuf, maxoptbuf, "%s", col_opt); snprintf(fsbuf, maxfsbuf, "%s", col_fs); fclose(f); return 0; } } } } fclose(f); return -1; } int generic_mount(char *partition, char *mntbuf, char *fsbuf, char *mntopt, int flags) { if (!partition || !mntbuf || !fsbuf || !fsbuf[0]) { errprintf("invalid parameters\n"); return -1; } // optimization: don't change access times on the original partition flags|=MS_NOATIME|MS_NODIRATIME; // if fsbuf is not empty, use the filesystem which is specified msgprintf(MSG_DEBUG1, "trying to mount [%s] on [%s] as [%s] with options [%s]\n", partition, mntbuf, fsbuf, mntopt); if (mount(partition, mntbuf, fsbuf, flags, mntopt)!=0) { errprintf("partition [%s] cannot be mounted on [%s] as [%s] with options [%s]\n", partition, mntbuf, fsbuf, mntopt); return -1; } msgprintf(MSG_VERB2, "partition [%s] was successfully mounted on [%s] as [%s] with options [%s]\n", partition, mntbuf, fsbuf, mntopt); return 0; } int generic_umount(char *mntbuf) { int res=0; int i; if (!mntbuf) { errprintf("invalid param: mntbuf is null\n"); return -1; } msgprintf(MSG_DEBUG1, "generic_umount(%s)\n", mntbuf); for (i=0, errno=0 ; (i < 4) && (res=umount2(mntbuf, 0)!=0) && (errno==EBUSY) ; i++) { sync(); sleep(i+1); } if (res!=0) errprintf("Failed to umount device %s after %d attempts\n", mntbuf, (int)i); return res; } char *format_prog_version(u64 version, char *bufdat, int buflen) { snprintf(bufdat, buflen, "%ld.%ld.%ld", (long)(version>>16&0xFF), (long)(version>>8&0xFF), (long)(version>>0&0xFF)); return bufdat; } fsarchiver-0.8.4/src/options.h0000644000176100017610000000260613242523705013246 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __OPTIONS_H__ #define __OPTIONS_H__ #include "strlist.h" struct s_options; typedef struct s_options coptions; // struct that stores the options passed on the command line struct s_options { bool overwrite; bool allowsaverw; bool experimental; bool dontcheckmountopts; int verboselevel; int debuglevel; int compresslevel; int compressjobs; u16 compressalgo; u32 datablocksize; u32 smallfilethresh; u64 splitsize; u16 encryptalgo; u16 fsacomplevel; char archlabel[FSA_MAX_LABELLEN]; u8 encryptpass[FSA_MAX_PASSLEN+1]; cstrlist exclude; }; extern coptions g_options; int options_init(); int options_destroy(); int options_select_compress_level(int opt); #endif // __OPTIONS_H__ fsarchiver-0.8.4/src/fs_xfs.h0000644000176100017610000002332413242523705013043 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __FS_XFS_H__ #define __FS_XFS_H__ struct s_dico; struct s_strlist; /* * Super block * Fits into a sector-sized buffer at address 0 of each allocation group. * Only the first of these is ever updated except during growfs. */ #define XFS_SB_MAGIC 0x58465342 /* 'XFSB' */ #define XFS_SB_VERSION_1 1 /* 5.3, 6.0.1, 6.1 */ #define XFS_SB_VERSION_2 2 /* 6.2 - attributes */ #define XFS_SB_VERSION_3 3 /* 6.2 - new inode version */ #define XFS_SB_VERSION_4 4 /* 6.2+ - bitmask version */ #define XFS_SB_VERSION_5 5 /* CRC enabled filesystem */ #define XFS_SB_VERSION_NUMBITS 0x000f #define XFS_SB_VERSION_ALLFBITS 0xfff0 #define XFS_SB_VERSION_ATTRBIT 0x0010 #define XFS_SB_VERSION_NLINKBIT 0x0020 #define XFS_SB_VERSION_QUOTABIT 0x0040 #define XFS_SB_VERSION_ALIGNBIT 0x0080 #define XFS_SB_VERSION_DALIGNBIT 0x0100 #define XFS_SB_VERSION_SHAREDBIT 0x0200 #define XFS_SB_VERSION_LOGV2BIT 0x0400 #define XFS_SB_VERSION_SECTORBIT 0x0800 #define XFS_SB_VERSION_EXTFLGBIT 0x1000 #define XFS_SB_VERSION_DIRV2BIT 0x2000 #define XFS_SB_VERSION_BORGBIT 0x4000 /* ASCII only case-insens. */ #define XFS_SB_VERSION_MOREBITSBIT 0x8000 int xfs_mkfs(struct s_dico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid); int xfs_getinfo(struct s_dico *d, char *devname); int xfs_mount(char *partition, char *mntbuf, char *fsbuf, int flags, char *mntinfo); int xfs_get_reqmntopt(char *partition, struct s_strlist *reqopt, struct s_strlist *badopt); int xfs_umount(char *partition, char *mntbuf); int xfs_test(char *devname); int xfs_check_compatibility(u64 compat, u64 ro_compat, u64 incompat, u64 log_incompat); typedef uint32_t xfs_agblock_t; /* blockno in alloc. group */ typedef uint32_t xfs_extlen_t; /* extent length in blocks */ typedef uint32_t xfs_agnumber_t; /* allocation group number */ typedef int32_t xfs_extnum_t; /* # of extents in a file */ typedef int16_t xfs_aextnum_t; /* # extents in an attribute fork */ typedef int64_t xfs_fsize_t; /* bytes in a file */ typedef uint64_t xfs_ufsize_t; /* unsigned bytes in a file */ typedef int32_t xfs_suminfo_t; /* type of bitmap summary info */ typedef int32_t xfs_rtword_t; /* word type for bitmap manipulations */ typedef int64_t xfs_lsn_t; /* log sequence number */ typedef int32_t xfs_tid_t; /* transaction identifier */ typedef uint32_t xfs_dablk_t; /* dir/attr block number (in file) */ typedef uint32_t xfs_dahash_t; /* dir/attr hash value */ typedef uint16_t xfs_prid_t; /* prid_t truncated to 16bits in XFS */ /* * These types are 64 bits on disk but are either 32 or 64 bits in memory. * Disk based types: */ typedef uint64_t xfs_fsblock_t; /* blockno in filesystem (agno|agbno) */ typedef uint64_t xfs_rfsblock_t; /* blockno in filesystem (raw) */ typedef uint64_t xfs_rtblock_t; /* extent (block) in realtime area */ typedef uint64_t xfs_dfiloff_t; /* block number in a file */ typedef uint64_t xfs_dfilblks_t; /* number of blocks in a file */ typedef __s64 xfs_off_t; /* type */ typedef __u64 xfs_ino_t; /* type */ typedef __s64 xfs_daddr_t; /* type */ typedef char * xfs_caddr_t; /* type */ typedef __u32 xfs_dev_t; typedef __u32 xfs_nlink_t; /* * Superblock - in core version. Must match the ondisk version below. * Must be padded to 64 bit alignment. */ struct xfs_sb { uint32_t sb_magicnum; /* magic number == XFS_SB_MAGIC */ uint32_t sb_blocksize; /* logical block size, bytes */ xfs_rfsblock_t sb_dblocks; /* number of data blocks */ xfs_rfsblock_t sb_rblocks; /* number of realtime blocks */ xfs_rtblock_t sb_rextents; /* number of realtime extents */ uuid_t sb_uuid; /* user-visible file system unique id */ xfs_fsblock_t sb_logstart; /* starting block of log if internal */ xfs_ino_t sb_rootino; /* root inode number */ xfs_ino_t sb_rbmino; /* bitmap inode for realtime extents */ xfs_ino_t sb_rsumino; /* summary inode for rt bitmap */ xfs_agblock_t sb_rextsize; /* realtime extent size, blocks */ xfs_agblock_t sb_agblocks; /* size of an allocation group */ xfs_agnumber_t sb_agcount; /* number of allocation groups */ xfs_extlen_t sb_rbmblocks; /* number of rt bitmap blocks */ xfs_extlen_t sb_logblocks; /* number of log blocks */ uint16_t sb_versionnum; /* header version == XFS_SB_VERSION */ uint16_t sb_sectsize; /* volume sector size, bytes */ uint16_t sb_inodesize; /* inode size, bytes */ uint16_t sb_inopblock; /* inodes per block */ char sb_fname[12]; /* file system name */ uint8_t sb_blocklog; /* log2 of sb_blocksize */ uint8_t sb_sectlog; /* log2 of sb_sectsize */ uint8_t sb_inodelog; /* log2 of sb_inodesize */ uint8_t sb_inopblog; /* log2 of sb_inopblock */ uint8_t sb_agblklog; /* log2 of sb_agblocks (rounded up) */ uint8_t sb_rextslog; /* log2 of sb_rextents */ uint8_t sb_inprogress; /* mkfs is in progress, don't mount */ uint8_t sb_imax_pct; /* max % of fs for inode space */ /* statistics */ /* * These fields must remain contiguous. If you really * want to change their layout, make sure you fix the * code in xfs_trans_apply_sb_deltas(). */ uint64_t sb_icount; /* allocated inodes */ uint64_t sb_ifree; /* free inodes */ uint64_t sb_fdblocks; /* free data blocks */ uint64_t sb_frextents; /* free realtime extents */ /* * End contiguous fields. */ xfs_ino_t sb_uquotino; /* user quota inode */ xfs_ino_t sb_gquotino; /* group quota inode */ uint16_t sb_qflags; /* quota flags */ uint8_t sb_flags; /* misc. flags */ uint8_t sb_shared_vn; /* shared version number */ xfs_extlen_t sb_inoalignmt; /* inode chunk alignment, fsblocks */ uint32_t sb_unit; /* stripe or raid unit */ uint32_t sb_width; /* stripe or raid width */ uint8_t sb_dirblklog; /* log2 of dir block size (fsbs) */ uint8_t sb_logsectlog; /* log2 of the log sector size */ uint16_t sb_logsectsize; /* sector size for the log, bytes */ uint32_t sb_logsunit; /* stripe unit size for the log */ uint32_t sb_features2; /* additional feature bits */ /* * bad features2 field as a result of failing to pad the sb structure to * 64 bits. Some machines will be using this field for features2 bits. * Easiest just to mark it bad and not use it for anything else. * * This is not kept up to date in memory; it is always overwritten by * the value in sb_features2 when formatting the incore superblock to * the disk buffer. */ uint32_t sb_bad_features2; /* version 5 superblock fields start here */ /* feature masks */ uint32_t sb_features_compat; uint32_t sb_features_ro_compat; uint32_t sb_features_incompat; uint32_t sb_features_log_incompat; uint32_t sb_crc; /* superblock crc */ xfs_extlen_t sb_spino_align; /* sparse inode chunk alignment */ xfs_ino_t sb_pquotino; /* project quota inode */ xfs_lsn_t sb_lsn; /* last write sequence */ uuid_t sb_meta_uuid; /* metadata file system unique id */ /* must be padded to 64 bit alignment */ }; // XFS features used in XFS version 5 only #define XFS_SB_FEAT_RO_COMPAT_FINOBT (1 << 0) /* free inode btree */ #define XFS_SB_FEAT_RO_COMPAT_RMAPBT (1 << 1) /* reverse map btree */ #define XFS_SB_FEAT_RO_COMPAT_REFLINK (1 << 2) /* reflinked files */ #define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */ #define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */ #define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */ // features supported by the current fsarchiver version #define FSA_XFS_FEATURE_COMPAT_SUPP (u64)(0) #define FSA_XFS_FEATURE_RO_COMPAT_SUPP (u64)(XFS_SB_FEAT_RO_COMPAT_FINOBT|\ XFS_SB_FEAT_RO_COMPAT_RMAPBT|\ XFS_SB_FEAT_RO_COMPAT_REFLINK) #define FSA_XFS_FEATURE_INCOMPAT_SUPP (u64)(XFS_SB_FEAT_INCOMPAT_FTYPE|\ XFS_SB_FEAT_INCOMPAT_SPINODES|\ XFS_SB_FEAT_INCOMPAT_META_UUID) #define FSA_XFS_FEATURE_LOG_INCOMPAT_SUPP (u64)(0) #endif // __FS_XFS_H__ fsarchiver-0.8.4/src/comp_lzma.h0000644000176100017610000000165413242523705013536 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __COMPRESS_LZMA_H__ #define __COMPRESS_LZMA_H__ #ifdef OPTION_LZMA_SUPPORT int compress_block_lzma(u64 origsize, u64 *compsize, u8 *origbuf, u8 *compbuf, u64 compbufsize, int level); int uncompress_block_lzma(u64 compsize, u64 *origsize, u8 *origbuf, u64 origbufsize, u8 *compbuf); #endif // OPTION_LZMA_SUPPORT #endif // __COMPRESS_LZMA_H__ fsarchiver-0.8.4/src/thread_comp.c0000644000176100017610000003251613242523705014036 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include "fsarchiver.h" #include "common.h" #include "options.h" #include "comp_gzip.h" #include "comp_bzip2.h" #include "comp_lzma.h" #include "comp_lzo.h" #include "comp_lz4.h" #include "comp_zstd.h" #include "crypto.h" #include "syncthread.h" #include "thread_comp.h" #include "error.h" #include "queue.h" int compress_block_generic(struct s_blockinfo *blkinfo) { char *bufcomp=NULL; int attempt=0; int compalgo; int complevel; u64 compsize; u64 bufsize; int res; bufsize = (blkinfo->blkrealsize) + (blkinfo->blkrealsize / 16) + 64 + 3; // alloc bigger buffer else lzo will crash if ((bufcomp=malloc(bufsize))==NULL) { errprintf("malloc(%ld) failed: out of memory\n", (long)bufsize); return -1; } // compression level/algo to use for the first attempt compalgo=g_options.compressalgo; complevel=g_options.compresslevel; // compress the block do { switch (compalgo) { #ifdef OPTION_LZO_SUPPORT case COMPRESS_LZO: res=compress_block_lzo(blkinfo->blkrealsize, &compsize, (u8*)blkinfo->blkdata, (void*)bufcomp, bufsize, complevel); blkinfo->blkcompalgo=COMPRESS_LZO; break; #endif // OPTION_LZO_SUPPORT case COMPRESS_GZIP: res=compress_block_gzip(blkinfo->blkrealsize, &compsize, (u8*)blkinfo->blkdata, (void*)bufcomp, bufsize, complevel); blkinfo->blkcompalgo=COMPRESS_GZIP; break; case COMPRESS_BZIP2: res=compress_block_bzip2(blkinfo->blkrealsize, &compsize, (u8*)blkinfo->blkdata, (void*)bufcomp, bufsize, complevel); blkinfo->blkcompalgo=COMPRESS_BZIP2; break; #ifdef OPTION_LZMA_SUPPORT case COMPRESS_LZMA: res=compress_block_lzma(blkinfo->blkrealsize, &compsize, (u8*)blkinfo->blkdata, (void*)bufcomp, bufsize, complevel); blkinfo->blkcompalgo=COMPRESS_LZMA; break; #endif // OPTION_LZMA_SUPPORT #ifdef OPTION_LZ4_SUPPORT case COMPRESS_LZ4: res=compress_block_lz4(blkinfo->blkrealsize, &compsize, (u8*)blkinfo->blkdata, (void*)bufcomp, bufsize, complevel); blkinfo->blkcompalgo=COMPRESS_LZ4; break; #endif // OPTION_LZ4_SUPPORT #ifdef OPTION_ZSTD_SUPPORT case COMPRESS_ZSTD: res=compress_block_zstd(blkinfo->blkrealsize, &compsize, (u8*)blkinfo->blkdata, (void*)bufcomp, bufsize, complevel); blkinfo->blkcompalgo=COMPRESS_ZSTD; break; #endif // OPTION_ZSTD_SUPPORT default: free(bufcomp); msgprintf(2, "invalid compression level: %d\n", (int)compalgo); return -1; } // retry if high compression was used and compression failed because of FSAERR_ENOMEM if ((res == FSAERR_ENOMEM) && (compalgo > FSA_DEF_COMPRESS_ALGO)) { errprintf("attempt to compress the current block using an alternative algorithm (\"-z%d\")\n", FSA_DEF_COMPRESS_ALGO); compalgo = FSA_DEF_COMPRESS_ALGO; complevel = FSA_DEF_COMPRESS_LEVEL; } } while ((res == FSAERR_ENOMEM) && (attempt++ == 0)); // check compression status and efficiency if ((res==FSAERR_SUCCESS) && (compsize < blkinfo->blkrealsize)) // compression worked and saved space { free(blkinfo->blkdata); // free old buffer (with uncompressed data) blkinfo->blkdata=bufcomp; // new buffer (with compressed data) blkinfo->blkcompsize=compsize; // size after compression and before encryption blkinfo->blkarsize=compsize; // in case there is no encryption to set this //errprintf ("COMP_DBG: block successfully compressed using %s\n", compress_algo_int_to_string(compalgo)); } else // compressed version is bigger or compression failed: keep the original block { memcpy(bufcomp, blkinfo->blkdata, blkinfo->blkrealsize); free(blkinfo->blkdata); // free old buffer blkinfo->blkdata=bufcomp; // new buffer blkinfo->blkcompsize=blkinfo->blkrealsize; // size after compression and before encryption blkinfo->blkarsize=blkinfo->blkrealsize; // in case there is no encryption to set this blkinfo->blkcompalgo=COMPRESS_NONE; //errprintf ("COMP_DBG: block copied uncompressed, attempted using %s\n", compress_algo_int_to_string(compalgo)); } u64 cryptsize; char *bufcrypt=NULL; if (g_options.encryptalgo==ENCRYPT_BLOWFISH) { if ((bufcrypt=malloc(bufsize+8))==NULL) { errprintf("malloc(%ld) failed: out of memory\n", (long)bufsize+8); return -1; } if ((res=crypto_blowfish(blkinfo->blkcompsize, &cryptsize, (u8*)bufcomp, (u8*)bufcrypt, g_options.encryptpass, strlen((char*)g_options.encryptpass), 1))!=0) { errprintf("crypt_block_blowfish() failed with res=%d\n", res); return -1; } free(bufcomp); blkinfo->blkdata=bufcrypt; blkinfo->blkarsize=cryptsize; blkinfo->blkcryptalgo=ENCRYPT_BLOWFISH; } else { blkinfo->blkcryptalgo=ENCRYPT_NONE; } // calculates the final block checksum (block as it will be stored in the archive) blkinfo->blkarcsum=fletcher32((void*)blkinfo->blkdata, blkinfo->blkarsize); return 0; } int decompress_block_generic(struct s_blockinfo *blkinfo) { u64 checkorigsize; char *bufcomp=NULL; int res; // allocate memory for uncompressed data if ((bufcomp=malloc(blkinfo->blkrealsize))==NULL) { errprintf("malloc(%ld) failed: cannot allocate memory for compressed block\n", (long)blkinfo->blkrealsize); return -1; } // check the block checksum if (fletcher32((u8*)blkinfo->blkdata, blkinfo->blkarsize)!=(blkinfo->blkarcsum)) { errprintf("block is corrupt at blockoffset=%ld, blksize=%ld\n", (long)blkinfo->blkoffset, (long)blkinfo->blkrealsize); memset(bufcomp, 0, blkinfo->blkrealsize); } else // data not corrupted, decompresses the block { if ((blkinfo->blkcryptalgo!=ENCRYPT_NONE) && (g_options.encryptalgo!=ENCRYPT_BLOWFISH)) { msgprintf(MSG_DEBUG1, "this archive has been encrypted, you have to provide a password " "on the command line using option '-c'\n"); free (bufcomp); return -1; } char *bufcrypt=NULL; u64 clearsize; if (blkinfo->blkcryptalgo==ENCRYPT_BLOWFISH) { if ((bufcrypt=malloc(blkinfo->blkrealsize+8))==NULL) { errprintf("malloc(%ld) failed: out of memory\n", (long)blkinfo->blkrealsize+8); free(bufcomp); return -1; } if ((res=crypto_blowfish(blkinfo->blkarsize, &clearsize, (u8*)blkinfo->blkdata, (u8*)bufcrypt, g_options.encryptpass, strlen((char*)g_options.encryptpass), 0))!=0) { errprintf("crypt_block_blowfish() failed\n"); free(bufcomp); return -1; } if (clearsize!=blkinfo->blkcompsize) { errprintf("clearsize does not match blkcompsize: clearsize=%ld and blkcompsize=%ld\n", (long)clearsize, (long)blkinfo->blkcompsize); free(bufcomp); return -1; } free(blkinfo->blkdata); blkinfo->blkdata=bufcrypt; } switch (blkinfo->blkcompalgo) { case COMPRESS_NONE: memcpy(bufcomp, blkinfo->blkdata, blkinfo->blkarsize); res=0; break; #ifdef OPTION_LZO_SUPPORT case COMPRESS_LZO: if ((res=uncompress_block_lzo(blkinfo->blkcompsize, &checkorigsize, (void*)bufcomp, blkinfo->blkrealsize, (u8*)blkinfo->blkdata))!=0) { errprintf("uncompress_block_lzo()=%d failed: finalsize=%ld and checkorigsize=%ld\n", res, (long)blkinfo->blkarsize, (long)checkorigsize); memset(bufcomp, 0, blkinfo->blkrealsize); // TODO: inc(error_counter); } break; #endif // OPTION_LZO_SUPPORT case COMPRESS_GZIP: if ((res=uncompress_block_gzip(blkinfo->blkcompsize, &checkorigsize, (void*)bufcomp, blkinfo->blkrealsize, (u8*)blkinfo->blkdata))!=0) { errprintf("uncompress_block_gzip()=%d failed: finalsize=%ld and checkorigsize=%ld\n", res, (long)blkinfo->blkarsize, (long)checkorigsize); memset(bufcomp, 0, blkinfo->blkrealsize); // TODO: inc(error_counter); } break; case COMPRESS_BZIP2: if ((res=uncompress_block_bzip2(blkinfo->blkcompsize, &checkorigsize, (void*)bufcomp, blkinfo->blkrealsize, (u8*)blkinfo->blkdata))!=0) { errprintf("uncompress_block_bzip2()=%d failed: finalsize=%ld and checkorigsize=%ld\n", res, (long)blkinfo->blkarsize, (long)checkorigsize); memset(bufcomp, 0, blkinfo->blkrealsize); // TODO: inc(error_counter); } break; #ifdef OPTION_LZMA_SUPPORT case COMPRESS_LZMA: if ((res=uncompress_block_lzma(blkinfo->blkcompsize, &checkorigsize, (void*)bufcomp, blkinfo->blkrealsize, (u8*)blkinfo->blkdata))!=0) { errprintf("uncompress_block_lzma()=%d failed: finalsize=%ld and checkorigsize=%ld\n", res, (long)blkinfo->blkarsize, (long)checkorigsize); memset(bufcomp, 0, blkinfo->blkrealsize); // TODO: inc(error_counter); } break; #endif // OPTION_LZMA_SUPPORT #ifdef OPTION_LZ4_SUPPORT case COMPRESS_LZ4: if ((res=uncompress_block_lz4(blkinfo->blkcompsize, &checkorigsize, (void*)bufcomp, blkinfo->blkrealsize, (u8*)blkinfo->blkdata))!=0) { errprintf("uncompress_block_lz4()=%d failed: finalsize=%ld and checkorigsize=%ld\n", res, (long)blkinfo->blkarsize, (long)checkorigsize); memset(bufcomp, 0, blkinfo->blkrealsize); // TODO: inc(error_counter); } break; #endif // OPTION_LZ4_SUPPORT #ifdef OPTION_ZSTD_SUPPORT case COMPRESS_ZSTD: if ((res=uncompress_block_zstd(blkinfo->blkcompsize, &checkorigsize, (void*)bufcomp, blkinfo->blkrealsize, (u8*)blkinfo->blkdata))!=0) { errprintf("uncompress_block_zstd()=%d failed: finalsize=%ld and checkorigsize=%ld\n", res, (long)blkinfo->blkarsize, (long)checkorigsize); memset(bufcomp, 0, blkinfo->blkrealsize); // TODO: inc(error_counter); } break; #endif // OPTION_ZSTD_SUPPORT default: errprintf("unsupported compression algorithm: %ld\n", (long)blkinfo->blkcompalgo); return -1; } free(blkinfo->blkdata); // free old buffer (with compressed data) blkinfo->blkdata=bufcomp; // pointer to new buffer with uncompressed data } return 0; } int compression_function(int oper) { struct s_blockinfo blkinfo; s64 blknum; int res; while (queue_get_end_of_queue(&g_queue)==false) { if ((blknum=queue_get_first_block_todo(&g_queue, &blkinfo))>0) // block found { switch (oper) { case COMPTHR_COMPRESS: res=compress_block_generic(&blkinfo); break; case COMPTHR_DECOMPRESS: res=decompress_block_generic(&blkinfo); break; default: errprintf("oper is invalid: %d\n", oper); goto thread_comp_fct_error; } if (res!=0) { msgprintf(MSG_STACK, "compress_block()=%d failed\n", res); goto thread_comp_fct_error; } // don't check for errors: it's normal to fail when we terminate after a problem queue_replace_block(&g_queue, blknum, &blkinfo, QITEM_STATUS_DONE); } } msgprintf(MSG_DEBUG1, "THREAD-COMP: exit success\n"); return 0; thread_comp_fct_error: get_stopfillqueue(); msgprintf(MSG_DEBUG1, "THREAD-COMP: exit error\n"); return 0; } void *thread_comp_fct(void *args) { inc_secthreads(); compression_function(COMPTHR_COMPRESS); dec_secthreads(); return NULL; } void *thread_decomp_fct(void *args) { inc_secthreads(); compression_function(COMPTHR_DECOMPRESS); dec_secthreads(); return NULL; } fsarchiver-0.8.4/src/oper_restore.h0000644000176100017610000000136413242523705014263 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __OPER_RESTORE_H__ #define __OPER_RESTORE_H__ #include "dico.h" int oper_restore(char *archive, int argc, char **argv, int oper); #endif // __OPER_RESTORE_H__ fsarchiver-0.8.4/src/fs_xfs.c0000644000176100017610000004022013242523705013030 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include "fsarchiver.h" #include "dico.h" #include "common.h" #include "fs_xfs.h" #include "filesys.h" #include "strlist.h" #include "error.h" int xfs_check_compatibility(u64 compat, u64 ro_compat, u64 incompat, u64 log_incompat) { int errors=0; msgprintf(MSG_DEBUG1, "xfs features: compat=[%ld]\n", (long)compat); msgprintf(MSG_DEBUG1, "xfs features: ro_compat=[%ld]\n", (long)ro_compat); msgprintf(MSG_DEBUG1, "xfs features: incompat=[%ld]\n", (long)incompat); msgprintf(MSG_DEBUG1, "xfs features: log_incompat=[%ld]\n", (long)log_incompat); // to preserve the filesystem attributes, fsa must know all the features including the COMPAT ones if (compat & ~FSA_XFS_FEATURE_COMPAT_SUPP) errors++; if (ro_compat & ~FSA_XFS_FEATURE_RO_COMPAT_SUPP) errors++; if (incompat & ~FSA_XFS_FEATURE_INCOMPAT_SUPP) errors++; if (log_incompat & ~FSA_XFS_FEATURE_LOG_INCOMPAT_SUPP) errors++; if (errors > 0) { errprintf("this filesystem has XFS features which are not supported by this fsarchiver version.\n"); return -1; } else { return 0; } } int xfs_mkfs(cdico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid) { char stdoutbuf[2048]; char command[2048]; char buffer[2048]; char mkfsopts[2048]; char xadmopts[2048]; char uuid[64]; u64 xfstoolsver; int exitst; u64 temp64; u64 xfsver; int x, y, z; int optval; u64 sb_features_compat=0; u64 sb_features_ro_compat=0; u64 sb_features_incompat=0; u64 sb_features_log_incompat=0; // ---- check that mkfs is installed and get its version if (exec_command(command, sizeof(command), NULL, stdoutbuf, sizeof(stdoutbuf), NULL, 0, "mkfs.xfs -V")!=0) { errprintf("mkfs.xfs not found. please install xfsprogs on your system or check the PATH.\n"); return -1; } x=y=z=0; sscanf(stdoutbuf, "mkfs.xfs version %d.%d.%d", &x, &y, &z); if (x==0 && y==0) { errprintf("Can't parse mkfs.xfs version number: x=y=0\n"); return -1; } xfstoolsver=PROGVER(x,y,z); msgprintf(MSG_VERB2, "Detected mkfs.xfs version %d.%d.%d\n", x, y, z); memset(mkfsopts, 0, sizeof(mkfsopts)); memset(xadmopts, 0, sizeof(xadmopts)); memset(uuid, 0, sizeof(uuid)); strlcatf(mkfsopts, sizeof(mkfsopts), " %s ", fsoptions); if (strlen(mkfslabel) > 0) strlcatf(mkfsopts, sizeof(mkfsopts), " -L '%.12s' ", mkfslabel); else if (dico_get_string(d, 0, FSYSHEADKEY_FSLABEL, buffer, sizeof(buffer))==0 && strlen(buffer)>0) strlcatf(mkfsopts, sizeof(mkfsopts), " -L '%.12s' ", buffer); if ((dico_get_u64(d, 0, FSYSHEADKEY_FSXFSBLOCKSIZE, &temp64)==0) && (temp64%512==0) && (temp64>=512) && (temp64<=65536)) strlcatf(mkfsopts, sizeof(mkfsopts), " -b size=%ld ", (long)temp64); // ---- get xfs features attributes from the archive dico_get_u64(d, 0, FSYSHEADKEY_FSXFSFEATURECOMPAT, &sb_features_compat); dico_get_u64(d, 0, FSYSHEADKEY_FSXFSFEATUREROCOMPAT, &sb_features_ro_compat); dico_get_u64(d, 0, FSYSHEADKEY_FSXFSFEATUREINCOMPAT, &sb_features_incompat); dico_get_u64(d, 0, FSYSHEADKEY_FSXFSFEATURELOGINCOMPAT, &sb_features_log_incompat); // ---- check fsarchiver is aware of all the filesystem features used on that filesystem if (xfs_check_compatibility(sb_features_compat, sb_features_ro_compat, sb_features_incompat, sb_features_log_incompat)!=0) return -1; // Preserve version 4 of XFS if the original filesystem was an XFSv4 or if // it was saved with fsarchiver <= 0.6.19 which does not store the XFS // version in the metadata: make an XFSv4 if unsure for better compatibility, // as upgrading later is easier than downgrading if ((dico_get_u64(d, 0, FSYSHEADKEY_FSXFSVERSION, &temp64)!=0) || (temp64==XFS_SB_VERSION_4)) xfsver = XFS_SB_VERSION_4; else xfsver = XFS_SB_VERSION_5; // Unfortunately it is impossible to preserve the UUID (stamped on every // metadata block) of an XFSv5 filesystem with mkfs.xfs < 4.3.0. // Restoring with a new random UUID would work but could prevent the system // from booting if this is a boot/root filesystem because grub/fstab often // use the UUID to identify it. Hence it is much safer to restore it as an // XFSv4 and it also provides a better compatibility with older kernels. // Hence this is the safest option. // More details: https://github.com/fdupoux/fsarchiver/issues/4 if ((xfsver==XFS_SB_VERSION_5) && (xfstoolsver < PROGVER(4,3,0))) { xfsver = XFS_SB_VERSION_4; // Do not preserve the XFS version msgprintf(MSG_FORCE, "It is impossible to restore this filesystem as an XFSv5 and preserve its UUID\n" "with mkfs.xfs < 4.3.0. This filesystem will be restored as an XFSv4 instead\n" "as this is a much safer option (preserving the UUID may be required on\n" "boot/root filesystems for the operating system to be able to start). If you\n" "really want to have an XFSv5 filesystem, please upgrade xfsprogs to version\n" "4.3.0 or more recent and rerun this operation to get an XFSv5 with the same\n" "UUID as original filesystem\n"); } // Determine if the "crc" mkfs option should be enabled (checksum) // - checksum must be disabled if we want to recreate an XFSv4 filesystem // - checksum must be enabled if we want to recreate an XFSv5 filesystem if (xfstoolsver >= PROGVER(3,2,0)) // only use "crc" option when it is supported by mkfs { optval = (xfsver==XFS_SB_VERSION_5); strlcatf(mkfsopts, sizeof(mkfsopts), " -m crc=%d ", (int)optval); } // Determine if the "finobt" mkfs option should be enabled (free inode btree) // - starting with linux-3.16 XFS has added a btree that tracks free inodes // - this feature relies on the new v5 on-disk format but it is optional // - this feature is enabled by default when using xfsprogs 3.2.3 or later // - this feature will be enabled if the original filesystem was XFSv5 and had it if (xfstoolsver >= PROGVER(3,2,1)) // only use "finobt" option when it is supported by mkfs { optval = ((xfsver==XFS_SB_VERSION_5) && (sb_features_ro_compat & XFS_SB_FEAT_RO_COMPAT_FINOBT)); strlcatf(mkfsopts, sizeof(mkfsopts), " -m finobt=%d ", (int)optval); } // Determine if the "rmapbt" mkfs option should be enabled (reverse mapping btree) // - starting with linux-4.8 XFS has added a btree that maps filesystem blocks // to their owner // - this feature relies on the new v5 on-disk format but it is optional // - this feature will be enabled if the original filesystem was XFSv5 and had it if (xfstoolsver >= PROGVER(4,8,0)) // only use "rmapbt" option when it is supported by mkfs { optval = ((xfsver==XFS_SB_VERSION_5) && (sb_features_ro_compat & XFS_SB_FEAT_RO_COMPAT_RMAPBT)); strlcatf(mkfsopts, sizeof(mkfsopts), " -m rmapbt=%d ", (int)optval); } // Determine if the "reflink" mkfs option should be enabled // - starting with linux-4.9 XFS has added support for reflinked files // - this feature relies on the new v5 on-disk format but it is optional // - this feature will be enabled if the original filesystem was XFSv5 and had it if (xfstoolsver >= PROGVER(4,9,0)) // only use "reflink" option when it is supported by mkfs { optval = ((xfsver==XFS_SB_VERSION_5) && (sb_features_ro_compat & XFS_SB_FEAT_RO_COMPAT_REFLINK)); strlcatf(mkfsopts, sizeof(mkfsopts), " -m reflink=%d ", (int)optval); } // Attempt to preserve UUID of the filesystem // - the "-m uuid=" option in mkfs.xfs was added in mkfs.xfs 4.3.0 and is the best way to set UUIDs // - the UUID of XFSv4 can be successfully set using either xfs_admin or mkfs.xfs >= 4.3.0 // - it is impossible to set both types of UUIDs of an XFSv5 filesystem using xfsprogs < 4.3.0 // for this reason the XFS version is forced to v4 if xfsprogs version < 4.3.0 if (strlen(mkfsuuid) > 0) snprintf(uuid, sizeof(uuid), "%s", mkfsuuid); else if (dico_get_string(d, 0, FSYSHEADKEY_FSUUID, buffer, sizeof(buffer))==0) snprintf(uuid, sizeof(uuid), "%s", buffer); if (strlen(uuid)==36) { if (xfstoolsver >= PROGVER(4,3,0)) strlcatf(mkfsopts, sizeof(mkfsopts), " -m uuid=%s ", uuid); else strlcatf(xadmopts, sizeof(xadmopts), " -U %s ", uuid); } // Determine if the "ftype" mkfs option should be enabled (filetype in dirent) // - this feature allows the inode type to be stored in the directory structure // - mkfs.xfs 4.2.0 enabled ftype by default (supported since mkfs.xfs 3.2.0) for XFSv4 volumes // - when CRCs are enabled via -m crc=1, the ftype functionality is always enabled // - ftype is madatory in XFSv5 volumes but it is optional for XFSv4 volumes // - the "ftype" option must be specified after the "crc" option in mkfs.xfs < 4.2.0: // https://git.kernel.org/cgit/fs/xfs/xfsprogs-dev.git/commit/?id=b990de8ba4e2df2bc76a140799d3ddb4a0eac4ce // - do not set ftype=1 with crc=1 as mkfs.xfs may fail when both options are enabled (at least with xfsprogs-3.2.2) // - XFSv4 with ftype=1 is supported since linux-3.13. We purposely always // disable ftype for V4 volumes to keep them compatible with older kernels if (xfstoolsver >= PROGVER(3,2,0)) // only use "ftype" option when it is supported by mkfs { // ftype is already set to 1 when it is XFSv5 if (xfsver==XFS_SB_VERSION_4) strlcatf(mkfsopts, sizeof(mkfsopts), " -n ftype=0 "); } // Determine if the "sparse" mkfs option should be enabled (sparse inode allocation) // - starting with linux-4.2 XFS can allocate discontinuous inode chunks // - this feature relies on the new v5 on-disk format but it is optional // - this feature will be enabled if the original filesystem was XFSv5 and had it // - this feature is supported since mkfs.xfs 4.2.0, but unfortunately // mkfs.xfs 4.5.0 in RHEL 7.3 carries a custom patch removing the option, // hence require mkfs.xfs 4.7.0, next version after 4.5.0 if (xfstoolsver >= PROGVER(4,7,0)) // only use "sparse" option when it is supported by mkfs { optval = ((xfsver==XFS_SB_VERSION_5) && (sb_features_incompat & XFS_SB_FEAT_INCOMPAT_SPINODES)); strlcatf(mkfsopts, sizeof(mkfsopts), " -i sparse=%d ", (int)optval); } // ---- create the new filesystem using mkfs.xfs if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 0, "mkfs.xfs -f %s %s", partition, mkfsopts)!=0 || exitst!=0) { errprintf("command [%s] failed\n", command); return -1; } // ---- use xfs_admin to set the UUID if not already done with mkfs.xfs if (xadmopts[0]) { if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 0, "xfs_admin %s %s", xadmopts, partition)!=0 || exitst!=-0) { errprintf("command [%s] failed\n", command); return -1; } } return 0; } int xfs_getinfo(cdico *d, char *devname) { struct xfs_sb sb; char uuid[512]; u64 xfsver; u32 temp32; int ret=0; int fd; int res; u64 sb_features_compat=0; u64 sb_features_ro_compat=0; u64 sb_features_incompat=0; u64 sb_features_log_incompat=0; if ((fd=open64(devname, O_RDONLY|O_LARGEFILE))<0) { ret=-1; goto xfs_read_sb_return; } res=read(fd, &sb, sizeof(sb)); if (res!=sizeof(sb)) { ret=-1; goto xfs_read_sb_close; } // ---- check it's an XFS file system if (be32_to_cpu(sb.sb_magicnum) != XFS_SB_MAGIC) { ret=-1; msgprintf(3, "sb.sb_magicnum!=XFS_SB_MAGIC\n"); goto xfs_read_sb_close; } // ---- check XFS filesystem version xfsver=be16_to_cpu(sb.sb_versionnum) & XFS_SB_VERSION_NUMBITS; switch (xfsver) { case XFS_SB_VERSION_4: case XFS_SB_VERSION_5: msgprintf(MSG_DEBUG1, "Detected XFS filesystem version %d\n", (int)xfsver); dico_add_u64(d, 0, FSYSHEADKEY_FSXFSVERSION, xfsver); break; default: ret=-1; msgprintf(MSG_STACK, "Invalid XFS filesystem version: version=[%d]\n", (int)xfsver); goto xfs_read_sb_close; break; } // ---- label msgprintf(MSG_DEBUG1, "xfs_label=[%s]\n", sb.sb_fname); dico_add_string(d, 0, FSYSHEADKEY_FSLABEL, (char*)sb.sb_fname); // ---- uuid /*if ((str=e2p_uuid2str(&sb.sb_uuid))!=NULL) dico_add_string(d, 0, FSYSHEADKEY_FSUUID, str);*/ memset(uuid, 0, sizeof(uuid)); uuid_unparse_lower((u8*)&sb.sb_uuid, uuid); dico_add_string(d, 0, FSYSHEADKEY_FSUUID, uuid); msgprintf(MSG_DEBUG1, "xfs_uuid=[%s]\n", uuid); // ---- block size temp32=be32_to_cpu(sb.sb_blocksize); if ((temp32%512!=0) || (temp32<512) || (temp32>65536)) { ret=-1; msgprintf(3, "xfs_blksize=[%ld] is an invalid xfs block size\n", (long)temp32); goto xfs_read_sb_close; } dico_add_u64(d, 0, FSYSHEADKEY_FSXFSBLOCKSIZE, temp32); msgprintf(MSG_DEBUG1, "xfs_blksize=[%ld]\n", (long)temp32); // ---- get filesystem features (will all be set to 0 if this is an XFSv4) if (xfsver == XFS_SB_VERSION_5) { sb_features_compat=be32_to_cpu(sb.sb_features_compat); sb_features_ro_compat=be32_to_cpu(sb.sb_features_ro_compat); sb_features_incompat=be32_to_cpu(sb.sb_features_incompat); sb_features_log_incompat=be32_to_cpu(sb.sb_features_log_incompat); } // ---- check fsarchiver is aware of all the filesystem features used on that filesystem if (xfs_check_compatibility(sb_features_compat, sb_features_ro_compat, sb_features_incompat, sb_features_log_incompat)!=0) return -1; // ---- store features in the archive metadata dico_add_u64(d, 0, FSYSHEADKEY_FSXFSFEATURECOMPAT, (u64)sb_features_compat); dico_add_u64(d, 0, FSYSHEADKEY_FSXFSFEATUREROCOMPAT, (u64)sb_features_ro_compat); dico_add_u64(d, 0, FSYSHEADKEY_FSXFSFEATUREINCOMPAT, (u64)sb_features_incompat); dico_add_u64(d, 0, FSYSHEADKEY_FSXFSFEATURELOGINCOMPAT, (u64)sb_features_log_incompat); // ---- minimum fsarchiver version required to restore dico_add_u64(d, 0, FSYSHEADKEY_MINFSAVERSION, FSA_VERSION_BUILD(0, 6, 20, 0)); xfs_read_sb_close: close(fd); xfs_read_sb_return: return ret; } int xfs_mount(char *partition, char *mntbuf, char *fsbuf, int flags, char *mntinfo) { return generic_mount(partition, mntbuf, fsbuf, "nouuid", flags); } int xfs_umount(char *partition, char *mntbuf) { return generic_umount(mntbuf); } int xfs_test(char *devname) { struct xfs_sb sb; int fd; if ((fd=open64(devname, O_RDONLY|O_LARGEFILE))<0) { msgprintf(MSG_DEBUG1, "open64(%s) failed\n", devname); return false; } memset(&sb, 0, sizeof(sb)); if (read(fd, &sb, sizeof(sb))!=sizeof(sb)) { close(fd); msgprintf(MSG_DEBUG1, "read failed\n"); return false; } // ---- check it's an XFS file system if (be32_to_cpu(sb.sb_magicnum) != XFS_SB_MAGIC) { close(fd); msgprintf(MSG_DEBUG1, "(be32_to_cpu(sb.sb_magicnum)=%.8x) != (XFS_SB_MAGIC=%.8x)\n", be32_to_cpu(sb.sb_magicnum), XFS_SB_MAGIC); return false; } close(fd); return true; } int xfs_get_reqmntopt(char *partition, cstrlist *reqopt, cstrlist *badopt) { if (!reqopt || !badopt) return -1; return 0; } fsarchiver-0.8.4/src/fsarchiver.h0000644000176100017610000002176713242523705013720 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __FSARCHIVER_H__ #define __FSARCHIVER_H__ #include "types.h" // ----------------------------- min and max ----------------------------- #if !defined(min) # define min(a, b) ((a) < (b) ? (a) : (b)) #endif #if !defined(max) # define max(a, b) ((a) > (b) ? (a) : (b)) #endif // -------------------------------- fsarchiver commands --------------------------------------------- enum {OPER_NULL=0, OPER_SAVEFS, OPER_RESTFS, OPER_SAVEDIR, OPER_RESTDIR, OPER_ARCHINFO, OPER_PROBE}; // ----------------------------------- dico sections ------------------------------------------------ enum {DICO_OBJ_SECTION_STDATTR=0, DICO_OBJ_SECTION_XATTR=1, DICO_OBJ_SECTION_WINATTR=2}; // ----------------------------------- archive types ------------------------------------------------ enum {ARCHTYPE_NULL=0, ARCHTYPE_FILESYSTEMS, ARCHTYPE_DIRECTORIES}; // ----------------------------------- volume header and footer ------------------------------------- enum {VOLUMEHEADKEY_VOLNUM, VOLUMEHEADKEY_ARCHID, VOLUMEHEADKEY_FILEFORMATVER, VOLUMEHEADKEY_PROGVERCREAT}; enum {VOLUMEFOOTKEY_VOLNUM, VOLUMEFOOTKEY_ARCHID, VOLUMEFOOTKEY_LASTVOL}; // ----------------------------------- algorithms used to process data------------------------------- enum {COMPRESS_NULL=0, COMPRESS_NONE, COMPRESS_LZO, COMPRESS_GZIP, COMPRESS_BZIP2, COMPRESS_LZMA, COMPRESS_LZ4, COMPRESS_ZSTD}; enum {ENCRYPT_NULL=0, ENCRYPT_NONE, ENCRYPT_BLOWFISH}; // ----------------------------------- dico keys ---------------------------------------------------- enum {OBJTYPE_NULL=0, OBJTYPE_DIR, OBJTYPE_SYMLINK, OBJTYPE_HARDLINK, OBJTYPE_CHARDEV, OBJTYPE_BLOCKDEV, OBJTYPE_FIFO, OBJTYPE_SOCKET, OBJTYPE_REGFILEUNIQUE, OBJTYPE_REGFILEMULTI}; enum {DISKITEMKEY_NULL=0, DISKITEMKEY_OBJECTID, DISKITEMKEY_PATH, DISKITEMKEY_OBJTYPE, DISKITEMKEY_SYMLINK, DISKITEMKEY_HARDLINK, DISKITEMKEY_RDEV, DISKITEMKEY_MODE, DISKITEMKEY_SIZE, DISKITEMKEY_UID, DISKITEMKEY_GID, DISKITEMKEY_ATIME, DISKITEMKEY_MTIME, DISKITEMKEY_MD5SUM, DISKITEMKEY_MULTIFILESCOUNT, DISKITEMKEY_MULTIFILESOFFSET, DISKITEMKEY_LINKTARGETTYPE, DISKITEMKEY_FLAGS}; enum {BLOCKHEADITEMKEY_NULL=0, BLOCKHEADITEMKEY_REALSIZE, BLOCKHEADITEMKEY_BLOCKOFFSET, BLOCKHEADITEMKEY_COMPRESSALGO, BLOCKHEADITEMKEY_ENCRYPTALGO, BLOCKHEADITEMKEY_ARSIZE, BLOCKHEADITEMKEY_COMPSIZE, BLOCKHEADITEMKEY_ARCSUM}; enum {BLOCKFOOTITEMKEY_NULL=0, BLOCKFOOTITEMKEY_MD5SUM}; enum {MAINHEADKEY_NULL=0, MAINHEADKEY_FILEFORMATVER, MAINHEADKEY_PROGVERCREAT, MAINHEADKEY_ARCHIVEID, MAINHEADKEY_CREATTIME, MAINHEADKEY_ARCHLABEL, MAINHEADKEY_ARCHTYPE, MAINHEADKEY_FSCOUNT, MAINHEADKEY_COMPRESSALGO, MAINHEADKEY_COMPRESSLEVEL, MAINHEADKEY_ENCRYPTALGO, MAINHEADKEY_BUFCHECKPASSCLEARMD5, MAINHEADKEY_BUFCHECKPASSCRYPTBUF, MAINHEADKEY_FSACOMPLEVEL, MAINHEADKEY_MINFSAVERSION, MAINHEADKEY_HASDIRSINFOHEAD}; enum {FSYSHEADKEY_NULL=0, FSYSHEADKEY_FILESYSTEM, FSYSHEADKEY_MNTPATH, FSYSHEADKEY_BYTESTOTAL, FSYSHEADKEY_BYTESUSED, FSYSHEADKEY_FSLABEL, FSYSHEADKEY_FSUUID, FSYSHEADKEY_FSINODESIZE, FSYSHEADKEY_FSVERSION, FSYSHEADKEY_FSEXTDEFMNTOPT, FSYSHEADKEY_FSEXTREVISION, FSYSHEADKEY_FSEXTBLOCKSIZE, FSYSHEADKEY_FSEXTFEATURECOMPAT, FSYSHEADKEY_FSEXTFEATUREINCOMPAT, FSYSHEADKEY_FSEXTFEATUREROCOMPAT, FSYSHEADKEY_FSREISERBLOCKSIZE, FSYSHEADKEY_FSREISER4BLOCKSIZE, FSYSHEADKEY_FSXFSBLOCKSIZE, FSYSHEADKEY_FSBTRFSSECTORSIZE, FSYSHEADKEY_NTFSSECTORSIZE, FSYSHEADKEY_NTFSCLUSTERSIZE, FSYSHEADKEY_BTRFSFEATURECOMPAT, FSYSHEADKEY_BTRFSFEATUREINCOMPAT, FSYSHEADKEY_BTRFSFEATUREROCOMPAT, FSYSHEADKEY_NTFSUUID, FSYSHEADKEY_MINFSAVERSION, FSYSHEADKEY_MOUNTINFO, FSYSHEADKEY_ORIGDEV, FSYSHEADKEY_TOTALCOST, FSYSHEADKEY_FSEXTFSCKMAXMNTCOUNT, FSYSHEADKEY_FSEXTFSCKCHECKINTERVAL, FSYSHEADKEY_FSEXTEOPTRAIDSTRIPEWIDTH, FSYSHEADKEY_FSEXTEOPTRAIDSTRIDE, FSYSHEADKEY_FSINODEBLOCKSPERGROUP, FSYSHEADKEY_FSXFSVERSION, FSYSHEADKEY_FSXFSFEATURECOMPAT, FSYSHEADKEY_FSXFSFEATUREROCOMPAT, FSYSHEADKEY_FSXFSFEATUREINCOMPAT, FSYSHEADKEY_FSXFSFEATURELOGINCOMPAT, FSYSHEADKEY_FSVFATTYPE, FSYSHEADKEY_FSVFATSERIAL}; enum {DIRSINFOKEY_NULL=0, DIRSINFOKEY_TOTALCOST}; // -------------------------------- fsarchiver errors --------------------------------------------- enum {FSAERR_SUCCESS=0, // success FSAERR_UNKNOWN=-1, // uknown error (default code that means error) FSAERR_ENOMEM=-2, // out of memory error FSAERR_EINVAL=-3, // invalid parameter FSAERR_ENOENT=-4, // entry not found FSAERR_ENDOFFILE=-5, // end of file/queue FSAERR_WRONGTYPE=-6, // wrong type of data FSAERR_NOTOPEN=-7, // resource has been closed FSAERR_ENOSPC=-8, // no space left on device FSAERR_SEEK=-9, // lseek64 error FSAERR_READ=-10, // read error FSAERR_WRITE=-11 // write error }; // -------------------------------- old errors codes --------------------------------------------- enum {OLDERR_FATAL=1, OLDERR_MINOR=2}; // ----------------------------- fsarchiver const ------------------------ #define FSA_VERSION PACKAGE_VERSION #define FSA_RELDATE PACKAGE_RELDATE #define FSA_FILEFORMAT PACKAGE_FILEFMT #define FSA_GCRYPT_VERSION "1.2.3" #define FSA_MAX_FILEFMTLEN 32 #define FSA_MAX_PROGVERLEN 32 #define FSA_MAX_FSNAMELEN 128 #define FSA_MAX_DEVLEN 256 #define FSA_MAX_UUIDLEN 128 #define FSA_MAX_BLKDEVICES 256 #define FSA_MAX_FSPERARCH 128 #define FSA_MAX_COMPJOBS 32 #define FSA_MAX_QUEUESIZE 32 #define FSA_MAX_BLKSIZE 921600 #define FSA_DEF_BLKSIZE 524288 #define FSA_DEF_COMPRESS_ALGO COMPRESS_GZIP // legacy compression is using gzip by default #define FSA_DEF_COMPRESS_LEVEL 6 // legacy compression is with "gzip -6" by default #define FSA_DEF_ZSTD_LEVEL 8 // default compression level when zstd is used #define FSA_MAX_SMALLFILECOUNT 512 // there can be up to FSA_MAX_SMALLFILECOUNT files copied in a single data block #define FSA_MAX_SMALLFILESIZE 131072 // files smaller than that will be grouped with other small files in a single data block #define FSA_COST_PER_FILE 16384 // how much it cost to copy an empty file/dir/link: used to eval the progress bar #define FSA_MAX_LABELLEN 512 #define FSA_MIN_PASSLEN 6 #define FSA_MAX_PASSLEN 64 #define FSA_FILESYSID_NULL 0xFFFF #define FSA_CHECKPASSBUF_SIZE 4096 #define FSA_FILEFLAGS_SPARSE 1<<0 // set when a regfile is a sparse file // ----------------------------- fsarchiver magics -------------------------------------------------- #define FSA_SIZEOF_MAGIC 4 #define FSA_MAGIC_VOLH "FsA0" // volume header (one per volume at the very beginning) #define FSA_MAGIC_VOLF "FsAE" // volume footer (one per volume at the very end) #define FSA_MAGIC_MAIN "ArCh" // archive header (one per archive at the beginning of the first volume) #define FSA_MAGIC_FSIN "FsIn" // filesys info (one per filesystem at the beginning of the archive) #define FSA_MAGIC_FSYB "FsYs" // filesys begin (one per filesystem when the filesys contents start) #define FSA_MAGIC_DIRS "DiRs" // dirs info (one per archive after mainhead before flat dirs/files) #define FSA_MAGIC_OBJT "ObJt" // object header (one per object: regfiles, dirs, symlinks, ...) #define FSA_MAGIC_BLKH "BlKh" // datablk header (one per data block, each regfile may have [0-n]) #define FSA_MAGIC_FILF "FiLf" // filedat footer (one per regfile, after the list of data blocks) #define FSA_MAGIC_DATF "DaEn" // data footer (one per file system, at the end of its contents, or after the contents of the flatfiles) // ------------ global variables --------------------------- extern char *valid_magic[]; // -------------------------------- version_number to u64 ------------------------------------------- #define FSA_VERSION_BUILD(a, b, c, d) ((u64)((((u64)a&0xFFFF)<<48)+(((u64)b&0xFFFF)<<32)+(((u64)c&0xFFFF)<<16)+(((u64)d&0xFFFF)<<0))) #define FSA_VERSION_GET_A(ver) ((((u64)ver)>>48)&0xFFFF) #define FSA_VERSION_GET_B(ver) ((((u64)ver)>>32)&0xFFFF) #define FSA_VERSION_GET_C(ver) ((((u64)ver)>>16)&0xFFFF) #define FSA_VERSION_GET_D(ver) ((((u64)ver)>>0)&0xFFFF) #endif // __FSARCHIVER_H__ fsarchiver-0.8.4/src/Makefile.in0000644000176100017610000027602413242524466013463 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ sbin_PROGRAMS = fsarchiver$(EXEEXT) subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am_fsarchiver_OBJECTS = fsarchiver-fsarchiver.$(OBJEXT) \ fsarchiver-oper_save.$(OBJEXT) \ fsarchiver-oper_restore.$(OBJEXT) \ fsarchiver-oper_probe.$(OBJEXT) \ fsarchiver-thread_archio.$(OBJEXT) \ fsarchiver-archreader.$(OBJEXT) \ fsarchiver-archwriter.$(OBJEXT) fsarchiver-writebuf.$(OBJEXT) \ fsarchiver-archinfo.$(OBJEXT) fsarchiver-thread_comp.$(OBJEXT) \ fsarchiver-comp_gzip.$(OBJEXT) fsarchiver-comp_bzip2.$(OBJEXT) \ fsarchiver-comp_lzma.$(OBJEXT) fsarchiver-comp_lzo.$(OBJEXT) \ fsarchiver-comp_lz4.$(OBJEXT) fsarchiver-comp_zstd.$(OBJEXT) \ fsarchiver-crypto.$(OBJEXT) fsarchiver-fs_ntfs.$(OBJEXT) \ fsarchiver-fs_ext2.$(OBJEXT) fsarchiver-fs_reiserfs.$(OBJEXT) \ fsarchiver-fs_reiser4.$(OBJEXT) fsarchiver-fs_btrfs.$(OBJEXT) \ fsarchiver-fs_xfs.$(OBJEXT) fsarchiver-fs_jfs.$(OBJEXT) \ fsarchiver-fs_vfat.$(OBJEXT) fsarchiver-common.$(OBJEXT) \ fsarchiver-dico.$(OBJEXT) fsarchiver-strdico.$(OBJEXT) \ fsarchiver-dichl.$(OBJEXT) fsarchiver-queue.$(OBJEXT) \ fsarchiver-error.$(OBJEXT) fsarchiver-syncthread.$(OBJEXT) \ fsarchiver-datafile.$(OBJEXT) fsarchiver-strlist.$(OBJEXT) \ fsarchiver-regmulti.$(OBJEXT) fsarchiver-options.$(OBJEXT) \ fsarchiver-logfile.$(OBJEXT) fsarchiver-filesys.$(OBJEXT) \ fsarchiver-devinfo.$(OBJEXT) fsarchiver_OBJECTS = $(am_fsarchiver_OBJECTS) am__DEPENDENCIES_1 = fsarchiver_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) fsarchiver_LINK = $(CCLD) $(fsarchiver_CFLAGS) $(CFLAGS) \ $(fsarchiver_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(fsarchiver_SOURCES) DIST_SOURCES = $(fsarchiver_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLKID_CFLAGS = @BLKID_CFLAGS@ BLKID_LIBS = @BLKID_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COM_ERR_CFLAGS = @COM_ERR_CFLAGS@ COM_ERR_LIBS = @COM_ERR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFAULT_DEBUG_LEVEL = @DEFAULT_DEBUG_LEVEL@ DEFS = @DEFS@ -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_GNU_SOURCE DEPDIR = @DEPDIR@ E2P_CFLAGS = @E2P_CFLAGS@ E2P_LIBS = @E2P_LIBS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXT2FS_CFLAGS = @EXT2FS_CFLAGS@ EXT2FS_LIBS = @EXT2FS_LIBS@ FSARCHIVER_LDFLAGS = @FSARCHIVER_LDFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LOGDIR = @LOGDIR@ LTLIBOBJS = @LTLIBOBJS@ LZMA_CFLAGS = @LZMA_CFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UUID_CFLAGS = @UUID_CFLAGS@ UUID_LIBS = @UUID_LIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ fsarchiver_SOURCES = fsarchiver.c oper_save.c oper_restore.c oper_probe.c \ thread_archio.c archreader.c archwriter.c writebuf.c archinfo.c \ thread_comp.c comp_gzip.c comp_bzip2.c comp_lzma.c comp_lzo.c comp_lz4.c \ comp_zstd.c crypto.c fs_ntfs.c fs_ext2.c fs_reiserfs.c fs_reiser4.c \ fs_btrfs.c fs_xfs.c fs_jfs.c fs_vfat.c common.c dico.c strdico.c dichl.c \ queue.c error.c syncthread.c datafile.c strlist.c regmulti.c options.c \ logfile.c filesys.c devinfo.c noinst_HEADERS = fsarchiver.h oper_save.h oper_restore.h oper_probe.h \ thread_archio.h archreader.h archwriter.h writebuf.h archinfo.h \ thread_comp.h comp_gzip.h comp_bzip2.h comp_lzma.h comp_lzo.h comp_lz4.h \ comp_zstd.h crypto.h fs_ntfs.h fs_ext2.h fs_reiserfs.h fs_reiser4.h \ fs_btrfs.h fs_xfs.h fs_jfs.h fs_vfat.h common.h dico.h strdico.h dichl.h \ queue.h error.h syncthread.h datafile.h strlist.h regmulti.h options.h \ logfile.h types.h filesys.h devinfo.h fsarchiver_LDADD = -lpthread -lrt \ $(LZMA_LIBS) \ $(EXT2FS_LIBS) \ $(COM_ERR_LIBS) \ $(E2P_LIBS) \ $(BLKID_LIBS) \ $(UUID_LIBS) fsarchiver_CFLAGS = @CFLAGS@ -Wall -std=gnu99 -rdynamic -ggdb \ $(LZMA_CFLAGS) \ $(EXT2FS_CFLAGS) \ $(COM_ERR_CFLAGS) \ $(E2P_CFLAGS) \ $(BLKID_CFLAGS) \ $(UUID_CFLAGS) fsarchiver_LDFLAGS = @FSARCHIVER_LDFLAGS@ MAINTAINERCLEANFILES = Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) fsarchiver$(EXEEXT): $(fsarchiver_OBJECTS) $(fsarchiver_DEPENDENCIES) $(EXTRA_fsarchiver_DEPENDENCIES) @rm -f fsarchiver$(EXEEXT) $(AM_V_CCLD)$(fsarchiver_LINK) $(fsarchiver_OBJECTS) $(fsarchiver_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-archinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-archreader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-archwriter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-comp_bzip2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-comp_gzip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-comp_lz4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-comp_lzma.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-comp_lzo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-comp_zstd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-crypto.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-datafile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-devinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-dichl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-dico.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-filesys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-fs_btrfs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-fs_ext2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-fs_jfs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-fs_ntfs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-fs_reiser4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-fs_reiserfs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-fs_vfat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-fs_xfs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-fsarchiver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-logfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-oper_probe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-oper_restore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-oper_save.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-queue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-regmulti.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-strdico.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-strlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-syncthread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-thread_archio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-thread_comp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsarchiver-writebuf.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` fsarchiver-fsarchiver.o: fsarchiver.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fsarchiver.o -MD -MP -MF $(DEPDIR)/fsarchiver-fsarchiver.Tpo -c -o fsarchiver-fsarchiver.o `test -f 'fsarchiver.c' || echo '$(srcdir)/'`fsarchiver.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fsarchiver.Tpo $(DEPDIR)/fsarchiver-fsarchiver.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fsarchiver.c' object='fsarchiver-fsarchiver.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fsarchiver.o `test -f 'fsarchiver.c' || echo '$(srcdir)/'`fsarchiver.c fsarchiver-fsarchiver.obj: fsarchiver.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fsarchiver.obj -MD -MP -MF $(DEPDIR)/fsarchiver-fsarchiver.Tpo -c -o fsarchiver-fsarchiver.obj `if test -f 'fsarchiver.c'; then $(CYGPATH_W) 'fsarchiver.c'; else $(CYGPATH_W) '$(srcdir)/fsarchiver.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fsarchiver.Tpo $(DEPDIR)/fsarchiver-fsarchiver.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fsarchiver.c' object='fsarchiver-fsarchiver.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fsarchiver.obj `if test -f 'fsarchiver.c'; then $(CYGPATH_W) 'fsarchiver.c'; else $(CYGPATH_W) '$(srcdir)/fsarchiver.c'; fi` fsarchiver-oper_save.o: oper_save.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-oper_save.o -MD -MP -MF $(DEPDIR)/fsarchiver-oper_save.Tpo -c -o fsarchiver-oper_save.o `test -f 'oper_save.c' || echo '$(srcdir)/'`oper_save.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-oper_save.Tpo $(DEPDIR)/fsarchiver-oper_save.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oper_save.c' object='fsarchiver-oper_save.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-oper_save.o `test -f 'oper_save.c' || echo '$(srcdir)/'`oper_save.c fsarchiver-oper_save.obj: oper_save.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-oper_save.obj -MD -MP -MF $(DEPDIR)/fsarchiver-oper_save.Tpo -c -o fsarchiver-oper_save.obj `if test -f 'oper_save.c'; then $(CYGPATH_W) 'oper_save.c'; else $(CYGPATH_W) '$(srcdir)/oper_save.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-oper_save.Tpo $(DEPDIR)/fsarchiver-oper_save.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oper_save.c' object='fsarchiver-oper_save.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-oper_save.obj `if test -f 'oper_save.c'; then $(CYGPATH_W) 'oper_save.c'; else $(CYGPATH_W) '$(srcdir)/oper_save.c'; fi` fsarchiver-oper_restore.o: oper_restore.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-oper_restore.o -MD -MP -MF $(DEPDIR)/fsarchiver-oper_restore.Tpo -c -o fsarchiver-oper_restore.o `test -f 'oper_restore.c' || echo '$(srcdir)/'`oper_restore.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-oper_restore.Tpo $(DEPDIR)/fsarchiver-oper_restore.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oper_restore.c' object='fsarchiver-oper_restore.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-oper_restore.o `test -f 'oper_restore.c' || echo '$(srcdir)/'`oper_restore.c fsarchiver-oper_restore.obj: oper_restore.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-oper_restore.obj -MD -MP -MF $(DEPDIR)/fsarchiver-oper_restore.Tpo -c -o fsarchiver-oper_restore.obj `if test -f 'oper_restore.c'; then $(CYGPATH_W) 'oper_restore.c'; else $(CYGPATH_W) '$(srcdir)/oper_restore.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-oper_restore.Tpo $(DEPDIR)/fsarchiver-oper_restore.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oper_restore.c' object='fsarchiver-oper_restore.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-oper_restore.obj `if test -f 'oper_restore.c'; then $(CYGPATH_W) 'oper_restore.c'; else $(CYGPATH_W) '$(srcdir)/oper_restore.c'; fi` fsarchiver-oper_probe.o: oper_probe.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-oper_probe.o -MD -MP -MF $(DEPDIR)/fsarchiver-oper_probe.Tpo -c -o fsarchiver-oper_probe.o `test -f 'oper_probe.c' || echo '$(srcdir)/'`oper_probe.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-oper_probe.Tpo $(DEPDIR)/fsarchiver-oper_probe.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oper_probe.c' object='fsarchiver-oper_probe.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-oper_probe.o `test -f 'oper_probe.c' || echo '$(srcdir)/'`oper_probe.c fsarchiver-oper_probe.obj: oper_probe.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-oper_probe.obj -MD -MP -MF $(DEPDIR)/fsarchiver-oper_probe.Tpo -c -o fsarchiver-oper_probe.obj `if test -f 'oper_probe.c'; then $(CYGPATH_W) 'oper_probe.c'; else $(CYGPATH_W) '$(srcdir)/oper_probe.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-oper_probe.Tpo $(DEPDIR)/fsarchiver-oper_probe.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oper_probe.c' object='fsarchiver-oper_probe.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-oper_probe.obj `if test -f 'oper_probe.c'; then $(CYGPATH_W) 'oper_probe.c'; else $(CYGPATH_W) '$(srcdir)/oper_probe.c'; fi` fsarchiver-thread_archio.o: thread_archio.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-thread_archio.o -MD -MP -MF $(DEPDIR)/fsarchiver-thread_archio.Tpo -c -o fsarchiver-thread_archio.o `test -f 'thread_archio.c' || echo '$(srcdir)/'`thread_archio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-thread_archio.Tpo $(DEPDIR)/fsarchiver-thread_archio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='thread_archio.c' object='fsarchiver-thread_archio.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-thread_archio.o `test -f 'thread_archio.c' || echo '$(srcdir)/'`thread_archio.c fsarchiver-thread_archio.obj: thread_archio.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-thread_archio.obj -MD -MP -MF $(DEPDIR)/fsarchiver-thread_archio.Tpo -c -o fsarchiver-thread_archio.obj `if test -f 'thread_archio.c'; then $(CYGPATH_W) 'thread_archio.c'; else $(CYGPATH_W) '$(srcdir)/thread_archio.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-thread_archio.Tpo $(DEPDIR)/fsarchiver-thread_archio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='thread_archio.c' object='fsarchiver-thread_archio.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-thread_archio.obj `if test -f 'thread_archio.c'; then $(CYGPATH_W) 'thread_archio.c'; else $(CYGPATH_W) '$(srcdir)/thread_archio.c'; fi` fsarchiver-archreader.o: archreader.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-archreader.o -MD -MP -MF $(DEPDIR)/fsarchiver-archreader.Tpo -c -o fsarchiver-archreader.o `test -f 'archreader.c' || echo '$(srcdir)/'`archreader.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-archreader.Tpo $(DEPDIR)/fsarchiver-archreader.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='archreader.c' object='fsarchiver-archreader.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-archreader.o `test -f 'archreader.c' || echo '$(srcdir)/'`archreader.c fsarchiver-archreader.obj: archreader.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-archreader.obj -MD -MP -MF $(DEPDIR)/fsarchiver-archreader.Tpo -c -o fsarchiver-archreader.obj `if test -f 'archreader.c'; then $(CYGPATH_W) 'archreader.c'; else $(CYGPATH_W) '$(srcdir)/archreader.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-archreader.Tpo $(DEPDIR)/fsarchiver-archreader.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='archreader.c' object='fsarchiver-archreader.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-archreader.obj `if test -f 'archreader.c'; then $(CYGPATH_W) 'archreader.c'; else $(CYGPATH_W) '$(srcdir)/archreader.c'; fi` fsarchiver-archwriter.o: archwriter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-archwriter.o -MD -MP -MF $(DEPDIR)/fsarchiver-archwriter.Tpo -c -o fsarchiver-archwriter.o `test -f 'archwriter.c' || echo '$(srcdir)/'`archwriter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-archwriter.Tpo $(DEPDIR)/fsarchiver-archwriter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='archwriter.c' object='fsarchiver-archwriter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-archwriter.o `test -f 'archwriter.c' || echo '$(srcdir)/'`archwriter.c fsarchiver-archwriter.obj: archwriter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-archwriter.obj -MD -MP -MF $(DEPDIR)/fsarchiver-archwriter.Tpo -c -o fsarchiver-archwriter.obj `if test -f 'archwriter.c'; then $(CYGPATH_W) 'archwriter.c'; else $(CYGPATH_W) '$(srcdir)/archwriter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-archwriter.Tpo $(DEPDIR)/fsarchiver-archwriter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='archwriter.c' object='fsarchiver-archwriter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-archwriter.obj `if test -f 'archwriter.c'; then $(CYGPATH_W) 'archwriter.c'; else $(CYGPATH_W) '$(srcdir)/archwriter.c'; fi` fsarchiver-writebuf.o: writebuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-writebuf.o -MD -MP -MF $(DEPDIR)/fsarchiver-writebuf.Tpo -c -o fsarchiver-writebuf.o `test -f 'writebuf.c' || echo '$(srcdir)/'`writebuf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-writebuf.Tpo $(DEPDIR)/fsarchiver-writebuf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='writebuf.c' object='fsarchiver-writebuf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-writebuf.o `test -f 'writebuf.c' || echo '$(srcdir)/'`writebuf.c fsarchiver-writebuf.obj: writebuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-writebuf.obj -MD -MP -MF $(DEPDIR)/fsarchiver-writebuf.Tpo -c -o fsarchiver-writebuf.obj `if test -f 'writebuf.c'; then $(CYGPATH_W) 'writebuf.c'; else $(CYGPATH_W) '$(srcdir)/writebuf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-writebuf.Tpo $(DEPDIR)/fsarchiver-writebuf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='writebuf.c' object='fsarchiver-writebuf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-writebuf.obj `if test -f 'writebuf.c'; then $(CYGPATH_W) 'writebuf.c'; else $(CYGPATH_W) '$(srcdir)/writebuf.c'; fi` fsarchiver-archinfo.o: archinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-archinfo.o -MD -MP -MF $(DEPDIR)/fsarchiver-archinfo.Tpo -c -o fsarchiver-archinfo.o `test -f 'archinfo.c' || echo '$(srcdir)/'`archinfo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-archinfo.Tpo $(DEPDIR)/fsarchiver-archinfo.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='archinfo.c' object='fsarchiver-archinfo.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-archinfo.o `test -f 'archinfo.c' || echo '$(srcdir)/'`archinfo.c fsarchiver-archinfo.obj: archinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-archinfo.obj -MD -MP -MF $(DEPDIR)/fsarchiver-archinfo.Tpo -c -o fsarchiver-archinfo.obj `if test -f 'archinfo.c'; then $(CYGPATH_W) 'archinfo.c'; else $(CYGPATH_W) '$(srcdir)/archinfo.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-archinfo.Tpo $(DEPDIR)/fsarchiver-archinfo.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='archinfo.c' object='fsarchiver-archinfo.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-archinfo.obj `if test -f 'archinfo.c'; then $(CYGPATH_W) 'archinfo.c'; else $(CYGPATH_W) '$(srcdir)/archinfo.c'; fi` fsarchiver-thread_comp.o: thread_comp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-thread_comp.o -MD -MP -MF $(DEPDIR)/fsarchiver-thread_comp.Tpo -c -o fsarchiver-thread_comp.o `test -f 'thread_comp.c' || echo '$(srcdir)/'`thread_comp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-thread_comp.Tpo $(DEPDIR)/fsarchiver-thread_comp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='thread_comp.c' object='fsarchiver-thread_comp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-thread_comp.o `test -f 'thread_comp.c' || echo '$(srcdir)/'`thread_comp.c fsarchiver-thread_comp.obj: thread_comp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-thread_comp.obj -MD -MP -MF $(DEPDIR)/fsarchiver-thread_comp.Tpo -c -o fsarchiver-thread_comp.obj `if test -f 'thread_comp.c'; then $(CYGPATH_W) 'thread_comp.c'; else $(CYGPATH_W) '$(srcdir)/thread_comp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-thread_comp.Tpo $(DEPDIR)/fsarchiver-thread_comp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='thread_comp.c' object='fsarchiver-thread_comp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-thread_comp.obj `if test -f 'thread_comp.c'; then $(CYGPATH_W) 'thread_comp.c'; else $(CYGPATH_W) '$(srcdir)/thread_comp.c'; fi` fsarchiver-comp_gzip.o: comp_gzip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_gzip.o -MD -MP -MF $(DEPDIR)/fsarchiver-comp_gzip.Tpo -c -o fsarchiver-comp_gzip.o `test -f 'comp_gzip.c' || echo '$(srcdir)/'`comp_gzip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_gzip.Tpo $(DEPDIR)/fsarchiver-comp_gzip.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_gzip.c' object='fsarchiver-comp_gzip.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_gzip.o `test -f 'comp_gzip.c' || echo '$(srcdir)/'`comp_gzip.c fsarchiver-comp_gzip.obj: comp_gzip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_gzip.obj -MD -MP -MF $(DEPDIR)/fsarchiver-comp_gzip.Tpo -c -o fsarchiver-comp_gzip.obj `if test -f 'comp_gzip.c'; then $(CYGPATH_W) 'comp_gzip.c'; else $(CYGPATH_W) '$(srcdir)/comp_gzip.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_gzip.Tpo $(DEPDIR)/fsarchiver-comp_gzip.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_gzip.c' object='fsarchiver-comp_gzip.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_gzip.obj `if test -f 'comp_gzip.c'; then $(CYGPATH_W) 'comp_gzip.c'; else $(CYGPATH_W) '$(srcdir)/comp_gzip.c'; fi` fsarchiver-comp_bzip2.o: comp_bzip2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_bzip2.o -MD -MP -MF $(DEPDIR)/fsarchiver-comp_bzip2.Tpo -c -o fsarchiver-comp_bzip2.o `test -f 'comp_bzip2.c' || echo '$(srcdir)/'`comp_bzip2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_bzip2.Tpo $(DEPDIR)/fsarchiver-comp_bzip2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_bzip2.c' object='fsarchiver-comp_bzip2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_bzip2.o `test -f 'comp_bzip2.c' || echo '$(srcdir)/'`comp_bzip2.c fsarchiver-comp_bzip2.obj: comp_bzip2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_bzip2.obj -MD -MP -MF $(DEPDIR)/fsarchiver-comp_bzip2.Tpo -c -o fsarchiver-comp_bzip2.obj `if test -f 'comp_bzip2.c'; then $(CYGPATH_W) 'comp_bzip2.c'; else $(CYGPATH_W) '$(srcdir)/comp_bzip2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_bzip2.Tpo $(DEPDIR)/fsarchiver-comp_bzip2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_bzip2.c' object='fsarchiver-comp_bzip2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_bzip2.obj `if test -f 'comp_bzip2.c'; then $(CYGPATH_W) 'comp_bzip2.c'; else $(CYGPATH_W) '$(srcdir)/comp_bzip2.c'; fi` fsarchiver-comp_lzma.o: comp_lzma.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_lzma.o -MD -MP -MF $(DEPDIR)/fsarchiver-comp_lzma.Tpo -c -o fsarchiver-comp_lzma.o `test -f 'comp_lzma.c' || echo '$(srcdir)/'`comp_lzma.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_lzma.Tpo $(DEPDIR)/fsarchiver-comp_lzma.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_lzma.c' object='fsarchiver-comp_lzma.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_lzma.o `test -f 'comp_lzma.c' || echo '$(srcdir)/'`comp_lzma.c fsarchiver-comp_lzma.obj: comp_lzma.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_lzma.obj -MD -MP -MF $(DEPDIR)/fsarchiver-comp_lzma.Tpo -c -o fsarchiver-comp_lzma.obj `if test -f 'comp_lzma.c'; then $(CYGPATH_W) 'comp_lzma.c'; else $(CYGPATH_W) '$(srcdir)/comp_lzma.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_lzma.Tpo $(DEPDIR)/fsarchiver-comp_lzma.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_lzma.c' object='fsarchiver-comp_lzma.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_lzma.obj `if test -f 'comp_lzma.c'; then $(CYGPATH_W) 'comp_lzma.c'; else $(CYGPATH_W) '$(srcdir)/comp_lzma.c'; fi` fsarchiver-comp_lzo.o: comp_lzo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_lzo.o -MD -MP -MF $(DEPDIR)/fsarchiver-comp_lzo.Tpo -c -o fsarchiver-comp_lzo.o `test -f 'comp_lzo.c' || echo '$(srcdir)/'`comp_lzo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_lzo.Tpo $(DEPDIR)/fsarchiver-comp_lzo.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_lzo.c' object='fsarchiver-comp_lzo.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_lzo.o `test -f 'comp_lzo.c' || echo '$(srcdir)/'`comp_lzo.c fsarchiver-comp_lzo.obj: comp_lzo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_lzo.obj -MD -MP -MF $(DEPDIR)/fsarchiver-comp_lzo.Tpo -c -o fsarchiver-comp_lzo.obj `if test -f 'comp_lzo.c'; then $(CYGPATH_W) 'comp_lzo.c'; else $(CYGPATH_W) '$(srcdir)/comp_lzo.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_lzo.Tpo $(DEPDIR)/fsarchiver-comp_lzo.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_lzo.c' object='fsarchiver-comp_lzo.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_lzo.obj `if test -f 'comp_lzo.c'; then $(CYGPATH_W) 'comp_lzo.c'; else $(CYGPATH_W) '$(srcdir)/comp_lzo.c'; fi` fsarchiver-comp_lz4.o: comp_lz4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_lz4.o -MD -MP -MF $(DEPDIR)/fsarchiver-comp_lz4.Tpo -c -o fsarchiver-comp_lz4.o `test -f 'comp_lz4.c' || echo '$(srcdir)/'`comp_lz4.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_lz4.Tpo $(DEPDIR)/fsarchiver-comp_lz4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_lz4.c' object='fsarchiver-comp_lz4.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_lz4.o `test -f 'comp_lz4.c' || echo '$(srcdir)/'`comp_lz4.c fsarchiver-comp_lz4.obj: comp_lz4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_lz4.obj -MD -MP -MF $(DEPDIR)/fsarchiver-comp_lz4.Tpo -c -o fsarchiver-comp_lz4.obj `if test -f 'comp_lz4.c'; then $(CYGPATH_W) 'comp_lz4.c'; else $(CYGPATH_W) '$(srcdir)/comp_lz4.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_lz4.Tpo $(DEPDIR)/fsarchiver-comp_lz4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_lz4.c' object='fsarchiver-comp_lz4.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_lz4.obj `if test -f 'comp_lz4.c'; then $(CYGPATH_W) 'comp_lz4.c'; else $(CYGPATH_W) '$(srcdir)/comp_lz4.c'; fi` fsarchiver-comp_zstd.o: comp_zstd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_zstd.o -MD -MP -MF $(DEPDIR)/fsarchiver-comp_zstd.Tpo -c -o fsarchiver-comp_zstd.o `test -f 'comp_zstd.c' || echo '$(srcdir)/'`comp_zstd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_zstd.Tpo $(DEPDIR)/fsarchiver-comp_zstd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_zstd.c' object='fsarchiver-comp_zstd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_zstd.o `test -f 'comp_zstd.c' || echo '$(srcdir)/'`comp_zstd.c fsarchiver-comp_zstd.obj: comp_zstd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-comp_zstd.obj -MD -MP -MF $(DEPDIR)/fsarchiver-comp_zstd.Tpo -c -o fsarchiver-comp_zstd.obj `if test -f 'comp_zstd.c'; then $(CYGPATH_W) 'comp_zstd.c'; else $(CYGPATH_W) '$(srcdir)/comp_zstd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-comp_zstd.Tpo $(DEPDIR)/fsarchiver-comp_zstd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='comp_zstd.c' object='fsarchiver-comp_zstd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-comp_zstd.obj `if test -f 'comp_zstd.c'; then $(CYGPATH_W) 'comp_zstd.c'; else $(CYGPATH_W) '$(srcdir)/comp_zstd.c'; fi` fsarchiver-crypto.o: crypto.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-crypto.o -MD -MP -MF $(DEPDIR)/fsarchiver-crypto.Tpo -c -o fsarchiver-crypto.o `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-crypto.Tpo $(DEPDIR)/fsarchiver-crypto.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto.c' object='fsarchiver-crypto.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-crypto.o `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c fsarchiver-crypto.obj: crypto.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-crypto.obj -MD -MP -MF $(DEPDIR)/fsarchiver-crypto.Tpo -c -o fsarchiver-crypto.obj `if test -f 'crypto.c'; then $(CYGPATH_W) 'crypto.c'; else $(CYGPATH_W) '$(srcdir)/crypto.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-crypto.Tpo $(DEPDIR)/fsarchiver-crypto.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto.c' object='fsarchiver-crypto.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-crypto.obj `if test -f 'crypto.c'; then $(CYGPATH_W) 'crypto.c'; else $(CYGPATH_W) '$(srcdir)/crypto.c'; fi` fsarchiver-fs_ntfs.o: fs_ntfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_ntfs.o -MD -MP -MF $(DEPDIR)/fsarchiver-fs_ntfs.Tpo -c -o fsarchiver-fs_ntfs.o `test -f 'fs_ntfs.c' || echo '$(srcdir)/'`fs_ntfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_ntfs.Tpo $(DEPDIR)/fsarchiver-fs_ntfs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_ntfs.c' object='fsarchiver-fs_ntfs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_ntfs.o `test -f 'fs_ntfs.c' || echo '$(srcdir)/'`fs_ntfs.c fsarchiver-fs_ntfs.obj: fs_ntfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_ntfs.obj -MD -MP -MF $(DEPDIR)/fsarchiver-fs_ntfs.Tpo -c -o fsarchiver-fs_ntfs.obj `if test -f 'fs_ntfs.c'; then $(CYGPATH_W) 'fs_ntfs.c'; else $(CYGPATH_W) '$(srcdir)/fs_ntfs.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_ntfs.Tpo $(DEPDIR)/fsarchiver-fs_ntfs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_ntfs.c' object='fsarchiver-fs_ntfs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_ntfs.obj `if test -f 'fs_ntfs.c'; then $(CYGPATH_W) 'fs_ntfs.c'; else $(CYGPATH_W) '$(srcdir)/fs_ntfs.c'; fi` fsarchiver-fs_ext2.o: fs_ext2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_ext2.o -MD -MP -MF $(DEPDIR)/fsarchiver-fs_ext2.Tpo -c -o fsarchiver-fs_ext2.o `test -f 'fs_ext2.c' || echo '$(srcdir)/'`fs_ext2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_ext2.Tpo $(DEPDIR)/fsarchiver-fs_ext2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_ext2.c' object='fsarchiver-fs_ext2.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_ext2.o `test -f 'fs_ext2.c' || echo '$(srcdir)/'`fs_ext2.c fsarchiver-fs_ext2.obj: fs_ext2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_ext2.obj -MD -MP -MF $(DEPDIR)/fsarchiver-fs_ext2.Tpo -c -o fsarchiver-fs_ext2.obj `if test -f 'fs_ext2.c'; then $(CYGPATH_W) 'fs_ext2.c'; else $(CYGPATH_W) '$(srcdir)/fs_ext2.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_ext2.Tpo $(DEPDIR)/fsarchiver-fs_ext2.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_ext2.c' object='fsarchiver-fs_ext2.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_ext2.obj `if test -f 'fs_ext2.c'; then $(CYGPATH_W) 'fs_ext2.c'; else $(CYGPATH_W) '$(srcdir)/fs_ext2.c'; fi` fsarchiver-fs_reiserfs.o: fs_reiserfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_reiserfs.o -MD -MP -MF $(DEPDIR)/fsarchiver-fs_reiserfs.Tpo -c -o fsarchiver-fs_reiserfs.o `test -f 'fs_reiserfs.c' || echo '$(srcdir)/'`fs_reiserfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_reiserfs.Tpo $(DEPDIR)/fsarchiver-fs_reiserfs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_reiserfs.c' object='fsarchiver-fs_reiserfs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_reiserfs.o `test -f 'fs_reiserfs.c' || echo '$(srcdir)/'`fs_reiserfs.c fsarchiver-fs_reiserfs.obj: fs_reiserfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_reiserfs.obj -MD -MP -MF $(DEPDIR)/fsarchiver-fs_reiserfs.Tpo -c -o fsarchiver-fs_reiserfs.obj `if test -f 'fs_reiserfs.c'; then $(CYGPATH_W) 'fs_reiserfs.c'; else $(CYGPATH_W) '$(srcdir)/fs_reiserfs.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_reiserfs.Tpo $(DEPDIR)/fsarchiver-fs_reiserfs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_reiserfs.c' object='fsarchiver-fs_reiserfs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_reiserfs.obj `if test -f 'fs_reiserfs.c'; then $(CYGPATH_W) 'fs_reiserfs.c'; else $(CYGPATH_W) '$(srcdir)/fs_reiserfs.c'; fi` fsarchiver-fs_reiser4.o: fs_reiser4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_reiser4.o -MD -MP -MF $(DEPDIR)/fsarchiver-fs_reiser4.Tpo -c -o fsarchiver-fs_reiser4.o `test -f 'fs_reiser4.c' || echo '$(srcdir)/'`fs_reiser4.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_reiser4.Tpo $(DEPDIR)/fsarchiver-fs_reiser4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_reiser4.c' object='fsarchiver-fs_reiser4.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_reiser4.o `test -f 'fs_reiser4.c' || echo '$(srcdir)/'`fs_reiser4.c fsarchiver-fs_reiser4.obj: fs_reiser4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_reiser4.obj -MD -MP -MF $(DEPDIR)/fsarchiver-fs_reiser4.Tpo -c -o fsarchiver-fs_reiser4.obj `if test -f 'fs_reiser4.c'; then $(CYGPATH_W) 'fs_reiser4.c'; else $(CYGPATH_W) '$(srcdir)/fs_reiser4.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_reiser4.Tpo $(DEPDIR)/fsarchiver-fs_reiser4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_reiser4.c' object='fsarchiver-fs_reiser4.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_reiser4.obj `if test -f 'fs_reiser4.c'; then $(CYGPATH_W) 'fs_reiser4.c'; else $(CYGPATH_W) '$(srcdir)/fs_reiser4.c'; fi` fsarchiver-fs_btrfs.o: fs_btrfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_btrfs.o -MD -MP -MF $(DEPDIR)/fsarchiver-fs_btrfs.Tpo -c -o fsarchiver-fs_btrfs.o `test -f 'fs_btrfs.c' || echo '$(srcdir)/'`fs_btrfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_btrfs.Tpo $(DEPDIR)/fsarchiver-fs_btrfs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_btrfs.c' object='fsarchiver-fs_btrfs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_btrfs.o `test -f 'fs_btrfs.c' || echo '$(srcdir)/'`fs_btrfs.c fsarchiver-fs_btrfs.obj: fs_btrfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_btrfs.obj -MD -MP -MF $(DEPDIR)/fsarchiver-fs_btrfs.Tpo -c -o fsarchiver-fs_btrfs.obj `if test -f 'fs_btrfs.c'; then $(CYGPATH_W) 'fs_btrfs.c'; else $(CYGPATH_W) '$(srcdir)/fs_btrfs.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_btrfs.Tpo $(DEPDIR)/fsarchiver-fs_btrfs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_btrfs.c' object='fsarchiver-fs_btrfs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_btrfs.obj `if test -f 'fs_btrfs.c'; then $(CYGPATH_W) 'fs_btrfs.c'; else $(CYGPATH_W) '$(srcdir)/fs_btrfs.c'; fi` fsarchiver-fs_xfs.o: fs_xfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_xfs.o -MD -MP -MF $(DEPDIR)/fsarchiver-fs_xfs.Tpo -c -o fsarchiver-fs_xfs.o `test -f 'fs_xfs.c' || echo '$(srcdir)/'`fs_xfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_xfs.Tpo $(DEPDIR)/fsarchiver-fs_xfs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_xfs.c' object='fsarchiver-fs_xfs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_xfs.o `test -f 'fs_xfs.c' || echo '$(srcdir)/'`fs_xfs.c fsarchiver-fs_xfs.obj: fs_xfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_xfs.obj -MD -MP -MF $(DEPDIR)/fsarchiver-fs_xfs.Tpo -c -o fsarchiver-fs_xfs.obj `if test -f 'fs_xfs.c'; then $(CYGPATH_W) 'fs_xfs.c'; else $(CYGPATH_W) '$(srcdir)/fs_xfs.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_xfs.Tpo $(DEPDIR)/fsarchiver-fs_xfs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_xfs.c' object='fsarchiver-fs_xfs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_xfs.obj `if test -f 'fs_xfs.c'; then $(CYGPATH_W) 'fs_xfs.c'; else $(CYGPATH_W) '$(srcdir)/fs_xfs.c'; fi` fsarchiver-fs_jfs.o: fs_jfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_jfs.o -MD -MP -MF $(DEPDIR)/fsarchiver-fs_jfs.Tpo -c -o fsarchiver-fs_jfs.o `test -f 'fs_jfs.c' || echo '$(srcdir)/'`fs_jfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_jfs.Tpo $(DEPDIR)/fsarchiver-fs_jfs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_jfs.c' object='fsarchiver-fs_jfs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_jfs.o `test -f 'fs_jfs.c' || echo '$(srcdir)/'`fs_jfs.c fsarchiver-fs_jfs.obj: fs_jfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_jfs.obj -MD -MP -MF $(DEPDIR)/fsarchiver-fs_jfs.Tpo -c -o fsarchiver-fs_jfs.obj `if test -f 'fs_jfs.c'; then $(CYGPATH_W) 'fs_jfs.c'; else $(CYGPATH_W) '$(srcdir)/fs_jfs.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_jfs.Tpo $(DEPDIR)/fsarchiver-fs_jfs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_jfs.c' object='fsarchiver-fs_jfs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_jfs.obj `if test -f 'fs_jfs.c'; then $(CYGPATH_W) 'fs_jfs.c'; else $(CYGPATH_W) '$(srcdir)/fs_jfs.c'; fi` fsarchiver-fs_vfat.o: fs_vfat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_vfat.o -MD -MP -MF $(DEPDIR)/fsarchiver-fs_vfat.Tpo -c -o fsarchiver-fs_vfat.o `test -f 'fs_vfat.c' || echo '$(srcdir)/'`fs_vfat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_vfat.Tpo $(DEPDIR)/fsarchiver-fs_vfat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_vfat.c' object='fsarchiver-fs_vfat.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_vfat.o `test -f 'fs_vfat.c' || echo '$(srcdir)/'`fs_vfat.c fsarchiver-fs_vfat.obj: fs_vfat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-fs_vfat.obj -MD -MP -MF $(DEPDIR)/fsarchiver-fs_vfat.Tpo -c -o fsarchiver-fs_vfat.obj `if test -f 'fs_vfat.c'; then $(CYGPATH_W) 'fs_vfat.c'; else $(CYGPATH_W) '$(srcdir)/fs_vfat.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-fs_vfat.Tpo $(DEPDIR)/fsarchiver-fs_vfat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_vfat.c' object='fsarchiver-fs_vfat.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-fs_vfat.obj `if test -f 'fs_vfat.c'; then $(CYGPATH_W) 'fs_vfat.c'; else $(CYGPATH_W) '$(srcdir)/fs_vfat.c'; fi` fsarchiver-common.o: common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-common.o -MD -MP -MF $(DEPDIR)/fsarchiver-common.Tpo -c -o fsarchiver-common.o `test -f 'common.c' || echo '$(srcdir)/'`common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-common.Tpo $(DEPDIR)/fsarchiver-common.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common.c' object='fsarchiver-common.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-common.o `test -f 'common.c' || echo '$(srcdir)/'`common.c fsarchiver-common.obj: common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-common.obj -MD -MP -MF $(DEPDIR)/fsarchiver-common.Tpo -c -o fsarchiver-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-common.Tpo $(DEPDIR)/fsarchiver-common.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='common.c' object='fsarchiver-common.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi` fsarchiver-dico.o: dico.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-dico.o -MD -MP -MF $(DEPDIR)/fsarchiver-dico.Tpo -c -o fsarchiver-dico.o `test -f 'dico.c' || echo '$(srcdir)/'`dico.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-dico.Tpo $(DEPDIR)/fsarchiver-dico.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dico.c' object='fsarchiver-dico.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-dico.o `test -f 'dico.c' || echo '$(srcdir)/'`dico.c fsarchiver-dico.obj: dico.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-dico.obj -MD -MP -MF $(DEPDIR)/fsarchiver-dico.Tpo -c -o fsarchiver-dico.obj `if test -f 'dico.c'; then $(CYGPATH_W) 'dico.c'; else $(CYGPATH_W) '$(srcdir)/dico.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-dico.Tpo $(DEPDIR)/fsarchiver-dico.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dico.c' object='fsarchiver-dico.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-dico.obj `if test -f 'dico.c'; then $(CYGPATH_W) 'dico.c'; else $(CYGPATH_W) '$(srcdir)/dico.c'; fi` fsarchiver-strdico.o: strdico.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-strdico.o -MD -MP -MF $(DEPDIR)/fsarchiver-strdico.Tpo -c -o fsarchiver-strdico.o `test -f 'strdico.c' || echo '$(srcdir)/'`strdico.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-strdico.Tpo $(DEPDIR)/fsarchiver-strdico.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strdico.c' object='fsarchiver-strdico.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-strdico.o `test -f 'strdico.c' || echo '$(srcdir)/'`strdico.c fsarchiver-strdico.obj: strdico.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-strdico.obj -MD -MP -MF $(DEPDIR)/fsarchiver-strdico.Tpo -c -o fsarchiver-strdico.obj `if test -f 'strdico.c'; then $(CYGPATH_W) 'strdico.c'; else $(CYGPATH_W) '$(srcdir)/strdico.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-strdico.Tpo $(DEPDIR)/fsarchiver-strdico.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strdico.c' object='fsarchiver-strdico.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-strdico.obj `if test -f 'strdico.c'; then $(CYGPATH_W) 'strdico.c'; else $(CYGPATH_W) '$(srcdir)/strdico.c'; fi` fsarchiver-dichl.o: dichl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-dichl.o -MD -MP -MF $(DEPDIR)/fsarchiver-dichl.Tpo -c -o fsarchiver-dichl.o `test -f 'dichl.c' || echo '$(srcdir)/'`dichl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-dichl.Tpo $(DEPDIR)/fsarchiver-dichl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dichl.c' object='fsarchiver-dichl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-dichl.o `test -f 'dichl.c' || echo '$(srcdir)/'`dichl.c fsarchiver-dichl.obj: dichl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-dichl.obj -MD -MP -MF $(DEPDIR)/fsarchiver-dichl.Tpo -c -o fsarchiver-dichl.obj `if test -f 'dichl.c'; then $(CYGPATH_W) 'dichl.c'; else $(CYGPATH_W) '$(srcdir)/dichl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-dichl.Tpo $(DEPDIR)/fsarchiver-dichl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dichl.c' object='fsarchiver-dichl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-dichl.obj `if test -f 'dichl.c'; then $(CYGPATH_W) 'dichl.c'; else $(CYGPATH_W) '$(srcdir)/dichl.c'; fi` fsarchiver-queue.o: queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-queue.o -MD -MP -MF $(DEPDIR)/fsarchiver-queue.Tpo -c -o fsarchiver-queue.o `test -f 'queue.c' || echo '$(srcdir)/'`queue.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-queue.Tpo $(DEPDIR)/fsarchiver-queue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='queue.c' object='fsarchiver-queue.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-queue.o `test -f 'queue.c' || echo '$(srcdir)/'`queue.c fsarchiver-queue.obj: queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-queue.obj -MD -MP -MF $(DEPDIR)/fsarchiver-queue.Tpo -c -o fsarchiver-queue.obj `if test -f 'queue.c'; then $(CYGPATH_W) 'queue.c'; else $(CYGPATH_W) '$(srcdir)/queue.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-queue.Tpo $(DEPDIR)/fsarchiver-queue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='queue.c' object='fsarchiver-queue.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-queue.obj `if test -f 'queue.c'; then $(CYGPATH_W) 'queue.c'; else $(CYGPATH_W) '$(srcdir)/queue.c'; fi` fsarchiver-error.o: error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-error.o -MD -MP -MF $(DEPDIR)/fsarchiver-error.Tpo -c -o fsarchiver-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-error.Tpo $(DEPDIR)/fsarchiver-error.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error.c' object='fsarchiver-error.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c fsarchiver-error.obj: error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-error.obj -MD -MP -MF $(DEPDIR)/fsarchiver-error.Tpo -c -o fsarchiver-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-error.Tpo $(DEPDIR)/fsarchiver-error.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error.c' object='fsarchiver-error.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi` fsarchiver-syncthread.o: syncthread.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-syncthread.o -MD -MP -MF $(DEPDIR)/fsarchiver-syncthread.Tpo -c -o fsarchiver-syncthread.o `test -f 'syncthread.c' || echo '$(srcdir)/'`syncthread.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-syncthread.Tpo $(DEPDIR)/fsarchiver-syncthread.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='syncthread.c' object='fsarchiver-syncthread.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-syncthread.o `test -f 'syncthread.c' || echo '$(srcdir)/'`syncthread.c fsarchiver-syncthread.obj: syncthread.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-syncthread.obj -MD -MP -MF $(DEPDIR)/fsarchiver-syncthread.Tpo -c -o fsarchiver-syncthread.obj `if test -f 'syncthread.c'; then $(CYGPATH_W) 'syncthread.c'; else $(CYGPATH_W) '$(srcdir)/syncthread.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-syncthread.Tpo $(DEPDIR)/fsarchiver-syncthread.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='syncthread.c' object='fsarchiver-syncthread.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-syncthread.obj `if test -f 'syncthread.c'; then $(CYGPATH_W) 'syncthread.c'; else $(CYGPATH_W) '$(srcdir)/syncthread.c'; fi` fsarchiver-datafile.o: datafile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-datafile.o -MD -MP -MF $(DEPDIR)/fsarchiver-datafile.Tpo -c -o fsarchiver-datafile.o `test -f 'datafile.c' || echo '$(srcdir)/'`datafile.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-datafile.Tpo $(DEPDIR)/fsarchiver-datafile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='datafile.c' object='fsarchiver-datafile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-datafile.o `test -f 'datafile.c' || echo '$(srcdir)/'`datafile.c fsarchiver-datafile.obj: datafile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-datafile.obj -MD -MP -MF $(DEPDIR)/fsarchiver-datafile.Tpo -c -o fsarchiver-datafile.obj `if test -f 'datafile.c'; then $(CYGPATH_W) 'datafile.c'; else $(CYGPATH_W) '$(srcdir)/datafile.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-datafile.Tpo $(DEPDIR)/fsarchiver-datafile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='datafile.c' object='fsarchiver-datafile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-datafile.obj `if test -f 'datafile.c'; then $(CYGPATH_W) 'datafile.c'; else $(CYGPATH_W) '$(srcdir)/datafile.c'; fi` fsarchiver-strlist.o: strlist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-strlist.o -MD -MP -MF $(DEPDIR)/fsarchiver-strlist.Tpo -c -o fsarchiver-strlist.o `test -f 'strlist.c' || echo '$(srcdir)/'`strlist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-strlist.Tpo $(DEPDIR)/fsarchiver-strlist.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strlist.c' object='fsarchiver-strlist.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-strlist.o `test -f 'strlist.c' || echo '$(srcdir)/'`strlist.c fsarchiver-strlist.obj: strlist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-strlist.obj -MD -MP -MF $(DEPDIR)/fsarchiver-strlist.Tpo -c -o fsarchiver-strlist.obj `if test -f 'strlist.c'; then $(CYGPATH_W) 'strlist.c'; else $(CYGPATH_W) '$(srcdir)/strlist.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-strlist.Tpo $(DEPDIR)/fsarchiver-strlist.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strlist.c' object='fsarchiver-strlist.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-strlist.obj `if test -f 'strlist.c'; then $(CYGPATH_W) 'strlist.c'; else $(CYGPATH_W) '$(srcdir)/strlist.c'; fi` fsarchiver-regmulti.o: regmulti.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-regmulti.o -MD -MP -MF $(DEPDIR)/fsarchiver-regmulti.Tpo -c -o fsarchiver-regmulti.o `test -f 'regmulti.c' || echo '$(srcdir)/'`regmulti.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-regmulti.Tpo $(DEPDIR)/fsarchiver-regmulti.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regmulti.c' object='fsarchiver-regmulti.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-regmulti.o `test -f 'regmulti.c' || echo '$(srcdir)/'`regmulti.c fsarchiver-regmulti.obj: regmulti.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-regmulti.obj -MD -MP -MF $(DEPDIR)/fsarchiver-regmulti.Tpo -c -o fsarchiver-regmulti.obj `if test -f 'regmulti.c'; then $(CYGPATH_W) 'regmulti.c'; else $(CYGPATH_W) '$(srcdir)/regmulti.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-regmulti.Tpo $(DEPDIR)/fsarchiver-regmulti.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regmulti.c' object='fsarchiver-regmulti.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-regmulti.obj `if test -f 'regmulti.c'; then $(CYGPATH_W) 'regmulti.c'; else $(CYGPATH_W) '$(srcdir)/regmulti.c'; fi` fsarchiver-options.o: options.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-options.o -MD -MP -MF $(DEPDIR)/fsarchiver-options.Tpo -c -o fsarchiver-options.o `test -f 'options.c' || echo '$(srcdir)/'`options.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-options.Tpo $(DEPDIR)/fsarchiver-options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='options.c' object='fsarchiver-options.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-options.o `test -f 'options.c' || echo '$(srcdir)/'`options.c fsarchiver-options.obj: options.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-options.obj -MD -MP -MF $(DEPDIR)/fsarchiver-options.Tpo -c -o fsarchiver-options.obj `if test -f 'options.c'; then $(CYGPATH_W) 'options.c'; else $(CYGPATH_W) '$(srcdir)/options.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-options.Tpo $(DEPDIR)/fsarchiver-options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='options.c' object='fsarchiver-options.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-options.obj `if test -f 'options.c'; then $(CYGPATH_W) 'options.c'; else $(CYGPATH_W) '$(srcdir)/options.c'; fi` fsarchiver-logfile.o: logfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-logfile.o -MD -MP -MF $(DEPDIR)/fsarchiver-logfile.Tpo -c -o fsarchiver-logfile.o `test -f 'logfile.c' || echo '$(srcdir)/'`logfile.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-logfile.Tpo $(DEPDIR)/fsarchiver-logfile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logfile.c' object='fsarchiver-logfile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-logfile.o `test -f 'logfile.c' || echo '$(srcdir)/'`logfile.c fsarchiver-logfile.obj: logfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-logfile.obj -MD -MP -MF $(DEPDIR)/fsarchiver-logfile.Tpo -c -o fsarchiver-logfile.obj `if test -f 'logfile.c'; then $(CYGPATH_W) 'logfile.c'; else $(CYGPATH_W) '$(srcdir)/logfile.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-logfile.Tpo $(DEPDIR)/fsarchiver-logfile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logfile.c' object='fsarchiver-logfile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-logfile.obj `if test -f 'logfile.c'; then $(CYGPATH_W) 'logfile.c'; else $(CYGPATH_W) '$(srcdir)/logfile.c'; fi` fsarchiver-filesys.o: filesys.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-filesys.o -MD -MP -MF $(DEPDIR)/fsarchiver-filesys.Tpo -c -o fsarchiver-filesys.o `test -f 'filesys.c' || echo '$(srcdir)/'`filesys.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-filesys.Tpo $(DEPDIR)/fsarchiver-filesys.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='filesys.c' object='fsarchiver-filesys.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-filesys.o `test -f 'filesys.c' || echo '$(srcdir)/'`filesys.c fsarchiver-filesys.obj: filesys.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-filesys.obj -MD -MP -MF $(DEPDIR)/fsarchiver-filesys.Tpo -c -o fsarchiver-filesys.obj `if test -f 'filesys.c'; then $(CYGPATH_W) 'filesys.c'; else $(CYGPATH_W) '$(srcdir)/filesys.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-filesys.Tpo $(DEPDIR)/fsarchiver-filesys.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='filesys.c' object='fsarchiver-filesys.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-filesys.obj `if test -f 'filesys.c'; then $(CYGPATH_W) 'filesys.c'; else $(CYGPATH_W) '$(srcdir)/filesys.c'; fi` fsarchiver-devinfo.o: devinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-devinfo.o -MD -MP -MF $(DEPDIR)/fsarchiver-devinfo.Tpo -c -o fsarchiver-devinfo.o `test -f 'devinfo.c' || echo '$(srcdir)/'`devinfo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-devinfo.Tpo $(DEPDIR)/fsarchiver-devinfo.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='devinfo.c' object='fsarchiver-devinfo.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-devinfo.o `test -f 'devinfo.c' || echo '$(srcdir)/'`devinfo.c fsarchiver-devinfo.obj: devinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -MT fsarchiver-devinfo.obj -MD -MP -MF $(DEPDIR)/fsarchiver-devinfo.Tpo -c -o fsarchiver-devinfo.obj `if test -f 'devinfo.c'; then $(CYGPATH_W) 'devinfo.c'; else $(CYGPATH_W) '$(srcdir)/devinfo.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsarchiver-devinfo.Tpo $(DEPDIR)/fsarchiver-devinfo.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='devinfo.c' object='fsarchiver-devinfo.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsarchiver_CFLAGS) $(CFLAGS) -c -o fsarchiver-devinfo.obj `if test -f 'devinfo.c'; then $(CYGPATH_W) 'devinfo.c'; else $(CYGPATH_W) '$(srcdir)/devinfo.c'; fi` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fsarchiver-0.8.4/src/datafile.h0000644000176100017610000000177513242523705013332 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __DATAFILE_H__ #define __DATAFILE_H__ #include "types.h" struct s_datafile; typedef struct s_datafile cdatafile; cdatafile *datafile_alloc(); int datafile_destroy(cdatafile *f); int datafile_open_write(cdatafile *f, char *path, bool simul, bool sparse); int datafile_write(cdatafile *f, char *data, u64 len); int datafile_close(cdatafile *f, u8 *md5bufdat, int md5bufsize); #endif // __DATAFILE_H__ fsarchiver-0.8.4/src/devinfo.c0000644000176100017610000001256013242523705013200 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "fsarchiver.h" #include "devinfo.h" #include "common.h" #include "fs_ext2.h" #include "error.h" int get_devinfo(struct s_devinfo *outdev, char *indevname, int min, int maj) { char sysblkdevname[512]; blkid_tag_iterate iter; char sysblkinfo[PATH_MAX]; const char *type, *value; struct stat64 statbuf; struct dirent *dir; char temp[PATH_MAX]; blkid_dev dev; DIR *dirdesc; FILE *finfo; int found; int fd; int i; // init memset(outdev, 0, sizeof(struct s_devinfo)); // defaults values outdev->devtype=BLKDEV_INVALID; snprintf(outdev->label, sizeof(outdev->label), ""); snprintf(outdev->uuid, sizeof(outdev->uuid), ""); snprintf(outdev->fsname, sizeof(outdev->fsname), ""); // check the name starts with "/dev/" if ((strlen(indevname) < 5) || (memcmp(indevname, "/dev/", 5)!=0)) return -1; // get short name ("/dev/sda1" -> "sda1") snprintf(outdev->devname, sizeof(outdev->devname), "%s", indevname+5); // skip "/dev/" // get long name if there is one (eg: LVM / devmapper) snprintf(outdev->longname, sizeof(outdev->longname), "%s", indevname); if ((dirdesc=opendir("/dev/mapper"))!=NULL) { found=false; while (((dir=readdir(dirdesc)) != NULL) && found==false) { snprintf(temp, sizeof(temp), "/dev/mapper/%s", dir->d_name); if ((stat64(temp, &statbuf)==0) && S_ISBLK(statbuf.st_mode) && (major(statbuf.st_rdev)==maj) && (minor(statbuf.st_rdev)==min)) { snprintf(outdev->longname, sizeof(outdev->longname), "%s", temp); found=true; } } closedir(dirdesc); } // get device basic info (size, major, minor) if (((fd=open64(outdev->longname, O_RDONLY|O_LARGEFILE))<0) || ((outdev->devsize=lseek64(fd, 0, SEEK_END))<0) || (fstat64(fd, &statbuf)!=0) || (!S_ISBLK(statbuf.st_mode)) || (close(fd)<0)) return -1; outdev->rdev=statbuf.st_rdev; outdev->major=major(statbuf.st_rdev); outdev->minor=minor(statbuf.st_rdev); format_size(outdev->devsize, outdev->txtsize, sizeof(outdev->txtsize), 'h'); if (outdev->devsize==1024) // ignore extended partitions return -1; // devname shown in /sys/block (eg for HP-cciss: "cciss/c0d0" -> "cciss!c0d0") snprintf(sysblkdevname, sizeof(sysblkdevname), "%s", outdev->devname); for (i=0; (sysblkdevname[i]!=0) && (idevtype=BLKDEV_PHYSDISK; snprintf(sysblkinfo, sizeof(sysblkinfo), "/sys/block/%s/device/model", sysblkdevname); if ( ((finfo=fopen(sysblkinfo, "rb")) != NULL) && (fread(temp, 1, sizeof(temp), finfo)>0) && fclose(finfo)==0 ) for (i=0; (temp[i]!=0) && (temp[i]!='\r') && (temp[i]!='\n'); i++) outdev->name[i]=temp[i]; } else { outdev->devtype=BLKDEV_FILESYSDEV; } // get blkid infos about the device (label, uuid) blkid_cache cache = NULL; if (blkid_get_cache(&cache, NULL) < 0) return -1; if ((dev=blkid_get_dev(cache, outdev->longname, BLKID_DEV_NORMAL))!=NULL) { iter = blkid_tag_iterate_begin(dev); while (blkid_tag_next(iter, &type, &value)==0) { if (strcmp(type, "LABEL")==0) snprintf(outdev->label, sizeof(outdev->label), "%s", value); else if (strcmp(type, "UUID")==0) snprintf(outdev->uuid, sizeof(outdev->uuid), "%s", value); else if (strcmp(type, "TYPE")==0) snprintf(outdev->fsname, sizeof(outdev->fsname), "%s", value); } blkid_tag_iterate_end(iter); // workaround: blkid < 1.41 don't know ext4 and say it is ext3 instead if (strcmp(outdev->fsname, "ext3")==0) { if (ext3_test(outdev->longname)==true) snprintf(outdev->fsname, sizeof(outdev->fsname), "ext3"); else // cannot run ext4_test(): it would fail on an ext4 when e2fsprogs < 1.41 snprintf(outdev->fsname, sizeof(outdev->fsname), "ext4"); } } blkid_put_cache(cache); // free memory allocated by blkid_get_cache return 0; } fsarchiver-0.8.4/src/fs_ntfs.c0000644000176100017610000002317213242523705013211 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include "fsarchiver.h" #include "devinfo.h" #include "dico.h" #include "common.h" #include "fs_ntfs.h" #include "filesys.h" #include "strlist.h" #include "error.h" int ntfs_mkfs(cdico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid) { char command[2048]; char buffer[2048]; char options[2048]; int exitst; u64 temp64; u32 temp32; u16 temp16; // there is no option that just displays the version and return 0 in mkfs.ntfs if (exec_command(command, sizeof(command), NULL, NULL, 0, NULL, 0, "mkfs.ntfs")!=0) { errprintf("mkfs.ntfs not found. please install ntfsprogs-2.0.0 on your system or check the PATH.\n"); return -1; } // ---- set the advanced filesystem settings from the dico memset(options, 0, sizeof(options)); strlcatf(options, sizeof(options), " %s ", fsoptions); if (strlen(mkfslabel) > 0) strlcatf(options, sizeof(options), " --label '%s' ", mkfslabel); else if (dico_get_string(d, 0, FSYSHEADKEY_FSLABEL, buffer, sizeof(buffer))==0 && strlen(buffer)>0) strlcatf(options, sizeof(options), " --label '%s' ", buffer); if (dico_get_u16(d, 0, FSYSHEADKEY_NTFSSECTORSIZE, &temp16)==0) strlcatf(options, sizeof(options), " -s %ld ", (long)temp16); if (dico_get_u32(d, 0, FSYSHEADKEY_NTFSCLUSTERSIZE, &temp32)==0) strlcatf(options, sizeof(options), " -c %ld ", (long)temp32); if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 0, "mkfs.ntfs -f %s %s", partition, options)!=0 || exitst!=0) { errprintf("command [%s] failed\n", command); return -1; } // ---- preserve ntfs uuid (attribute saved only with fsarchiver>=0.5.8) if (dico_get_u64(d, 0, FSYSHEADKEY_NTFSUUID, &temp64)==0) ntfs_replace_uuid(partition, cpu_to_le64(temp64)); return 0; } int ntfs_getinfo(cdico *d, char *devname) { struct s_devinfo devinfo; struct s_ntfsinfo info; char bootsect[512]; int fd=-1; if (((fd=open64(devname, O_RDONLY|O_LARGEFILE))<0) || (read(fd, bootsect, sizeof(bootsect))!=sizeof(bootsect)) || (close(fd)<0)) { sysprintf("cannot open device or read bootsector on %s\n", devname); return -1; } // check signature in the boot sector if (memcmp(bootsect+3, "NTFS", 4) != 0) { errprintf("cannot find the ntfs signature on %s\n", devname); return -1; } // get device label from common code in libbklid if (get_devinfo(&devinfo, devname, -1, -1)!=0) { errprintf("get_devinfo(%s) failed\n", devname); return -1; } info.bytes_per_sector = le16_to_cpu(*((u16*)(bootsect+0xB))); info.sectors_per_clusters = le8_to_cpu(*((u8*)(bootsect+0xD))); info.bytes_per_cluster = info.bytes_per_sector * info.sectors_per_clusters; info.uuid = le64_to_cpu(*((u64*)(bootsect+0x48))); msgprintf(MSG_VERB2, "bytes_per_sector=[%lld]\n", (long long)info.bytes_per_sector); msgprintf(MSG_VERB2, "sectors_per_clusters=[%lld]\n", (long long)info.sectors_per_clusters); msgprintf(MSG_VERB2, "bytes_per_cluster=[%lld]\n", (long long)info.bytes_per_cluster); msgprintf(MSG_VERB2, "uuid=[%016llX]\n", (long long unsigned int)info.uuid); dico_add_u16(d, 0, FSYSHEADKEY_NTFSSECTORSIZE, info.bytes_per_sector); dico_add_u32(d, 0, FSYSHEADKEY_NTFSCLUSTERSIZE, info.bytes_per_cluster); dico_add_u64(d, 0, FSYSHEADKEY_NTFSUUID, info.uuid); // get label from library dico_add_string(d, 0, FSYSHEADKEY_FSLABEL, devinfo.label); msgprintf(MSG_VERB2, "ntfs_label=[%s]\n", devinfo.label); // minimum fsarchiver version required to restore dico_add_u64(d, 0, FSYSHEADKEY_MINFSAVERSION, FSA_VERSION_BUILD(0, 6, 4, 0)); // save mount options used at savefs so that restfs can use consistent mount options dico_add_string(d, 0, FSYSHEADKEY_MOUNTINFO, "streams_interface=xattr"); // may change in the future return 0; } int ntfs_mount(char *partition, char *mntbuf, char *fsbuf, int flags, char *mntinfo) { char minversion[1024]; char streamif[1024]; int year=0, month=0, day=0; char stderrbuf[2048]; char command[2048]; char options[1024]; char delims[]="\n\r"; char *saveptr; char *result; u64 instver=0; int exitst; // init memset(options, 0, sizeof(options)); memset(stderrbuf, 0, sizeof(stderrbuf)); snprintf(minversion, sizeof(minversion), "ntfs-3g %.4d.%.2d.%.2d (standard release)", NTFS3G_MINVER_Y, NTFS3G_MINVER_M, NTFS3G_MINVER_D); // check that mount.ntfs-3g is available (don't check the exit status, it's not supposed to be 0) if (exec_command(command, sizeof(command), NULL, NULL, 0, stderrbuf, sizeof(stderrbuf), "ntfs-3g -h")!=0) { errprintf("ntfs-3g not found. please install %s\n" "or a newer version on your system or check the PATH.\n", minversion); return -1; } // check if there is a recent ntfs-3g version installed result=strtok_r(stderrbuf, delims, &saveptr); while (result != NULL && instver==0) { if (sscanf(result, "ntfs-3g %4d.%2d.%2d ", &year, &month, &day)==3) { instver=NTFS3G_VERSION(year, month, day); msgprintf(MSG_VERB2, "ntfs-3g detected version: year=[%.4d], month=[%.2d], day=[%.2d]\n", year, month, day); } result = strtok_r(NULL, delims, &saveptr); } if (instver < NTFS3G_VERSION(NTFS3G_MINVER_Y, NTFS3G_MINVER_M, NTFS3G_MINVER_D)) { errprintf("fsarchiver requires %s to operate. The detected version is too old\n", minversion); return -1; } else { msgprintf(MSG_VERB2, "ntfs-3g has been found: version is %d.%d.%d\n", year, month, day); } // if mntinfo is specified, check which mount option was used at savefs and use the same for consistency snprintf(streamif, sizeof(streamif), "xattr"); // set the default "streams_interface" (may change in the future) if ((mntinfo!=NULL) && (strlen(mntinfo)>0)) // if a mntinfo has been specified, respect its options { if (strstr(mntinfo, "streams_interface=xattr")!=NULL) // if "xattr" was used during savefs then use it for restfs snprintf(streamif, sizeof(streamif), "xattr"); else if (strstr(mntinfo, "streams_interface=windows")!=NULL) // if "windows" was used during savefs then use it for restfs snprintf(streamif, sizeof(streamif), "windows"); } // set mount options strlcatf(options, sizeof(options), " -o streams_interface=%s -o efs_raw ", streamif); if (flags & MS_RDONLY) strlcatf(options, sizeof(options), " -o ro "); // ---- set the advanced filesystem settings from the dico if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 0, "ntfs-3g %s %s %s", options, partition, mntbuf)!=0 || exitst!=0) { errprintf("command [%s] failed, make sure a recent version of ntfs-3g is installed\n", command); return -1; } return 0; } int ntfs_umount(char *partition, char *mntbuf) { char command[2048]; int existst; if (exec_command(command, sizeof(command), NULL, NULL, 0, NULL, 0, "fusermount")!=0) { errprintf("fusermount not found. please install fuse on your system or check the PATH.\n"); return -1; } if (exec_command(command, sizeof(command), &existst, NULL, 0, NULL, 0, "fusermount -u %s", mntbuf)!=0 || existst!=0) { errprintf("cannot unmount [%s]\n", mntbuf); return -1; } return 0; } int ntfs_test(char *devname) { char bootsect[16384]; int fd=-1; if ((fd=open64(devname, O_RDONLY|O_LARGEFILE))<0) return false; if (read(fd, bootsect, sizeof(bootsect))!=sizeof(bootsect)) { close(fd); return false; } if (memcmp(bootsect+3, "NTFS", 4) != 0) { close(fd); return false; } close(fd); return true; } int ntfs_get_reqmntopt(char *partition, cstrlist *reqopt, cstrlist *badopt) { if (!reqopt || !badopt) return -1; strlist_add(reqopt, "streams_interface=xattr"); // may change in the future return 0; } int ntfs_replace_uuid(char *devname, u64 uuid) { u8 bootsect[512]; int fd=-1; if ((fd=open64(devname, O_RDWR|O_LARGEFILE))<0) { errprintf("cannot open(%s, O_RDWR)\n", devname); return -1; } if (read(fd, bootsect, sizeof(bootsect))!=sizeof(bootsect)) { errprintf("cannot read the boot sector on %s\n", devname); close(fd); return -1; } memcpy(bootsect+0x48, &uuid, sizeof(uuid)); if (lseek(fd, 0, SEEK_SET)!=0) { errprintf("lseek(fd, 0, SEEK_SET) failed\n"); close(fd); return -1; } if (write(fd, bootsect, sizeof(bootsect))!=sizeof(bootsect)) { errprintf("cannot modify the boot sector on %s\n", devname); close(fd); return -1; } close(fd); return 0; } fsarchiver-0.8.4/src/comp_lz4.c0000644000176100017610000000362313217127345013277 00000000000000 /* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2017 Cristian Vazquez. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "fsarchiver.h" #include "common.h" #include "comp_lz4.h" #include "error.h" #ifdef OPTION_LZ4_SUPPORT int compress_block_lz4(u64 origsize, u64 *compsize, u8 *origbuf, u8 *compbuf, u64 compbufsize, int level) { int destsize=compbufsize; int res; #define LZ4_VERSION (LZ4_VERSION_MAJOR*10 + LZ4_VERSION_MINOR) #if LZ4_VERSION >= 17 res=LZ4_compress_default((const char*)origbuf, (char*)compbuf, (int)origsize, destsize); if (res==0){ errprintf("LZ4_compress_default(): failed.\n"); return FSAERR_UNKNOWN; } #else res=LZ4_compress((const char*)origbuf, (char*)compbuf, (int)origsize); if (res==0){ errprintf("LZ4_compress(): failed.\n"); return FSAERR_UNKNOWN; } #endif // LZ4_VERSION if (res > 0){ *compsize=(u64)res; return FSAERR_SUCCESS; } return FSAERR_UNKNOWN; } int uncompress_block_lz4(u64 compsize, u64 *origsize, u8 *origbuf, u64 origbufsize, u8 *compbuf) { int destsize=origbufsize; int res; if((res=LZ4_decompress_safe((char*)compbuf, (char*)origbuf, compsize, destsize)) > 0){ *origsize=(u64)res; return FSAERR_SUCCESS; } errprintf("LZ4_decompress_safe() failed, res=%d\n", res); return FSAERR_UNKNOWN; } #endif //OPTION_LZ4_SUPPORT fsarchiver-0.8.4/src/fs_btrfs.c0000644000176100017610000001617713242523705013366 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include #include #include "fsarchiver.h" #include "dico.h" #include "common.h" #include "fs_btrfs.h" #include "filesys.h" #include "strlist.h" #include "error.h" int btrfs_check_compatibility(u64 compat, u64 incompat, u64 ro_compat) { // to preserve the filesystem attributes, fsa must know all the features including the COMPAT ones if (compat & ~FSA_BTRFS_FEATURE_COMPAT_SUPP) return -1; if (incompat & ~FSA_BTRFS_FEATURE_INCOMPAT_SUPP) return -1; if (ro_compat & ~FSA_BTRFS_FEATURE_COMPAT_RO_SUPP) return -1; return 0; } int btrfs_mkfs(cdico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid) { char command[2048]; char buffer[2048]; char options[2048]; u64 compat_flags; u64 incompat_flags; u64 compat_ro_flags; int exitst; u64 temp64; // ---- get original filesystem features (if the original filesystem was a btrfs) if (dico_get_u64(d, 0, FSYSHEADKEY_BTRFSFEATURECOMPAT, &compat_flags)!=0 || dico_get_u64(d, 0, FSYSHEADKEY_BTRFSFEATUREINCOMPAT, &incompat_flags)!=0 || dico_get_u64(d, 0, FSYSHEADKEY_BTRFSFEATUREROCOMPAT, &compat_ro_flags)!=0) { // dont fail the original filesystem may not be a btrfs. in that case set defaults features compat_flags=0; incompat_flags=0; compat_ro_flags=0; } // ---- check there is no unsuported feature in that filesystem if (btrfs_check_compatibility(compat_flags, incompat_flags, compat_ro_flags)!=0) { errprintf("this filesystem has features which are not supported by this fsarchiver version.\n"); return -1; } // ---- there is no option that just displays the version and return 0 in mkfs.btrfs-0.16 if (exec_command(command, sizeof(command), NULL, NULL, 0, NULL, 0, "mkfs.btrfs")!=0) { errprintf("mkfs.btrfs not found. please install btrfs-progs on your system or check the PATH.\n"); return -1; } // ---- set the advanced filesystem settings from the dico memset(options, 0, sizeof(options)); strlcatf(options, sizeof(options), " %s ", fsoptions); if (strlen(mkfslabel) > 0) strlcatf(options, sizeof(options), " -L '%s' ", mkfslabel); else if (dico_get_string(d, 0, FSYSHEADKEY_FSLABEL, buffer, sizeof(buffer))==0 && strlen(buffer)>0) strlcatf(options, sizeof(options), " -L '%s' ", buffer); if (strlen(mkfsuuid) > 0) strlcatf(options, sizeof(options), " -U '%s' ", mkfsuuid); else if (dico_get_string(d, 0, FSYSHEADKEY_FSUUID, buffer, sizeof(buffer))==0) strlcatf(options, sizeof(options), " -U '%s' ", buffer); if (dico_get_u64(d, 0, FSYSHEADKEY_FSBTRFSSECTORSIZE, &temp64)==0) strlcatf(options, sizeof(options), " -s %ld ", (long)temp64); if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 0, "mkfs.btrfs -f %s %s", partition, options)!=0 || exitst!=0) { errprintf("command [%s] failed\n", command); return -1; } return 0; } int btrfs_getinfo(cdico *d, char *devname) { struct btrfs_super_block sb; char uuid[512]; u16 temp32; int ret=0; int fd; if ((fd=open64(devname, O_RDONLY|O_LARGEFILE))<0) { ret=-1; errprintf("cannot open(%s, O_RDONLY)\n", devname); goto btrfs_read_sb_return; } if (lseek(fd, BTRFS_SUPER_INFO_OFFSET, SEEK_SET)!=BTRFS_SUPER_INFO_OFFSET) { ret=-2; errprintf("cannot lseek(fd, BTRFS_SUPER_INFO_OFFSET, SEEK_SET) on %s\n", devname); goto btrfs_read_sb_close; } if (read(fd, &sb, sizeof(sb))!=sizeof(sb)) { ret=-3; errprintf("cannot read the btrfs superblock on device [%s]\n", devname); goto btrfs_read_sb_close; } if (strncmp((char*)&sb.magic, BTRFS_MAGIC, sizeof(sb.magic))!=0) { ret=-4; errprintf("magic different from expectations superblock on [%s]: magic=[%.8s], expected=[%.8s]\n", devname, (char*)&sb.magic, BTRFS_MAGIC); goto btrfs_read_sb_close; } // ---- label msgprintf(MSG_DEBUG1, "btrfs_label=[%s]\n", sb.label); dico_add_string(d, 0, FSYSHEADKEY_FSLABEL, (char*)sb.label); // ---- uuid /*if ((str=e2p_uuid2str(sb.dev_item.fsid))!=NULL) dico_add_string(d, 0, FSYSHEADKEY_FSUUID, str);*/ memset(uuid, 0, sizeof(uuid)); uuid_unparse_lower((u8*)sb.dev_item.fsid, uuid); dico_add_string(d, 0, FSYSHEADKEY_FSUUID, uuid); msgprintf(MSG_DEBUG1, "btrfs_uuid=[%s]\n", uuid); // ---- sector size temp32=le32_to_cpu(sb.sectorsize); dico_add_u64(d, 0, FSYSHEADKEY_FSBTRFSSECTORSIZE, temp32); msgprintf(MSG_DEBUG1, "btrfs_sectorsize=[%ld]\n", (long)temp32); // ---- filesystem features dico_add_u64(d, 0, FSYSHEADKEY_BTRFSFEATURECOMPAT, le64_to_cpu(sb.compat_flags)); dico_add_u64(d, 0, FSYSHEADKEY_BTRFSFEATUREINCOMPAT, le64_to_cpu(sb.incompat_flags)); dico_add_u64(d, 0, FSYSHEADKEY_BTRFSFEATUREROCOMPAT, le64_to_cpu(sb.compat_ro_flags)); if (btrfs_check_compatibility(le64_to_cpu(sb.compat_flags), le64_to_cpu(sb.incompat_flags), le64_to_cpu(sb.compat_ro_flags))!=0) { errprintf("this filesystem has features which are not supported by this fsarchiver version.\n"); return -1; } // ---- minimum fsarchiver version required to restore dico_add_u64(d, 0, FSYSHEADKEY_MINFSAVERSION, FSA_VERSION_BUILD(0, 6, 4, 0)); btrfs_read_sb_close: close(fd); btrfs_read_sb_return: return ret; } int btrfs_mount(char *partition, char *mntbuf, char *fsbuf, int flags, char *mntinfo) { return generic_mount(partition, mntbuf, fsbuf, NULL, flags); } int btrfs_umount(char *partition, char *mntbuf) { return generic_umount(mntbuf); } int btrfs_test(char *devname) { struct btrfs_super_block sb; int fd; if ((fd=open64(devname, O_RDONLY|O_LARGEFILE))<0) return false; if (lseek(fd, BTRFS_SUPER_INFO_OFFSET, SEEK_SET)!=BTRFS_SUPER_INFO_OFFSET) { close(fd); return false; } if (read(fd, &sb, sizeof(sb))!=sizeof(sb)) { close(fd); return false; } if (strncmp((char*)&sb.magic, BTRFS_MAGIC, sizeof(sb.magic))!=0) { close(fd); return false; } close(fd); return true; } int btrfs_get_reqmntopt(char *partition, cstrlist *reqopt, cstrlist *badopt) { if (!reqopt || !badopt) return -1; strlist_add(badopt, "noacl"); return 0; } fsarchiver-0.8.4/src/thread_archio.c0000644000176100017610000002400013242523705014332 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include "fsarchiver.h" #include "archreader.h" #include "archwriter.h" #include "dico.h" #include "common.h" #include "error.h" #include "syncthread.h" #include "queue.h" void *thread_writer_fct(void *args) { struct s_headinfo headinfo; struct s_blockinfo blkinfo; carchwriter *ai=NULL; s64 blknum; int type; // init inc_secthreads(); if ((ai=(carchwriter *)args)==NULL) { errprintf("ai is NULL\n"); goto thread_writer_fct_error; } if (archwriter_volpath(ai)!=0) { msgprintf(MSG_STACK, "archwriter_volpath() failed\n"); goto thread_writer_fct_error; } if (archwriter_create(ai)!=0) { msgprintf(MSG_STACK, "archwriter_create(%s) failed\n", ai->basepath); goto thread_writer_fct_error; } if (archwriter_write_volheader(ai)!=0) { msgprintf(MSG_STACK, "cannot write volume header: archwriter_write_volheader() failed\n"); goto thread_writer_fct_error; } while (queue_get_end_of_queue(&g_queue)==false) { if ((blknum=queue_dequeue_first(&g_queue, &type, &headinfo, &blkinfo))<0 && blknum!=FSAERR_ENDOFFILE) // error { msgprintf(MSG_STACK, "queue_dequeue_first()=%ld=%s failed\n", (long)blknum, error_int_to_string(blknum)); goto thread_writer_fct_error; } else if (blknum>0) // block or header found { switch (type) { case QITEM_TYPE_BLOCK: if (archwriter_dowrite_block(ai, &blkinfo)!=0) { msgprintf(MSG_STACK, "archive_dowrite_block() failed\n"); goto thread_writer_fct_error; } free(blkinfo.blkdata); break; case QITEM_TYPE_HEADER: if (archwriter_dowrite_header(ai, &headinfo)!=0) { msgprintf(MSG_STACK, "archive_write_header() failed\n"); goto thread_writer_fct_error; } dico_destroy(headinfo.dico); break; default: errprintf("unexpected item type from queue: type=%d\n", type); break; } } } // write last volume footer if (archwriter_write_volfooter(ai, true)!=0) { msgprintf(MSG_STACK, "cannot write volume footer: archio_write_volfooter() failed\n"); goto thread_writer_fct_error; } archwriter_close(ai); msgprintf(MSG_DEBUG1, "THREAD-WRITER: exit success\n"); dec_secthreads(); return NULL; thread_writer_fct_error: msgprintf(MSG_DEBUG1, "THREAD-WRITER: exit remove\n"); set_stopfillqueue(); // say to the create.c thread that it must stop while (queue_get_end_of_queue(&g_queue)==false) // wait until all the compression threads exit queue_destroy_first_item(&g_queue); // empty queue archwriter_close(ai); dec_secthreads(); return NULL; } void *thread_reader_fct(void *args) { char magic[FSA_SIZEOF_MAGIC]; struct s_blockinfo blkinfo; u32 endofarchive=false; carchreader *ai=NULL; cdico *dico=NULL; int skipblock; u16 fsid; int sumok; int status; u64 errors; s64 lres; int res; // init errors=0; inc_secthreads(); if ((ai=(carchreader *)args)==NULL) { errprintf("ai is NULL\n"); goto thread_reader_fct_error; } // open archive file if (archreader_volpath(ai)!=0) { errprintf("archreader_volpath() failed\n"); goto thread_reader_fct_error; } if (archreader_open(ai)!=0) { errprintf("archreader_open(%s) failed\n", ai->basepath); goto thread_reader_fct_error; } // read volume header if (archreader_read_volheader(ai)!=0) { errprintf("archio_read_volheader() failed\n"); goto thread_reader_fct_error; } // ---- read main archive header if ((res=archreader_read_header(ai, magic, &dico, false, &fsid))!=FSAERR_SUCCESS) { errprintf("archreader_read_header() failed to read the archive header\n"); goto thread_reader_fct_error; // this header is required to continue } if (dico_get_u32(dico, 0, MAINHEADKEY_ARCHIVEID, &ai->archid)!=0) { msgprintf(3, "cannot get archive-id from main header\n"); goto thread_reader_fct_error; } if ((lres=queue_add_header(&g_queue, dico, magic, fsid))!=FSAERR_SUCCESS) { errprintf("queue_add_header()=%ld=%s failed to add the archive header\n", (long)lres, error_int_to_string(lres)); goto thread_reader_fct_error; } // read all other data from file (filesys-header, normal objects headers, ...) while (endofarchive==false && get_stopfillqueue()==false) { if ((res=archreader_read_header(ai, magic, &dico, true, &fsid))!=FSAERR_SUCCESS) { dico_destroy(dico); msgprintf(MSG_STACK, "archreader_read_header() failed to read next header\n"); if (res==OLDERR_MINOR) // header is corrupt or not what we expected { errors++; msgprintf(MSG_DEBUG1, "OLDERR_MINOR\n"); continue; } else // fatal error (eg: cannot read archive from disk) { msgprintf(MSG_DEBUG1, "!OLDERR_MINOR\n"); goto thread_reader_fct_error; } } // read header and see if it's for archive management or higher level data if (strncmp(magic, FSA_MAGIC_VOLF, FSA_SIZEOF_MAGIC)==0) // header is "end of volume" { archreader_close(ai); // check the "end of archive" flag in header if (dico_get_u32(dico, 0, VOLUMEFOOTKEY_LASTVOL, &endofarchive)!=0) { errprintf("cannot get compr from block-header\n"); goto thread_reader_fct_error; } msgprintf(MSG_VERB2, "End of volume [%s]\n", ai->volpath); if (endofarchive!=true) { archreader_incvolume(ai, false); while (regfile_exists(ai->volpath)!=true) { // wait until the queue is empty so that the main thread does not pollute the screen while (queue_count(&g_queue)>0) usleep(5000); fflush(stdout); fflush(stderr); msgprintf(MSG_FORCE, "File [%s] is not found, please type the path to volume %ld:\n", ai->volpath, (long)ai->curvol); fprintf(stdout, "New path:> "); res=scanf("%256s", ai->volpath); } msgprintf(MSG_VERB2, "New volume is [%s]\n", ai->volpath); if (archreader_open(ai)!=0) { msgprintf(MSG_STACK, "archreader_open() failed\n"); goto thread_reader_fct_error; } if (archreader_read_volheader(ai)!=0) { msgprintf(MSG_STACK, "archio_read_volheader() failed\n"); goto thread_reader_fct_error; } } dico_destroy(dico); } else // high-level archive (not involved in volume management) { if (strncmp(magic, FSA_MAGIC_BLKH, FSA_SIZEOF_MAGIC)==0) // header starts a data block { skipblock=(g_fsbitmap[fsid]==0); //errprintf("DEBUG: skipblock=%d g_fsbitmap[fsid=%d]=%d\n", skipblock, (int)fsid, (int)g_fsbitmap[fsid]); if (archreader_read_block(ai, dico, skipblock, &sumok, &blkinfo)!=0) { msgprintf(MSG_STACK, "archreader_read_block() failed\n"); goto thread_reader_fct_error; } if (skipblock==false) { status=((sumok==true)?QITEM_STATUS_TODO:QITEM_STATUS_DONE); if ((lres=queue_add_block(&g_queue, &blkinfo, status))!=FSAERR_SUCCESS) { if (lres!=FSAERR_NOTOPEN) errprintf("queue_add_block()=%ld=%s failed\n", (long)lres, error_int_to_string(lres)); goto thread_reader_fct_error; } if (sumok==false) errors++; dico_destroy(dico); } } else // another higher level header { // if it's a global header or a if this local header belongs to a filesystem that the main thread needs if (fsid==FSA_FILESYSID_NULL || g_fsbitmap[fsid]==1) { if ((lres=queue_add_header(&g_queue, dico, magic, fsid))!=FSAERR_SUCCESS) { msgprintf(MSG_STACK, "queue_add_header()=%ld=%s failed\n", (long)lres, error_int_to_string(lres)); goto thread_reader_fct_error; } } else // header not used: remove data strucutre in dynamic memory { dico_destroy(dico); } } } } thread_reader_fct_error: msgprintf(MSG_DEBUG1, "THREAD-READER: queue_set_end_of_queue(&g_queue, true)\n"); queue_set_end_of_queue(&g_queue, true); // don't wait for more data from this thread dec_secthreads(); msgprintf(MSG_DEBUG1, "THREAD-READER: exit\n"); return NULL; } fsarchiver-0.8.4/src/comp_zstd.c0000644000176100017610000000306713242523705013552 00000000000000 /* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "fsarchiver.h" #include "common.h" #include "comp_zstd.h" #include "error.h" #ifdef OPTION_ZSTD_SUPPORT int compress_block_zstd(u64 origsize, u64 *compsize, u8 *origbuf, u8 *compbuf, u64 compbufsize, int level) { int res=0; if (ZSTD_isError((res=ZSTD_compress((char*)compbuf, compbufsize, (const char*)origbuf, (int)origsize, level)))) { errprintf("ZSTD_compress(): failed: res=%d\n", res); return FSAERR_UNKNOWN; } else { *compsize=(u64)res; return FSAERR_SUCCESS; } } int uncompress_block_zstd(u64 compsize, u64 *origsize, u8 *origbuf, u64 origbufsize, u8 *compbuf) { int res=0; if (ZSTD_isError((res=ZSTD_decompress((char*)origbuf, origbufsize, (char*)compbuf, compsize)))) { errprintf("ZSTD_decompress(): failed: res=%d\n", res); return FSAERR_UNKNOWN; } else { *origsize=(u64)res; return FSAERR_SUCCESS; } } #endif // OPTION_ZSTD_SUPPORT fsarchiver-0.8.4/src/archwriter.c0000644000176100017610000002664713242523705013733 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include #include "fsarchiver.h" #include "dico.h" #include "common.h" #include "options.h" #include "archwriter.h" #include "queue.h" #include "writebuf.h" #include "comp_gzip.h" #include "comp_bzip2.h" #include "error.h" #define FSA_SMB_SUPER_MAGIC 0x517B #define FSA_CIFS_MAGIC_NUMBER 0xFF534D42 int archwriter_init(carchwriter *ai) { assert(ai); memset(ai, 0, sizeof(struct s_archwriter)); strlist_init(&ai->vollist); ai->newarch=false; ai->archfd=-1; ai->archid=0; ai->curvol=0; return 0; } int archwriter_destroy(carchwriter *ai) { assert(ai); strlist_destroy(&ai->vollist); return 0; } int archwriter_generate_id(carchwriter *ai) { assert(ai); ai->archid=generate_random_u32_id(); return 0; } int archwriter_create(carchwriter *ai) { //char testpath[PATH_MAX]; //struct statfs svfs; //int tempfd; struct stat64 st; long archflags=0; long archperm; int res; assert(ai); // init memset(&st, 0, sizeof(st)); archflags=O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE; archperm=S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH; // if the archive already exists and is a not regular file res=stat64(ai->volpath, &st); if (res==0 && !S_ISREG(st.st_mode)) { errprintf("%s already exists, and is not a regular file.\n", ai->basepath); return -1; } else if ((g_options.overwrite==0) && (res==0) && S_ISREG(st.st_mode)) // archive exists and is a regular file { errprintf("%s already exists, please remove it first.\n", ai->basepath); return -1; } // check if it's a network filesystem /*snprintf(testpath, sizeof(testpath), "%s.test", ai->volpath); if (((tempfd=open64(testpath, basicflags, archperm))<0) || (fstatfs(tempfd, &svfs)!=0) || (close(tempfd)!=0) || (unlink(testpath)!=0)) { errprintf("Cannot check the filesystem type on file %s\n", testpath); return -1; } if (svfs.f_type==FSA_CIFS_MAGIC_NUMBER || svfs.f_type==FSA_SMB_SUPER_MAGIC) { sysprintf ("writing an archive on a smbfs/cifs filesystem is " "not allowed, since it can produce corrupt archives.\n"); return -1; }*/ ai->archfd=open64(ai->volpath, archflags, archperm); if (ai->archfd < 0) { sysprintf ("cannot create archive %s\n", ai->volpath); return -1; } ai->newarch=true; strlist_add(&ai->vollist, ai->volpath); /* lockf is causing corruption when the archive is written on a smbfs/cifs filesystem */ /*if (lockf(ai->archfd, F_LOCK, 0)!=0) { sysprintf("Cannot lock archive file: %s\n", ai->volpath); close(ai->archfd); return -1; }*/ return 0; } int archwriter_close(carchwriter *ai) { assert(ai); if (ai->archfd<0) return -1; //res=lockf(ai->archfd, F_ULOCK, 0); fsync(ai->archfd); // just in case the user reboots after it exits close(ai->archfd); ai->archfd=-1; return 0; } int archwriter_remove(carchwriter *ai) { char volpath[PATH_MAX]; int count; int i; assert(ai); if (ai->archfd >= 0) { archwriter_close(ai); } if (ai->newarch==true) { count=strlist_count(&ai->vollist); for (i=0; i < count; i++) { if (strlist_getitem(&ai->vollist, i, volpath, sizeof(volpath))==0) { if (unlink(volpath)==0) msgprintf(MSG_FORCE, "removed %s\n", volpath); else errprintf("cannot remove %s\n", volpath); } } } return 0; } s64 archwriter_get_currentpos(carchwriter *ai) { assert(ai); return (s64)lseek64(ai->archfd, 0, SEEK_CUR); } int archwriter_write_buffer(carchwriter *ai, struct s_writebuf *wb) { struct statvfs64 statvfsbuf; char textbuf[128]; long lres; assert(ai); assert(wb); if (wb->size == 0) { errprintf("wb->size=%ld\n", (long)wb->size); return -1; } if ((lres=write(ai->archfd, (char*)wb->data, (long)wb->size))!=(long)wb->size) { errprintf("write(size=%ld) returned %ld\n", (long)wb->size, (long)lres); if ((lres>0) && (lres < (long)wb->size)) // probably "no space left" { if (fstatvfs64(ai->archfd, &statvfsbuf)!=0) { sysprintf("fstatvfs(fd=%d) failed\n", ai->archfd); return -1; } u64 freebytes = statvfsbuf.f_bfree * statvfsbuf.f_bsize; errprintf("Can't write to the archive file. Space on device is %s. \n" "If the archive is being written to a FAT filesystem, you may have reached \n" "the maximum filesize that it can handle (in general 2 GB)\n", format_size(freebytes, textbuf, sizeof(textbuf), 'h')); return -1; } else // another error { sysprintf("write(size=%ld) failed\n", (long)wb->size); return -1; } } return 0; } int archwriter_volpath(carchwriter *ai) { int res; res=get_path_to_volume(ai->volpath, PATH_MAX, ai->basepath, ai->curvol); return res; } int archwriter_is_path_to_curvol(carchwriter *ai, char *path) { assert(ai); assert(path); return strncmp(ai->volpath, path, PATH_MAX)==0 ? true : false; } int archwriter_incvolume(carchwriter *ai, bool waitkeypress) { assert(ai); ai->curvol++; return archwriter_volpath(ai); } int archwriter_write_volheader(carchwriter *ai) { struct s_writebuf *wb=NULL; cdico *voldico; assert(ai); if ((wb=writebuf_alloc())==NULL) { msgprintf(MSG_STACK, "writebuf_alloc() failed\n"); return -1; } if ((voldico=dico_alloc())==NULL) { msgprintf(MSG_STACK, "voldico=dico_alloc() failed\n"); return -1; } // prepare header dico_add_u32(voldico, 0, VOLUMEHEADKEY_VOLNUM, ai->curvol); dico_add_u32(voldico, 0, VOLUMEHEADKEY_ARCHID, ai->archid); dico_add_string(voldico, 0, VOLUMEHEADKEY_FILEFORMATVER, FSA_FILEFORMAT); dico_add_string(voldico, 0, VOLUMEHEADKEY_PROGVERCREAT, FSA_VERSION); // write header to buffer if (writebuf_add_header(wb, voldico, FSA_MAGIC_VOLH, ai->archid, FSA_FILESYSID_NULL)!=0) { errprintf("archio_write_header() failed\n"); return -1; } // write header to file if (archwriter_write_buffer(ai, wb)!=0) { errprintf("archwriter_write_buffer() failed\n"); return -1; } dico_destroy(voldico); writebuf_destroy(wb); return 0; } int archwriter_write_volfooter(carchwriter *ai, bool lastvol) { struct s_writebuf *wb=NULL; cdico *voldico; assert(ai); if ((wb=writebuf_alloc())==NULL) { errprintf("writebuf_alloc() failed\n"); return -1; } if ((voldico=dico_alloc())==NULL) { errprintf("voldico=dico_alloc() failed\n"); return -1; } // prepare header dico_add_u32(voldico, 0, VOLUMEFOOTKEY_VOLNUM, ai->curvol); dico_add_u32(voldico, 0, VOLUMEFOOTKEY_ARCHID, ai->archid); dico_add_u32(voldico, 0, VOLUMEFOOTKEY_LASTVOL, lastvol); // write header to buffer if (writebuf_add_header(wb, voldico, FSA_MAGIC_VOLF, ai->archid, FSA_FILESYSID_NULL)!=0) { msgprintf(MSG_STACK, "archio_write_header() failed\n"); return -1; } // write header to file if (archwriter_write_buffer(ai, wb)!=0) { msgprintf(MSG_STACK, "archwriter_write_data(size=%ld) failed\n", (long)wb->size); return -1; } dico_destroy(voldico); writebuf_destroy(wb); return 0; } int archwriter_split_check(carchwriter *ai, struct s_writebuf *wb) { s64 cursize; assert(ai); if (((cursize=archwriter_get_currentpos(ai))>=0) && (g_options.splitsize>0 && cursize+wb->size > g_options.splitsize)) { msgprintf(MSG_DEBUG4, "splitchk: YES --> cursize=%lld, g_options.splitsize=%lld, cursize+wb->size=%lld, wb->size=%lld\n", (long long)cursize, (long long)g_options.splitsize, (long long)cursize+wb->size, (long long)wb->size); return true; } else { msgprintf(MSG_DEBUG4, "splitchk: NO --> cursize=%lld, g_options.splitsize=%lld, cursize+wb->size=%lld, wb->size=%lld\n", (long long)cursize, (long long)g_options.splitsize, (long long)cursize+wb->size, (long long)wb->size); return false; } } int archwriter_split_if_necessary(carchwriter *ai, struct s_writebuf *wb) { assert(ai); if (archwriter_split_check(ai, wb)==true) { if (archwriter_write_volfooter(ai, false)!=0) { msgprintf(MSG_STACK, "cannot write volume footer: archio_write_volfooter() failed\n"); return -1; } archwriter_close(ai); archwriter_incvolume(ai, false); msgprintf(MSG_VERB2, "Creating new volume: [%s]\n", ai->volpath); if (archwriter_create(ai)!=0) { msgprintf(MSG_STACK, "archwriter_create() failed\n"); return -1; } if (archwriter_write_volheader(ai)!=0) { msgprintf(MSG_STACK, "cannot write volume header: archio_write_volheader() failed\n"); return -1; } } return 0; } int archwriter_dowrite_block(carchwriter *ai, struct s_blockinfo *blkinfo) { struct s_writebuf *wb=NULL; assert(ai); if ((wb=writebuf_alloc())==NULL) { errprintf("writebuf_alloc() failed\n"); return -1; } if (writebuf_add_block(wb, blkinfo, ai->archid, blkinfo->blkfsid)!=0) { msgprintf(MSG_STACK, "archio_write_block() failed\n"); return -1; } if (archwriter_split_if_necessary(ai, wb)!=0) { msgprintf(MSG_STACK, "archwriter_split_if_necessary() failed\n"); return -1; } if (archwriter_write_buffer(ai, wb)!=0) { msgprintf(MSG_STACK, "archwriter_write_buffer() failed\n"); return -1; } writebuf_destroy(wb); return 0; } int archwriter_dowrite_header(carchwriter *ai, struct s_headinfo *headinfo) { struct s_writebuf *wb=NULL; assert(ai); if ((wb=writebuf_alloc())==NULL) { errprintf("writebuf_alloc() failed\n"); return -1; } if (writebuf_add_header(wb, headinfo->dico, headinfo->magic, ai->archid, headinfo->fsid)!=0) { msgprintf(MSG_STACK, "archio_write_block() failed\n"); return -1; } if (archwriter_split_if_necessary(ai, wb)!=0) { msgprintf(MSG_STACK, "archwriter_split_if_necessary() failed\n"); return -1; } if (archwriter_write_buffer(ai, wb)!=0) { msgprintf(MSG_STACK, "archwriter_write_buffer() failed\n"); return -1; } writebuf_destroy(wb); return 0; } fsarchiver-0.8.4/src/syncthread.h0000644000176100017610000000263513242523705013721 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __SYNCTHREAD_H__ #define __SYNCTHREAD_H__ // global threads sync data extern struct s_queue g_queue; // queue use to share data between the three sort of threads // global threads sync functions int get_abort(); // returns true if threads must exit because an error or signal received bool get_interrupted(); // returns true if either abort is true of stopfillqueue is true // say to the thread that is filling the queue to stop void set_stopfillqueue(); bool get_stopfillqueue(); // secondary threads counter void inc_secthreads(); void dec_secthreads(); int get_secthreads(); // filesystem bitmap used by do_extract() to say to threadio_readimg which filesystems to skip // eg: "g_fsbitmap[0]=1,g_fsbitmap[1]=0" means that we want to read filesystem 0 and skip fs 1 extern u8 g_fsbitmap[FSA_MAX_FSPERARCH]; #endif // __SYNCTHREAD_H__ fsarchiver-0.8.4/src/strdico.c0000644000176100017610000001706513242523705013222 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ /* * Defines an object to store a dictionnary where the key and the * associated value are both strings. It's used to store string of * parameters such as "id=0,dest=/dev/sda1,mkfs=reiserfs" * cstrdico *d; * d=strdico_alloc(); * strdico_set_valid_keys(d, "name,phone,fax"); * strdico_parse_string(d, "name=john,phone=123456789,fax="); * strdico_parse_string(d, "phone=987654321"); * strdico_get_string(d, mybuffer, sizeof(mybuffer), "phone"); * strdico_destroy(d); */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include "fsarchiver.h" #include "strdico.h" #include "common.h" #include "error.h" cstrdico *strdico_alloc() { cstrdico *d; if ((d=malloc(sizeof(cstrdico)))==NULL) return NULL; d->head=NULL; d->validkeys=NULL; return d; } int strdico_destroy(cstrdico *d) { cstrdicoitem *item, *next; assert(d); item=d->head; while (item!=NULL) { next=item->next; free(item->key); if (item->value!=NULL) free(item->value); free(item); item=next; } if (d->validkeys!=NULL) free(d->validkeys); free(d); return FSAERR_SUCCESS; } int strdico_set_valid_keys(cstrdico *d, const char *keys) { assert(d); if ((d->validkeys=strdup(keys))==NULL) { errprintf("strdup() failed: out of memory\n"); return FSAERR_ENOMEM; } return FSAERR_SUCCESS; } int strdico_parse_string(cstrdico *d, const char *strdefs) { char *bakdefs; char *saveptr; char *result; char delims[]=",;\t\n"; char key[1024]; char value[1024]; int i, pos; int res; assert(d); assert(strdefs); // init if ((bakdefs=strdup(strdefs))==NULL) { errprintf("strdup() failed: out of memory\n"); return FSAERR_ENOMEM; } result=strtok_r(bakdefs, delims, &saveptr); while (result!=NULL) { memset(key, 0, sizeof(key)); memset(value, 0, sizeof(value)); for (i=0; (result[i]!=0) && (result[i]!='=') && (i0) strlcatf(options, sizeof(options), " -L '%s' ", buffer); if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 0, "mkfs.jfs -q %s %s", options, partition)!=0 || exitst!=0) { errprintf("command [%s] failed\n", command); return -1; } // ---- use jfs_tune to set the other advanced options memset(options, 0, sizeof(options)); if (strlen(mkfsuuid) > 0) strlcatf(options, sizeof(options), " -U %s ", mkfsuuid); else if (dico_get_string(d, 0, FSYSHEADKEY_FSUUID, buffer, sizeof(buffer))==0 && strlen(buffer)==36) strlcatf(options, sizeof(options), " -U %s ", buffer); if (options[0]) { if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 0, "jfs_tune %s %s", partition, options)!=0 || exitst!=0) { errprintf("command [%s] failed\n", command); return -1; } } return 0; } int jfs_getinfo(cdico *d, char *devname) { struct jfs_superblock sb; char uuid[512]; int ret=0; int fd; if ((fd=open64(devname, O_RDONLY|O_LARGEFILE))<0) { ret=-1; errprintf("cannot open(%s, O_RDONLY)\n", devname); goto jfs_getinfo_return; } if (lseek(fd, JFS_SUPER1_OFF, SEEK_SET)!=JFS_SUPER1_OFF) { ret=-2; errprintf("cannot lseek(fd, JFS_SUPER1_OFF, SEEK_SET) on %s\n", devname); goto jfs_getinfo_close; } if (read(fd, &sb, sizeof(sb))!=sizeof(sb)) { ret=-3; errprintf("cannot read the jfs superblock on [%s]\n", devname); goto jfs_getinfo_close; } if (strncmp(sb.s_magic, JFS_MAGIC, strlen(JFS_MAGIC)) != 0) { ret=-4; errprintf("magic different from expectations superblock on %s: magic=[%s], expected=[%s]\n", devname, sb.s_magic, JFS_MAGIC); goto jfs_getinfo_close; } msgprintf(MSG_DEBUG1, "jfs_magic=[%s]\n", sb.s_magic); // ---- label msgprintf(MSG_DEBUG1, "jfs_label=[%s]\n", sb.s_label); dico_add_string(d, 0, FSYSHEADKEY_FSLABEL, (char*)sb.s_label); // ---- uuid /*if ((str=e2p_uuid2str(sb.s_uuid))!=NULL) dico_add_string(d, 0, FSYSHEADKEY_FSUUID, str);*/ memset(uuid, 0, sizeof(uuid)); uuid_unparse_lower((u8*)sb.s_uuid, uuid); dico_add_string(d, 0, FSYSHEADKEY_FSUUID, uuid); msgprintf(MSG_DEBUG1, "jfs_uuid=[%s]\n", uuid); // ---- minimum fsarchiver version required to restore dico_add_u64(d, 0, FSYSHEADKEY_MINFSAVERSION, FSA_VERSION_BUILD(0, 6, 4, 0)); jfs_getinfo_close: close(fd); jfs_getinfo_return: return ret; } int jfs_mount(char *partition, char *mntbuf, char *fsbuf, int flags, char *mntinfo) { return generic_mount(partition, mntbuf, fsbuf, NULL, flags); } int jfs_umount(char *partition, char *mntbuf) { return generic_umount(mntbuf); } int jfs_test(char *devname) { struct jfs_superblock sb; int fd; if ((fd=open64(devname, O_RDONLY|O_LARGEFILE))<0) return false; if (lseek(fd, JFS_SUPER1_OFF, SEEK_SET)!=JFS_SUPER1_OFF) { close(fd); return false; } if (read(fd, &sb, sizeof(sb))!=sizeof(sb)) { close(fd); return false; } if (strncmp(sb.s_magic, JFS_MAGIC, strlen(JFS_MAGIC)) != 0) { close(fd); return false; } close(fd); return true; } int jfs_get_reqmntopt(char *partition, cstrlist *reqopt, cstrlist *badopt) { if (!reqopt || !badopt) return -1; return 0; } fsarchiver-0.8.4/src/comp_bzip2.c0000644000176100017610000000372613242523705013616 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include "fsarchiver.h" #include "common.h" #include "comp_bzip2.h" #include "error.h" int compress_block_bzip2(u64 origsize, u64 *compsize, u8 *origbuf, u8 *compbuf, u64 compbufsize, int level) { unsigned int destsize=compbufsize; switch (BZ2_bzBuffToBuffCompress((char*)compbuf, &destsize, (char*)origbuf, origsize, 9, 0, 30)) { case BZ_OK: *compsize=(u64)destsize; return FSAERR_SUCCESS; case BZ_MEM_ERROR: errprintf("BZ2_bzBuffToBuffCompress(): BZIP2 compression failed " "with an out of memory error.\nYou should use a lower " "compression level to reduce the memory requirement.\n"); return FSAERR_ENOMEM; default: return FSAERR_UNKNOWN; } return FSAERR_UNKNOWN; } int uncompress_block_bzip2(u64 compsize, u64 *origsize, u8 *origbuf, u64 origbufsize, u8 *compbuf) { unsigned int destsize=origbufsize; int res; switch ((res=BZ2_bzBuffToBuffDecompress((char*)origbuf, &destsize, (char*)compbuf, compsize, 0, 0))) { case BZ_OK: *origsize=(u64)destsize; return FSAERR_SUCCESS; default: errprintf("BZ2_bzBuffToBuffDecompress() failed, res=%d\n", res); return FSAERR_UNKNOWN; } return FSAERR_UNKNOWN; } fsarchiver-0.8.4/src/thread_comp.h0000644000176100017610000000142613242523705014037 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __THREAD_COMP_H__ #define __THREAD_COMP_H__ enum {COMPTHR_COMPRESS=1, COMPTHR_DECOMPRESS=2}; void *thread_comp_fct(void *args); void *thread_decomp_fct(void *args); #endif // __THREAD_COMP_H__ fsarchiver-0.8.4/src/comp_zstd.h0000644000176100017610000000170013242523705013547 00000000000000 /* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __COMPRESS_ZSTD_H__ #define __COMPRESS_ZSTD_H__ #ifdef OPTION_ZSTD_SUPPORT #include int compress_block_zstd(u64 origsize, u64 *compsize, u8 *origbuf, u8 *compbuf, u64 compbufsize, int level); int uncompress_block_zstd(u64 compsize, u64 *origsize, u8 *origbuf, u64 origbufsize, u8 *compbuf); #endif // OPTION_ZSTD_SUPPORT #endif // __COMPRESS_ZSTD_H__ fsarchiver-0.8.4/src/archreader.c0000644000176100017610000004021213242523705013641 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include #include "fsarchiver.h" #include "dico.h" #include "common.h" #include "options.h" #include "archreader.h" #include "queue.h" #include "comp_gzip.h" #include "comp_bzip2.h" #include "error.h" int archreader_init(carchreader *ai) { assert(ai); memset(ai, 0, sizeof(struct s_archreader)); ai->cryptalgo=ENCRYPT_NULL; ai->compalgo=COMPRESS_NULL; ai->fsacomp=-1; ai->complevel=-1; ai->archfd=-1; ai->archid=0; ai->curvol=0; ai->filefmtver=0; ai->hasdirsinfohead=false; return 0; } int archreader_destroy(carchreader *ai) { assert(ai); return 0; } int archreader_open(carchreader *ai) { struct stat64 st; char volhead[64]; int magiclen; assert(ai); // on the archive volume ai->archfd=open64(ai->volpath, O_RDONLY|O_LARGEFILE); if (ai->archfd<0) { sysprintf ("cannot open archive %s\n", ai->volpath); return -1; } // check the archive volume is a regular file if (fstat64(ai->archfd, &st)!=0) { sysprintf("fstat64(%s) failed\n", ai->volpath); return -1; } if (!S_ISREG(st.st_mode)) { errprintf("%s is not a regular file, cannot continue\n", ai->volpath); close(ai->archfd); return -1; } // read file format version and rewind to beginning of the volume if (read(ai->archfd, volhead, sizeof(volhead))!=sizeof(volhead)) { sysprintf("cannot read magic from %s\n", ai->volpath); close(ai->archfd); return -1; } if (lseek64(ai->archfd, 0, SEEK_SET)!=0) { sysprintf("cannot rewind volume %s\n", ai->volpath); close(ai->archfd); return -1; } // interpret magic an get file format version magiclen=strlen(FSA_FILEFORMAT); if ((memcmp(volhead+40, "FsArCh_001", magiclen)==0) || (memcmp(volhead+40, "FsArCh_00Y", magiclen)==0)) { ai->filefmtver=1; } else if (memcmp(volhead+42, "FsArCh_002", magiclen)==0) { ai->filefmtver=2; } else { errprintf("%s is not a supported fsarchiver file format\n", ai->volpath); close(ai->archfd); return -1; } msgprintf(MSG_VERB2, "Detected fileformat=%d in archive %s\n", (int)ai->filefmtver, ai->volpath); return 0; } int archreader_close(carchreader *ai) { assert(ai); if (ai->archfd<0) return -1; lockf(ai->archfd, F_ULOCK, 0); close(ai->archfd); ai->archfd=-1; return 0; } int archreader_volpath(carchreader *ai) { int res; res=get_path_to_volume(ai->volpath, PATH_MAX, ai->basepath, ai->curvol); return res; } int archreader_incvolume(carchreader *ai, bool waitkeypress) { assert(ai); ai->curvol++; return archreader_volpath(ai); } int archreader_read_data(carchreader *ai, void *data, u64 size) { long lres; assert(ai); if ((lres=read(ai->archfd, (char*)data, (long)size))!=(long)size) { sysprintf("read failed: read(size=%ld)=%ld\n", (long)size, lres); return -1; } return 0; } int archreader_read_dico(carchreader *ai, cdico *d) { u16 size; u32 headerlen; u32 origsum; u32 newsum; u8 *buffer; u8 *bufpos; u16 temp16; u32 temp32; u8 section; u16 count; u8 type; u16 key; int i; assert(ai); assert(d); // header-len, header-data, header-checksum switch (ai->filefmtver) { case 1: if (archreader_read_data(ai, &temp16, sizeof(temp16))!=0) { errprintf("imgdisk_read_data() failed\n"); return OLDERR_FATAL; } headerlen=le16_to_cpu(temp16); break; case 2: if (archreader_read_data(ai, &temp32, sizeof(temp32))!=0) { errprintf("imgdisk_read_data() failed\n"); return OLDERR_FATAL; } headerlen=le32_to_cpu(temp32); break; default: errprintf("Fatal error: invalid file format version: ai->filefmtver=%d\n", ai->filefmtver); return OLDERR_FATAL; } bufpos=buffer=malloc(headerlen); if (!buffer) { errprintf("cannot allocate memory for header\n"); return FSAERR_ENOMEM; } if (archreader_read_data(ai, buffer, headerlen)!=0) { errprintf("cannot read header data\n"); free(buffer); return OLDERR_FATAL; } if (archreader_read_data(ai, &temp32, sizeof(temp32))!=0) { errprintf("cannot read header checksum\n"); free(buffer); return OLDERR_FATAL; } origsum=le32_to_cpu(temp32); // check header-data integrity using checksum newsum=fletcher32(buffer, headerlen); if (newsum!=origsum) { errprintf("bad checksum for header\n"); free(buffer); return OLDERR_MINOR; // header corrupt --> skip file } // read count from buffer memcpy(&temp16, bufpos, sizeof(temp16)); bufpos+=sizeof(temp16); count=le16_to_cpu(temp16); // read items for (i=0; i < count; i++) { // a. read type from buffer memcpy(&type, bufpos, sizeof(type)); bufpos+=sizeof(section); // b. read section from buffer memcpy(§ion, bufpos, sizeof(section)); bufpos+=sizeof(section); // c. read key from buffer memcpy(&temp16, bufpos, sizeof(temp16)); bufpos+=sizeof(temp16); key=le16_to_cpu(temp16); // d. read sizeof(data) memcpy(&temp16, bufpos, sizeof(temp16)); bufpos+=sizeof(temp16); size=le16_to_cpu(temp16); // e. add item to dico if (dico_add_generic(d, section, key, bufpos, size, type)!=0) return OLDERR_FATAL; bufpos+=size; } free(buffer); return FSAERR_SUCCESS; } int archreader_read_header(carchreader *ai, char *magic, cdico **d, bool allowseek, u16 *fsid) { s64 curpos; u16 temp16; u32 temp32; u32 archid; int res; assert(ai); assert(d); assert(fsid); // init memset(magic, 0, FSA_SIZEOF_MAGIC); *fsid=FSA_FILESYSID_NULL; *d=NULL; if ((*d=dico_alloc())==NULL) { errprintf("dico_alloc() failed\n"); return OLDERR_FATAL; } // search for next read header marker and magic (it may be further if corruption in archive) if ((curpos=lseek64(ai->archfd, 0, SEEK_CUR))<0) { sysprintf("lseek64() failed to get the current position in archive\n"); return OLDERR_FATAL; } if ((res=archreader_read_data(ai, magic, FSA_SIZEOF_MAGIC))!=FSAERR_SUCCESS) { msgprintf(MSG_STACK, "cannot read header magic: res=%d\n", res); return OLDERR_FATAL; } // we don't want to search for the magic if it's a volume header if (is_magic_valid(magic)!=true && allowseek!=true) { errprintf("cannot read header magic: this is not a valid fsarchiver file, or it has been created with a different version.\n"); return OLDERR_FATAL; } while (is_magic_valid(magic)!=true) { if (lseek64(ai->archfd, curpos++, SEEK_SET)<0) { sysprintf("lseek64(pos=%lld, SEEK_SET) failed\n", (long long)curpos); return OLDERR_FATAL; } if ((res=archreader_read_data(ai, magic, FSA_SIZEOF_MAGIC))!=FSAERR_SUCCESS) { msgprintf(MSG_STACK, "cannot read header magic: res=%d\n", res); return OLDERR_FATAL; } } // read the archive id if ((res=archreader_read_data(ai, &temp32, sizeof(temp32)))!=FSAERR_SUCCESS) { msgprintf(MSG_STACK, "cannot read archive-id in header: res=%d\n", res); return OLDERR_FATAL; } archid=le32_to_cpu(temp32); if (ai->archid) // only check archive-id if it's known (when main header has been read) { if (archid!=ai->archid) { errprintf("archive-id in header does not match: archid=[%.8x], expected=[%.8x]\n", archid, ai->archid); return OLDERR_MINOR; } } // read the filesystem id if ((res=archreader_read_data(ai, &temp16, sizeof(temp16)))!=FSAERR_SUCCESS) { msgprintf(MSG_STACK, "cannot read filesystem-id in header: res=%d\n", res); return OLDERR_FATAL; } *fsid=le16_to_cpu(temp16); // read the dico of the header if ((res=archreader_read_dico(ai, *d))!=FSAERR_SUCCESS) { msgprintf(MSG_STACK, "imgdisk_read_dico() failed\n"); return res; } return FSAERR_SUCCESS; } int archreader_read_volheader(carchreader *ai) { char creatver[FSA_MAX_PROGVERLEN]; char filefmt[FSA_MAX_FILEFMTLEN]; char magic[FSA_SIZEOF_MAGIC]; cdico *d; u32 volnum; u32 readid; u16 fsid; int res; int ret=0; // init assert(ai); memset(magic, 0, sizeof(magic)); // ---- a. read header from archive file if ((res=archreader_read_header(ai, magic, &d, false, &fsid))!=FSAERR_SUCCESS) { errprintf("archreader_read_header() failed to read the archive header\n"); return -1; } // ---- b. check the magic is what we expected if (strncmp(magic, FSA_MAGIC_VOLH, FSA_SIZEOF_MAGIC)!=0) { errprintf("magic is not what we expected: found=[%s] and expected=[%s]\n", magic, FSA_MAGIC_VOLH); ret=-1; goto archio_read_volheader_error; } if (dico_get_u32(d, 0, VOLUMEHEADKEY_ARCHID, &readid)!=0) { errprintf("cannot get VOLUMEHEADKEY_ARCHID from the volume header\n"); ret=-1; goto archio_read_volheader_error; } // ---- c. check the archive id if (ai->archid==0) // archid not know: this is the first volume { ai->archid=readid; } else if (readid!=ai->archid) // archid known: not the first volume { errprintf("wrong header id: found=%.8x and expected=%.8x\n", readid, ai->archid); ret=-1; goto archio_read_volheader_error; } // ---- d. check the volnum if (dico_get_u32(d, 0, VOLUMEHEADKEY_VOLNUM, &volnum)!=0) { errprintf("cannot get VOLUMEHEADKEY_VOLNUM from the volume header\n"); ret=-1; goto archio_read_volheader_error; } if (volnum!=ai->curvol) // not the right volume number { errprintf("wrong volume number in [%s]: volnum is %d and we need volnum %d\n", ai->volpath, (int)volnum, (int)ai->curvol); ret=-1; goto archio_read_volheader_error; } // ---- d. check the the file format if (dico_get_data(d, 0, VOLUMEHEADKEY_FILEFORMATVER, filefmt, FSA_MAX_FILEFMTLEN, NULL)!=0) { errprintf("cannot find VOLUMEHEADKEY_FILEFORMATVER in main-header\n"); ret=-1; goto archio_read_volheader_error; } if (ai->filefmt[0]==0) // filefmt not know: this is the first volume { memcpy(ai->filefmt, filefmt, FSA_MAX_FILEFMTLEN); } else if (strncmp(filefmt, ai->filefmt, FSA_MAX_FILEFMTLEN)!=0) { errprintf("This archive is based on a different file format: [%s]. Cannot continue.\n", ai->filefmt); errprintf("It has been created with fsarchiver [%s], you should extrat the archive using that version.\n", ai->creatver); errprintf("The current version of the program is [%s], and it's based on format [%s]\n", FSA_VERSION, FSA_FILEFORMAT); ret=-1; goto archio_read_volheader_error; } if (dico_get_data(d, 0, VOLUMEHEADKEY_PROGVERCREAT, creatver, FSA_MAX_PROGVERLEN, NULL)!=0) { errprintf("cannot find VOLUMEHEADKEY_PROGVERCREAT in main-header\n"); ret=-1; goto archio_read_volheader_error; } if (ai->creatver[0]==0) memcpy(ai->creatver, creatver, FSA_MAX_PROGVERLEN); archio_read_volheader_error: dico_destroy(d); return ret; } int archreader_read_block(carchreader *ai, cdico *in_blkdico, int in_skipblock, int *out_sumok, struct s_blockinfo *out_blkinfo) { u32 arblockcsumorig; u32 arblockcsumcalc; u32 curblocksize; // data size u64 blockoffset; // offset of the block in the file u16 compalgo; // compression algo used u16 cryptalgo; // encryption algo used u32 finalsize; // compressed block size u32 compsize; u8 *buffer; assert(ai); assert(out_sumok); assert(in_blkdico); assert(out_blkinfo); // init memset(out_blkinfo, 0, sizeof(struct s_blockinfo)); *out_sumok=-1; if (dico_get_u64(in_blkdico, 0, BLOCKHEADITEMKEY_BLOCKOFFSET, &blockoffset)!=0) { msgprintf(3, "cannot get blockoffset from block-header\n"); return -1; } if (dico_get_u32(in_blkdico, 0, BLOCKHEADITEMKEY_REALSIZE, &curblocksize)!=0 || curblocksize>FSA_MAX_BLKSIZE) { msgprintf(3, "cannot get blocksize from block-header\n"); return -1; } if (dico_get_u16(in_blkdico, 0, BLOCKHEADITEMKEY_COMPRESSALGO, &compalgo)!=0) { msgprintf(3, "cannot get BLOCKHEADITEMKEY_COMPRESSALGO from block-header\n"); return -1; } if (dico_get_u16(in_blkdico, 0, BLOCKHEADITEMKEY_ENCRYPTALGO, &cryptalgo)!=0) { msgprintf(3, "cannot get BLOCKHEADITEMKEY_ENCRYPTALGO from block-header\n"); return -1; } if (dico_get_u32(in_blkdico, 0, BLOCKHEADITEMKEY_ARSIZE, &finalsize)!=0) { msgprintf(3, "cannot get BLOCKHEADITEMKEY_ARSIZE from block-header\n"); return -1; } if (dico_get_u32(in_blkdico, 0, BLOCKHEADITEMKEY_COMPSIZE, &compsize)!=0) { msgprintf(3, "cannot get BLOCKHEADITEMKEY_COMPSIZE from block-header\n"); return -1; } if (dico_get_u32(in_blkdico, 0, BLOCKHEADITEMKEY_ARCSUM, &arblockcsumorig)!=0) { msgprintf(3, "cannot get BLOCKHEADITEMKEY_ARCSUM from block-header\n"); return -1; } if (in_skipblock==true) // the main thread does not need that block (block belongs to a filesys we want to skip) { if (lseek64(ai->archfd, (long)finalsize, SEEK_CUR)<0) { sysprintf("cannot skip block (finalsize=%ld) failed\n", (long)finalsize); return -1; } return 0; } // ---- allocate memory if ((buffer=malloc(finalsize))==NULL) { errprintf("cannot allocate block: malloc(%d) failed\n", finalsize); return FSAERR_ENOMEM; } if (read(ai->archfd, buffer, (long)finalsize)!=(long)finalsize) { sysprintf("cannot read block (finalsize=%ld) failed\n", (long)finalsize); free(buffer); return -1; } // prepare blkinfo out_blkinfo->blkdata=(char*)buffer; out_blkinfo->blkrealsize=curblocksize; out_blkinfo->blkoffset=blockoffset; out_blkinfo->blkarcsum=arblockcsumorig; out_blkinfo->blkcompalgo=compalgo; out_blkinfo->blkcryptalgo=cryptalgo; out_blkinfo->blkarsize=finalsize; out_blkinfo->blkcompsize=compsize; // ---- checksum arblockcsumcalc=fletcher32(buffer, finalsize); if (arblockcsumcalc!=arblockcsumorig) // bad checksum { errprintf("block is corrupt at offset=%ld, blksize=%ld\n", (long)blockoffset, (long)curblocksize); free(out_blkinfo->blkdata); if ((out_blkinfo->blkdata=malloc(curblocksize))==NULL) { errprintf("cannot allocate block: malloc(%d) failed\n", curblocksize); return FSAERR_ENOMEM; } memset(out_blkinfo->blkdata, 0, curblocksize); *out_sumok=false; // go to the beginning of the corrupted contents so that the next header is searched here if (lseek64(ai->archfd, -(long long)finalsize, SEEK_CUR)<0) { errprintf("lseek64() failed\n"); } } else // no corruption detected { *out_sumok=true; } return 0; } fsarchiver-0.8.4/src/fs_jfs.h0000644000176100017610000001105613242523705013024 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __FS_JFS_H__ #define __FS_JFS_H__ struct s_dico; struct s_strlist; int jfs_mkfs(struct s_dico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid); int jfs_getinfo(struct s_dico *d, char *devname); int jfs_mount(char *partition, char *mntbuf, char *fsbuf, int flags, char *mntinfo); int jfs_get_reqmntopt(char *partition, struct s_strlist *reqopt, struct s_strlist *badopt); int jfs_umount(char *partition, char *mntbuf); int jfs_test(char *devname); // make the magic number something a human could read #define JFS_MAGIC "JFS1" /* Magic word */ #define LV_NAME_SIZE 11 /* MUST BE 11 for OS/2 boot sector */ #define JFS_SUPER1_OFF 0x8000 /* primary superblock */ /* * physical xd (pxd) */ typedef struct { unsigned len:24; unsigned addr1:8; u32 addr2; } pxd_t; /* * Almost identical to Linux's timespec, but not quite */ struct timestruc_t { u32 tv_sec; u32 tv_nsec; }; /* * aggregate superblock * * The name superblock is too close to super_block, so the name has been * changed to jfs_superblock. The utilities are still using the old name. */ struct jfs_superblock { char s_magic[4]; /* 4: magic number */ u32 s_version; /* 4: version number */ u64 s_size; /* 8: aggregate size in hardware/LVM blocks; * VFS: number of blocks */ u32 s_bsize; /* 4: aggregate block size in bytes; * VFS: fragment size */ u16 s_l2bsize; /* 2: log2 of s_bsize */ u16 s_l2bfactor; /* 2: log2(s_bsize/hardware block size) */ u32 s_pbsize; /* 4: hardware/LVM block size in bytes */ u16 s_l2pbsize; /* 2: log2 of s_pbsize */ u16 pad; /* 2: padding necessary for alignment */ u32 s_agsize; /* 4: allocation group size in aggr. blocks */ u32 s_flag; /* 4: aggregate attributes: * see jfs_filsys.h */ u32 s_state; /* 4: mount/unmount/recovery state: * see jfs_filsys.h */ u32 s_compress; /* 4: > 0 if data compression */ pxd_t s_ait2; /* 8: first extent of secondary * aggregate inode table */ pxd_t s_aim2; /* 8: first extent of secondary * aggregate inode map */ u32 s_logdev; /* 4: device address of log */ u32 s_logserial; /* 4: log serial number at aggregate mount */ pxd_t s_logpxd; /* 8: inline log extent */ pxd_t s_fsckpxd; /* 8: inline fsck work space extent */ struct timestruc_t s_time; /* 8: time last updated */ u32 s_fsckloglen; /* 4: Number of filesystem blocks reserved for * the fsck service log. * N.B. These blocks are divided among the * versions kept. This is not a per * version size. * N.B. These blocks are included in the * length field of s_fsckpxd. */ s8 s_fscklog; /* 1: which fsck service log is most recent * 0 => no service log data yet * 1 => the first one * 2 => the 2nd one */ char s_fpack[11]; /* 11: file system volume name * N.B. This must be 11 bytes to * conform with the OS/2 BootSector * requirements * Only used when s_version is 1 */ /* extendfs() parameter under s_state & FM_EXTENDFS */ u64 s_xsize; /* 8: extendfs s_size */ pxd_t s_xfsckpxd; /* 8: extendfs fsckpxd */ pxd_t s_xlogpxd; /* 8: extendfs logpxd */ /* - 128 byte boundary - */ char s_uuid[16]; /* 16: 128-bit uuid for volume */ char s_label[16]; /* 16: volume label */ char s_loguuid[16]; /* 16: 128-bit uuid for log device */ }; #endif // __FS_JFS_H__ fsarchiver-0.8.4/src/fs_reiserfs.h0000644000176100017610000000646413242523705014073 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifndef __FS_REISERFS_H__ #define __FS_REISERFS_H__ struct s_dico; struct s_strlist; int reiserfs_mkfs(struct s_dico *d, char *partition, char *fsoptions, char *mkfslabel, char *mkfsuuid); int reiserfs_getinfo(struct s_dico *d, char *devname); int reiserfs_mount(char *partition, char *mntbuf, char *fsbuf, int flags, char *mntinfo); int reiserfs_get_reqmntopt(char *partition, struct s_strlist *reqopt, struct s_strlist *badopt); int reiserfs_umount(char *partition, char *mntbuf); int reiserfs_test(char *devname); #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs" #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" #define REISER4FS_SUPER_MAGIC_STRING "ReIsEr4" #define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024) struct reiserfs_super_block_v1 { u32 s_block_count; /* blocks count */ u32 s_free_blocks; /* free blocks count */ u32 s_root_block; /* root block number */ u32 s_journal_block; /* journal block number */ u32 s_journal_dev; /* journal device number */ u32 s_orig_journal_size; /* size of the journal on FS creation. used to make sure they don't overflow it */ u32 s_journal_trans_max ; /* max number of blocks in a transaction. */ u32 s_journal_block_count ; /* total size of the journal. can change over time */ u32 s_journal_max_batch ; /* max number of blocks to batch into a trans */ u32 s_journal_max_commit_age ; /* in seconds, how old can an async commit be */ u32 s_journal_max_trans_age ; /* in seconds, how old can a transaction be */ u16 s_blocksize; /* block size */ u16 s_oid_maxsize; /* max size of object id array, see get_objectid() commentary */ u16 s_oid_cursize; /* current size of object id array */ u16 s_state; /* valid or error */ char s_magic[12]; /* reiserfs magic string indicates that file system is reiserfs */ u32 s_hash_function_code; /* indicate, what hash fuction is being use to sort names in a directory*/ u16 s_tree_height; /* height of disk tree */ u16 s_bmap_nr; /* amount of bitmap blocks needed to address each block of file system */ u16 s_reserved; } __attribute__ ((__packed__)); struct reiserfs_super_block { struct reiserfs_super_block_v1 s_v1; u32 s_inode_generation; u32 s_flags; /* Right now used only by inode-attributes, if enabled */ unsigned char s_uuid[16]; /* filesystem unique identifier */ unsigned char s_label[16]; /* filesystem volume label */ char s_unused[88]; /* padding and reserved */ }; #endif // __FS_REISERFS_H__ fsarchiver-0.8.4/src/Makefile.am0000644000176100017610000000332713242523605013436 00000000000000sbin_PROGRAMS = fsarchiver fsarchiver_SOURCES = fsarchiver.c oper_save.c oper_restore.c oper_probe.c \ thread_archio.c archreader.c archwriter.c writebuf.c archinfo.c \ thread_comp.c comp_gzip.c comp_bzip2.c comp_lzma.c comp_lzo.c comp_lz4.c \ comp_zstd.c crypto.c fs_ntfs.c fs_ext2.c fs_reiserfs.c fs_reiser4.c \ fs_btrfs.c fs_xfs.c fs_jfs.c fs_vfat.c common.c dico.c strdico.c dichl.c \ queue.c error.c syncthread.c datafile.c strlist.c regmulti.c options.c \ logfile.c filesys.c devinfo.c noinst_HEADERS = fsarchiver.h oper_save.h oper_restore.h oper_probe.h \ thread_archio.h archreader.h archwriter.h writebuf.h archinfo.h \ thread_comp.h comp_gzip.h comp_bzip2.h comp_lzma.h comp_lzo.h comp_lz4.h \ comp_zstd.h crypto.h fs_ntfs.h fs_ext2.h fs_reiserfs.h fs_reiser4.h \ fs_btrfs.h fs_xfs.h fs_jfs.h fs_vfat.h common.h dico.h strdico.h dichl.h \ queue.h error.h syncthread.h datafile.h strlist.h regmulti.h options.h \ logfile.h types.h filesys.h devinfo.h fsarchiver_LDADD = -lpthread -lrt \ $(LZMA_LIBS) \ $(EXT2FS_LIBS) \ $(COM_ERR_LIBS) \ $(E2P_LIBS) \ $(BLKID_LIBS) \ $(UUID_LIBS) fsarchiver_CFLAGS = @CFLAGS@ -Wall -std=gnu99 -rdynamic -ggdb \ $(LZMA_CFLAGS) \ $(EXT2FS_CFLAGS) \ $(COM_ERR_CFLAGS) \ $(E2P_CFLAGS) \ $(BLKID_CFLAGS) \ $(UUID_CFLAGS) fsarchiver_LDFLAGS = @FSARCHIVER_LDFLAGS@ DEFS=@DEFS@ -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_GNU_SOURCE MAINTAINERCLEANFILES = Makefile.in fsarchiver-0.8.4/src/archinfo.c0000644000176100017610000001254013242523705013335 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include "fsarchiver.h" #include "dico.h" #include "common.h" #include "archinfo.h" #include "archreader.h" #include "error.h" char *compalgostr(int algo) { switch (algo) { case COMPRESS_NONE: return "none"; case COMPRESS_LZO: return "lzo"; case COMPRESS_GZIP: return "gzip"; case COMPRESS_BZIP2: return "bzip2"; case COMPRESS_LZMA: return "lzma"; case COMPRESS_LZ4: return "lz4"; case COMPRESS_ZSTD: return "zstd"; default: return "unknown"; } } char *cryptalgostr(int algo) { switch (algo) { case ENCRYPT_NONE: return "none"; case ENCRYPT_BLOWFISH: return "blowfish"; default: return "unknown"; } } int archinfo_show_mainhead(carchreader *ai, cdico *dicomainhead) { char buffer[256]; if (!ai || !dicomainhead) { errprintf("a parameter is null\n"); return -1; } msgprintf(MSG_FORCE, "====================== archive information ======================\n"); msgprintf(MSG_FORCE, "Archive type: \t\t\t%s\n", (ai->archtype==ARCHTYPE_FILESYSTEMS)?"filesystems":"flat files"); if ((ai->archtype==ARCHTYPE_FILESYSTEMS)) msgprintf(0, "Filesystems count: \t\t%ld\n", (long)ai->fscount); msgprintf(MSG_FORCE, "Archive id: \t\t\t%.8x\n", (unsigned int)ai->archid); msgprintf(MSG_FORCE, "Archive file format: \t\t%s\n", ai->filefmt); msgprintf(MSG_FORCE, "Archive created with: \t\t%s\n", ai->creatver); msgprintf(MSG_FORCE, "Archive creation date: \t\t%s\n", format_time(buffer, sizeof(buffer), ai->creattime)); msgprintf(MSG_FORCE, "Archive label: \t\t\t%s\n", ai->label); if (ai->minfsaver > 0) // fsarchiver < 0.6.7 had no per-archive minfsaver version requirement msgprintf(MSG_FORCE, "Minimum fsarchiver version:\t%d.%d.%d.%d\n", (int)FSA_VERSION_GET_A(ai->minfsaver), (int)FSA_VERSION_GET_B(ai->minfsaver), (int)FSA_VERSION_GET_C(ai->minfsaver), (int)FSA_VERSION_GET_D(ai->minfsaver)); msgprintf(MSG_FORCE, "Compression level: \t\t%d (%s level %d)\n", ai->fsacomp, compalgostr(ai->compalgo), ai->complevel); msgprintf(MSG_FORCE, "Encryption algorithm: \t\t%s\n", cryptalgostr(ai->cryptalgo)); msgprintf(MSG_FORCE, "\n"); return 0; } int archinfo_show_fshead(cdico *dicofshead, int fsid) { char magic[FSA_SIZEOF_MAGIC+1]; char fsbuf[FSA_MAX_FSNAMELEN]; u64 temp64; u64 fsbytestotal; u64 fsbytesused; char buffer[256]; char fslabel[256]; char fsuuid[256]; char fsorigdev[256]; // init memset(magic, 0, sizeof(magic)); if (!dicofshead) { errprintf("dicofshead is null\n"); return -1; } if (dico_get_data(dicofshead, 0, FSYSHEADKEY_FILESYSTEM, fsbuf, sizeof(fsbuf), NULL)!=0) { errprintf("cannot find FSYSHEADKEY_FILESYSTEM in filesystem-header\n"); return -1; } if (dico_get_u64(dicofshead, 0, FSYSHEADKEY_BYTESTOTAL, &fsbytestotal)!=0) { errprintf("cannot find FSYSHEADKEY_BYTESTOTAL in filesystem-header\n"); return -1; } if (dico_get_u64(dicofshead, 0, FSYSHEADKEY_BYTESUSED, &fsbytesused)!=0) { errprintf("cannot find FSYSHEADKEY_BYTESUSED in filesystem-header\n"); return -1; } if (dico_get_string(dicofshead, 0, FSYSHEADKEY_FSLABEL, fslabel, sizeof(fslabel))<0) snprintf(fslabel, sizeof(fslabel), ""); if (dico_get_string(dicofshead, 0, FSYSHEADKEY_ORIGDEV, fsorigdev, sizeof(fsorigdev))<0) snprintf(fsorigdev, sizeof(fsorigdev), ""); // filesystem uuid: maybe an ntfs uuid or an unix uuid snprintf(fsuuid, sizeof(fsuuid), ""); if (dico_get_u64(dicofshead, 0, FSYSHEADKEY_NTFSUUID, &temp64)==0) snprintf(fsuuid, sizeof(fsuuid), "%016llX", (long long unsigned int)temp64); else if (dico_get_string(dicofshead, 0, FSYSHEADKEY_FSUUID, buffer, sizeof(buffer))==0 && strlen(buffer)==36) snprintf(fsuuid, sizeof(fsuuid), "%s", buffer); msgprintf(MSG_FORCE, "===================== filesystem information ====================\n"); msgprintf(MSG_FORCE, "Filesystem id in archive: \t%ld\n", (long)fsid); msgprintf(MSG_FORCE, "Filesystem format: \t\t%s\n", fsbuf); msgprintf(MSG_FORCE, "Filesystem label: \t\t%s\n", fslabel); msgprintf(MSG_FORCE, "Filesystem uuid: \t\t%s\n", fsuuid); msgprintf(MSG_FORCE, "Original device: \t\t%s\n", fsorigdev); msgprintf(MSG_FORCE, "Original filesystem size: \t%s (%lld bytes)\n", format_size(fsbytestotal, buffer, sizeof(buffer), 'h'), (long long)fsbytestotal); msgprintf(MSG_FORCE, "Space used in filesystem: \t%s (%lld bytes)\n", format_size(fsbytesused, buffer, sizeof(buffer), 'h'), (long long)fsbytesused); msgprintf(MSG_FORCE, "\n"); return 0; } fsarchiver-0.8.4/src/crypto.c0000644000176100017610000000556313242523705013073 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include "fsarchiver.h" #include "common.h" #include "crypto.h" #include "error.h" #include // required for safety with multi-threading in gcrypt GCRY_THREAD_OPTION_PTHREAD_IMPL; int crypto_init() { // init gcrypt for multi-threading gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); // check that header files and library match if (!gcry_check_version(FSA_GCRYPT_VERSION)) { errprintf("libgcrypt version mismatch\n"); return -1; } // disable secure memory gcry_control(GCRYCTL_DISABLE_SECMEM, 0); // tell libgcrypt that initialization has completed. gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); return 0; } int crypto_cleanup() { return 0; } int crypto_blowfish(u64 insize, u64 *outsize, u8 *inbuf, u8 *outbuf, u8 *password, int passlen, int enc) { gcry_cipher_hd_t hd; u8 iv[] = "fsarchiv"; int res; // init if ((password==NULL) || (passlen==0)) return -1; if ((res=gcry_cipher_open(&hd, GCRY_CIPHER_BLOWFISH, GCRY_CIPHER_MODE_CFB, GCRY_CIPHER_SECURE))!=0) { errprintf("gcry_cipher_open() failed\n"); gcry_cipher_close(hd); return -1; } if ((res=gcry_cipher_setkey(hd, password, passlen))!=0) { errprintf("gcry_cipher_setkey() failed\n"); gcry_cipher_close(hd); return -1; } if (gcry_cipher_setiv(hd, iv, strlen((char*)iv))) { errprintf("gcry_cipher_setiv() failed\n"); gcry_cipher_close(hd); return -1; } switch(enc) { case 1: // encrypt res=gcry_cipher_encrypt(hd, outbuf, insize, inbuf, insize); break; case 0: // decrypt res=gcry_cipher_decrypt(hd, outbuf, insize, inbuf, insize); break; default: // invalid errprintf("invalid parameter: enc=%d\n", (int)enc); gcry_cipher_close(hd); return -1; } gcry_cipher_close(hd); *outsize=insize; return (res==0)?(0):(-1); } int crypto_random(u8 *buf, int bufsize) { memset(buf, 0, bufsize); gcry_randomize(buf, bufsize, GCRY_STRONG_RANDOM); return 0; } fsarchiver-0.8.4/src/fsarchiver.c0000644000176100017610000005203213242523705013700 00000000000000/* * fsarchiver: Filesystem Archiver * * Copyright (C) 2008-2018 Francois Dupoux. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * Homepage: http://www.fsarchiver.org */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include "fsarchiver.h" #include "dico.h" #include "common.h" #include "oper_restore.h" #include "oper_save.h" #include "oper_probe.h" #include "archinfo.h" #include "syncthread.h" #include "comp_lzo.h" #include "comp_lz4.h" #include "crypto.h" #include "options.h" #include "logfile.h" #include "error.h" #include "queue.h" char *valid_magic[]={FSA_MAGIC_MAIN, FSA_MAGIC_VOLH, FSA_MAGIC_VOLF, FSA_MAGIC_FSIN, FSA_MAGIC_FSYB, FSA_MAGIC_DATF, FSA_MAGIC_OBJT, FSA_MAGIC_BLKH, FSA_MAGIC_FILF, FSA_MAGIC_DIRS, NULL}; void usage(char *progname, bool examples) { int lzo, lzma, lz4, zstd; #ifdef OPTION_LZO_SUPPORT lzo=true; #else lzo=false; #endif // OPTION_LZO_SUPPORT #ifdef OPTION_LZMA_SUPPORT lzma=true; #else lzma=false; #endif // OPTION_LZMA_SUPPORT #ifdef OPTION_LZ4_SUPPORT lz4=true; #else lz4=false; #endif // OPTION_lZ4_SUPPORT #ifdef OPTION_ZSTD_SUPPORT zstd=true; #else zstd=false; #endif // OPTION_ZSTD_SUPPORT msgprintf(MSG_FORCE, "====> fsarchiver version %s (%s) - http://www.fsarchiver.org <====\n", FSA_VERSION, FSA_RELDATE); msgprintf(MSG_FORCE, "Distributed under the GPL v2 license (GNU General Public License v2).\n"); msgprintf(MSG_FORCE, " * usage: %s [] [ [ [...]]]\n", progname); msgprintf(MSG_FORCE, "\n"); msgprintf(MSG_FORCE, " * savefs: save filesystems to an archive file (backup a device to a file)\n"); msgprintf(MSG_FORCE, " * restfs: restore filesystems from an archive (overwrites the existing data)\n"); msgprintf(MSG_FORCE, " * savedir: save directories to the archive (similar to a compressed tarball)\n"); msgprintf(MSG_FORCE, " * restdir: restore data from an archive which is not based on a filesystem\n"); msgprintf(MSG_FORCE, " * archinfo: show information about an existing archive file and its contents\n"); msgprintf(MSG_FORCE, " * probe [detailed]: show list of filesystems detected on the disks\n"); msgprintf(MSG_FORCE, "\n"); msgprintf(MSG_FORCE, " -o: overwrite the archive if it already exists instead of failing\n"); msgprintf(MSG_FORCE, " -v: verbose mode (can be used several times to increase the level of details)\n"); msgprintf(MSG_FORCE, " -d: debug mode (can be used several times to increase the level of details)\n"); msgprintf(MSG_FORCE, " -A: allow to save a filesystem which is mounted in read-write (live backup)\n"); msgprintf(MSG_FORCE, " -a: allow to save a filesystem when acls and xattrs are not supported\n"); msgprintf(MSG_FORCE, " -x: enable support for experimental features (they are disabled by default)\n"); msgprintf(MSG_FORCE, " -e : exclude files and directories that match that pattern\n"); msgprintf(MSG_FORCE, " -L