The fallocate() interface on 32-bit machines is defined to use off_t,
not loff_t (even though the system call interface is 64-bit clean).
This causes e4defrag to fail on files greater than 2GB. Fix this by
trying to use fallocate64(), and using the hard-coded syscall if it
does not exist.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
These options allow e2fsprogs to be built using symlinks instead of
hard links, and to be installed using symlinks instead of hard links,
respectively.
Addresses-Sourceforge-Bug: #1436294
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
In autoconf 2.64, if AC_CHECK_LIB is first used in a conditional that
evaluates to false, the helper function ac_fn_c_try_link gets defined
inside that conditional, and then subsequent attempts to use
ac_fn_c_try_link() will blow up. Work around this by moving an
unconditional use of AC_CHECK_LIB to the beginning of configure.in.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
I think vim <esc>wq turned into <esc>2wq or something; in any case
blkid_probe_get_topology2 is not the right thing to search for.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Handle automatic selection of stride/stripe:
mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=16 blocks, Stripe width=32 blocks
...
And warn on block device misalignment:
mke2fs 1.41.9 (22-Aug-2009)
/dev/sdc1 alignment is offset by 32256 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Proceed anyway? (y,n)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Remove the configure options --with-cc, --with-ccopts, --with-ldopts,
and --with-ld (which never worked), since the first three can be
replaced with CC=, CCFLAGS=, and LDFLAGS= on the configure
command-line. The default for --with-cc caused the CC= to be
overridden even with it was specified to the configure script.
Addresses-Sourceforge-Bug: #2843248
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e4defrag.c had a lot of stuff copied into it from other
places, redefinitions of existing interfaces, etc.
We should be able to remove most of this, as the tool only
works on recent kernels anyway, we should just pick up
definitions from recent kernel headers whenever possible.
I've left the local definitions of fallocate, fadvise
(changed to posix_fadvise) and sync_file_range, and
wrapped them in #ifdef configure-time tests - though
really it seems like only fallocate should be necessary
by now, and perhaps the others can be dropped.
We still need some Makefile work so that it won't try to
build e4defrag if the right pieces aren't there (and
if the local definitions won't work...)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
These were found necessary to build on FreeBSD 6.4.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If gmake is available, the developer can use "make V=1" instead of
using a configure-time switch, --enable-verbose-makecmds, to see all
of the commands executed by the Makefile.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Some people don't want to see the concise "kernel-style" make output.
This configure option allows build engines that want to see the full
set of commands executed by the makefile to get what they want. Most
people will find this more distracting than useful, unless they need
to debug the Makefiles.
(It is not necessary to rerun configure to enable this verbose make
output temprarily; if a developer wants to do a quick debug of a
directory's makefile, he or she can simply edit the definition of the
$(E) and $(Q) variables in the Makefile; instructions can be found in
the MCONFIG file which is included in at the beginning of every
Makefile.)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Add an option to switch between the private (in-tree) libuuid and
public (in-system installed) library. The private version is still
enabled by default.
Signed-off-by: Scott James Remnant <scott@netsplit.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Add an option to switch between the private (in-tree) libblkid and
public (in-system installed) library. The private version is still
enabled by default.
If --disable-libblkid is specified the findfs(8) program, which is a
variant of tune2fs, is also not built or installed.
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This avoids problems when the calling program has open file
descriptors (especially sockets) open.
Also fix up some warn_unused_result warnings from gcc.
Addresses-Launchpad-bug: #305057
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
SuSE has been carrying a patch for a long time to prevent a largely
theoretical race condition if a multi-threaded application adds and
removes error tables in multiple threads. Unfortunately SuSE's
approach breaks compatibility by forcing applications to link and
compile with the -pthread option; using pthread mutexes has
historically been problematic.
This commit fixes things in a more portable way by using
sem_post/sem_wait instead, which is an older interface that doesn't
require the pthreads library. Linux happens to implement
sem_post/sem_init using futexes, and -lrt ends up pulling in
-lpthread, but the advantage of using POSIX semaphores is that
applications don't have to be built using -pthread, unlike the use of
pthread mutexes.
The add_error_table() and remove_error_table() interfaces are the
preferred interfaces and locking protection have been added to only
these interfaces. I have not added locking protection to the
generated initialize_xxx_error_table and initialize_xxx_error_table_r
interfaces, to avoid adding symbol dependencies that would cause a
library to fail to work when linking against older com_err libraries
that do not export et_list_lock() and et_list_unlock(). Threaded
applications shouldn't be using these interfaces in any case.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Pass in -rpath-link option to the linker so that blkid will build
correctly on systems that don't have libcom_err.so.2 installed.
Fix debugfs to only try to link with -ldl when building without shared
libraries; with ELF shared libraries, the library which requires -ldl
(libss.so) can required the library dependency itself.
Fix how we build tune2fs.static so that we use @LDFLAG_STATIC@, via
$(LDFLAGS_STATIC), instead of hard-coding the use of -static.
Addresses-Sourceforge-Bug: #2088537
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Test I/O debugging is incredibly useful for rooting out problems, so
let's enable by default, especially now that its overhead is only
incurred when it is needed.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If the --with-ldopts option is not passed on the command line, respect
the LDFLAGS environment variable instead of forcing LDFLAGS to be
unset. "configure --help" documents LDFLAGS as part of the standard
configure script calling convention.
Addresses-Sourceforge-Feature-Request: #1937287
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This gives us standard behavior when using flags such as --quiet, and
gives us standard warning output when showing warnings and errors.
Addresses-Sourceforge-Patches: #2058794
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Also accessed via -o list, this new output format is much more
user-friendly and lists whether or not a particular device is mounted.
Addresses-Debian-Bug #490527
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The public header files depend on the the autoconf defines
WORDS_BIGENDIAN and HAVE_SYS_TYPES_H, so we add them to ext2_types.h
so that external programs which try to use ext2fs_swap*() will work
correctly on big-endian systems. Fortunately, few if any programs
need to use this libext2's byte-swap functions directly.
Addresses-Debian-Bug: #484879
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Since version 2.50 autoconf fully supports checking sizes of types
(with AC_CHECK_SIZEOF) when cross-compiling. Therefore there is no
need to preset the respective cache variables anymore. The following
patch removes the special case. There is no need to adjust AC_PREREQ
as it's set to 2.50 already.
Tested successfully cross-building for the mips64el-linux-gnu host on
an i386-linux-gnu build system, removing the following warning
(because of a mismatch for the "long" type):
Sizeof(__U64__TYPEDEF) is 4 should be 8
Problem detected with asm_types.h
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
DJGPP lacks sys/select.h and sys/un.h; add header checks to be more
portable.
Signed-off-by: Christophe Grenier <grenier@cgsecurity.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Some systems don't have the 'dc' command installed, and this causes
configure to print a warning message unnecessarily for a standard
(non-WIP and non-pre) release of e2fsprogs.
It's easy enough to avoid this problem, so let's do it.
Addresses-Sourceforge-Bug: #1893024
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Also removed the --enable-dynamic-static configure option.
Unfortunately the usefulness of building e2fsck statically is gone on
all modern distributions, since everything else on the system is built
dynamically these days. In fact on some distributions it is almost
impossible to build programs statically any more.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Apparently Mac OS 10.5 defines fstat64(), but not ftruncate64(),
causing resize2fs to fail to build. So check explicitly for
ftruncate64(), and fall back to ftruncate() if necessary.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If the user specifies as arguments to configure --bindir, --sbindir,
--libdir, or --sysconfdir, then set corresponding $root_FOO variable,
so that the request from the user to set a specific --sbindir is
honored.
Addresses-Sourceforge-Bug: 498381
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fedora and Red Hat puts the devmapper library in different locations
compared to Debian, so we use pkg-config. Unfortunately Debian's
devmapper.pc file is buggy (See Debian Bug #390243), so we have to
work around it.
Historically, e2fsprogs has tried not to depend on pkg-config, since
its answers are so often **wrong** (the Debian bug has been ignored
for over a year), so I'm hoping I'm not going to regret this.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
When compiling with dietlibc, sys/syscall.h isn't supported; as of
dietlibc 0.30, it exists but it references a non-existent asm/unistd.h
header file. So we have to test for its existence and avoid using it
in lib/uuid/gen_uuid.c if it is not supported.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>