Karel Zak [Mon, 16 Feb 2009 09:40:25 +0000 (10:40 +0100)]
build-sys: add temporary libtool *.m4 stuff
We require libtool-2 (because old 1.5.x is crap). Unfortunately,
libtool-2 is still not available in many Linux distributions -- now I
see it in unstable distributions only. The painless way how to resolve
this problem is to __temporary__ commit generated libtool-2 stuff to
our repository.
Karel Zak [Tue, 10 Feb 2009 16:20:11 +0000 (17:20 +0100)]
blkid: start to use ABI versioning
The library ABI and API is backwardly compatible, so it does not
make sense to change the library SONAME. This patch adds a symbol
versioning, naming paradigm is:
BLKID_<maj>.<min>
The original libblkid from e2fsprogs uses "1.0" as a .so version and
"libblkid.1" as a SONAME for all time (at least according to stuff in
/lib/libblkid*)
And the original library is without symbols versioning. It means that
many private functions are exported to applications ;-(
Note that the original blkid_get_library_version() returns
E2FSPROGS_VERSION. The version in util-linux-ng returns BLKID_VERSION
which is <maj>.<min>.<rel>. The <maj>.<min> is the same version as we
use for ABI. This concept seems less confusing than mix a library
version and package version.
Summary:
OLD (e2fsprogs):
ABI versioning: -none-
SONAME: libblkid.1
.so version: libblkid.so.1.0
blkid_get_library_version(): @E2FSPROGS_VERSION@ (e.g. 1.41.1)
NEW (util-linux-ng):
ABI versioning: BLKID_<maj>.<min>
SONAME: libblkid.1
.so version: libblkid.so.<maj.<min> (e.g. 1.41)
blkid_get_library_version(): @BLKID_VERSION@ (e.g. 1.41.1)
Karel Zak [Tue, 27 Jan 2009 16:25:06 +0000 (17:25 +0100)]
blkid: add blkid_do_safeprobe()
The function blkid_do_probe() is able to detect more filesystems on
the device
while(blkid_do_probe(pr) == 0)
...
but in many cases we need only one exact answer, and we also need to
be sure that there is not any other FS on the device.
For example it's possible to create valid LUKS (or vfat, ...) header
and valid linux swap header on the same device -- in such case the
device can be interpreted (by mount/swapon) in two completely
different ways. An ambivalent result is always error -- the library
never returns such result.
Eric Sandeen [Mon, 8 Dec 2008 14:37:18 +0000 (15:37 +0100)]
blkid: recognize ext3 with test_fs set as ext3
It seems that if we have the test_filesystem flag set on an ext3
filesystem(!) on a system which provides ext4, blkid gets confused.
According to the current logic:
* It's not an ext4dev filesystem, because the system provides ext4.
* It's not an ext4 filesystem, because it has no ext4 features.
* It's not an ext3 filesystem, because the test flag is set.
In the end, it's nothing.
blkid should return *something* that is mountable... I'm inclined to
think that ext3 should be the right answer, if no ext4-specific features
are set.
This would mean just dropping the EXT2_FLAGS_TEST_FILESYS test in
probe_ext3(), because ext4 & ext4dev probes have come first already.
[kzak@redhat.com: port from e2fsprogs to util-linux-ng tree]
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Karel Zak <kzak@redhat.com>
Eric Sandeen [Mon, 8 Dec 2008 14:28:49 +0000 (15:28 +0100)]
blkis: fix detection of ext4dev as ext4
If only ext4 is available (as a module or in /proc/filesystems)
blkid wasn't properly testing for it, because the time checks
were backwards and always failed. This caused old ext4dev
filesystems to fail to mount as ext4. With this patch it works
fine.
Also, don't try to check for modules on a non-Linux system.
[kzak@redhat.com: port from e2fsprogs to util-linux-ng tree]
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Karel Zak <kzak@redhat.com>
Theodore Ts'o [Mon, 8 Dec 2008 14:07:13 +0000 (15:07 +0100)]
blkid: Give a priority bonus to "leaf" devicemapper devices
Give a boost to dm devices which are not used to build other dm
devices, since "leaf" devices are generally more likely to be
interesting as devices to mount.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Karel Zak <kzak@redhat.com>
Theodore Ts'o [Mon, 8 Dec 2008 14:05:03 +0000 (15:05 +0100)]
blkid: Unexport the private symbol blkid_devdirs
blkid_devdirs was defined in blkidP.h and was never intended to be
used outside of the library. Since it no longer needs to be shared
across object files, rename it and turn it into a static variable.
Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Karel Zak <kzak@redhat.com>
Theodore Ts'o [Mon, 8 Dec 2008 13:28:35 +0000 (14:28 +0100)]
blkid: Optimize devicemapper support
This commit works by removing all calls from libdevmapper altogether,
and using the standard support for "normal" non-dm devices.
It depends on dm devices being placed in /dev/mapper (but the previous
code had this dependency anyway), and /proc/partitions containing dm
devices.
We don't actually rip out the libdevmapper code in this commit, but
just disable it via #undef HAVE_DEVMAPPER, just so it's easier to
review and understand the fundamental code changes. A subsequent
commit will remove the libdevmapper code, as well as unexport
the blkid_devdirs string array.
Thanks to Karel Zak for inspiring me to look at the dm code in blkid,
so I could realize how much it deserved to ripped out by its roots. :-)
[kzak@redhat.com: port from e2fsprogs to util-linux-ng tree]
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Karel Zak <kzak@redhat.com>