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>
Kay Sievers [Sat, 6 Dec 2008 16:12:55 +0000 (17:12 +0100)]
blkid: hfs - use proper native UUID format
Here is the md5'd UUID for hfs:
$ LD_LIBRARY_PATH=libs/blkid/src/ libs/blkid/bin/blkid ../../volume_images/hfs-extended.img
UUID="56a19597-a3c8-325d-9df2-f30bc6f8ac09" LABEL="I am HFS Extended" TYPE="hfsplus"
Karel Zak [Thu, 20 Nov 2008 12:00:43 +0000 (13:00 +0100)]
blkid: support detection of multiple signatures
The classic way is to return the first successfully detected signature
(filesystem/raid). Unfortunately, sometimes we need to check for all
possible signatures, because on some volumes (e.g. CD-ROMs) is possible
to store multiple filesystems.
Sometimes we need to check for all filesystems to avoid situation that
we return wrong result (e.g. swap and FAT on the same device).
Karel Zak [Wed, 27 Aug 2008 09:55:39 +0000 (11:55 +0200)]
blkid: add basic configure.ac stuff and blkid.pc
Note, the configure.in stuff is incomplete -- but it's seem we can
remove the libbevmapper crap from blkid at all. So this code autoconf
is temporary only.
Roy Peled [Fri, 28 Nov 2008 14:57:00 +0000 (16:57 +0200)]
mkfs.cramfs: lower memory requirements for layouts with duplicate files
mkfs.cramfs allocates memory based on a calculated upper-bound
of required filesystem size. If there are duplicate files
or hard links, the current implementation unnecessarily increases
the upper-bound per each copy of the file, even though cramfs does
not store copies of contents of identical files.
This patch improves the calculation of fslen_ub, the upper bound
of required filesystem size, by making the upper bound aware of
duplicate files.
This is very helpful for layouts that hold a lot of hard links,
which are seen as duplicate files by mkfs.cramfs. For example,
this drastically reduces the memory requirements for creating
a standard Busybox layout.
Signed-off-by: Roy Peled <the.roy.peled@gmail.com>
mkfs.cramfs: add endianness support to cramfs tools
cramfs is an endianness dependent file system. So far, the cramfs
utilities did not support cramfs images of different endianness than
the host machine.
A separate utility, cramfsswap, was required in order to change the
endianness of the image before and after using cramfs utilities. The
extra utility introduced extra maintenance and an additional step in
the process.
This patch adds endianness support to mkfs.cramfs and fsck.cramfs.
fsck.cramfs now automatically detects the image endianness, and can
work on images of either endianness. mkfs.cramfs now accepts a new
optional parameter (-N) that allows creating the cramfs image in
either endianness.
Signed-off-by: Roy Peled <the.roy.peled@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 16 Jan 2009 11:21:15 +0000 (12:21 +0100)]
mount: non-setuid (POSIX file capabilities) support
The mount command does not work properly if you replace suid with
POSIX file capabilities. We still need to check for non-root mounts and
the command has to work in very restricted mode for non-root users.
This patch allows you to remove suid bit from mount and umount. Note
that you need a system with filesystem capability support, e.g.
Fedora 10).