aboutsummaryrefslogtreecommitdiffstats
path: root/lib/blkid
Commit message (Collapse)AuthorAgeFilesLines
* blkid: Add support for probing exFATSteve Kondik2015-10-163-0/+192
| | | | | | | * e2fsprogs can't currently detect exFAT filesystems. * Apply patch from GoogleTV to add support. Change-Id: Ib08bdb1d13e995d133a62539e3bfa0e3a22eeead
* Add f2fs to blkid.Jeff Sharkey2015-05-282-0/+49
| | | | | | | We can now identify f2fs filesystems and extract the UUID. Bug: 20275581 Change-Id: I55f7b8aa6647913bd45f02a8e9eea18ca3c53939
* Cleanup Obsolete LOCAL_PRELINK_MODULE.Ying Wang2014-12-161-1/+0
| | | | | Bug: 18675947 Change-Id: I7d2db77f410d50bc6feed5f1a79c0bfef88c7cab
* am a72d7e9d: Merge "Cleanup Obsolete LOCAL_PRELINK_MODULE."Ying Wang2014-12-161-1/+0
|\ | | | | | | | | * commit 'a72d7e9db1144749931eeb42d1455285992dbadd': Cleanup Obsolete LOCAL_PRELINK_MODULE.
| * Cleanup Obsolete LOCAL_PRELINK_MODULE.Ying Wang2014-12-161-1/+0
| | | | | | | | | | Bug: 18675947 Change-Id: I3a39de092dad5f608dbcac3f495011775169a536
* | tune2fs: Allow building it as a static libJP Abgrall2014-11-211-0/+16
|/ | | | | | | | | | This allows getting all of tune2fs as a static library. The entry point is int tune2fs_main(int argc, char **argv). It requires passing argv[0]="tune2fs" to get tune2fs behavior. Bug: 18430740 Change-Id: I7bf8d96c53066a4da37778c0d67383b0b820e2ff
* Switch back to 1.42.9 now that there is a fixJP Abgrall2014-03-1911-110/+128
| | | | | | Revert "Revert changes that moved from 1.41.14 to 1.42.9" This reverts commit 65f0aab98b20b5994a726ab90d355248bcddfffd.
* Revert changes that moved from 1.41.14 to 1.42.9JP Abgrall2014-03-0611-128/+110
| | | | | | | | | | | | | | | | Revert "e2fsck: Don't use e2fsck_global_ctx unless HAVE_SIGNAL_H" commit e80e74c41d85ff93f3d212ba6512340f48054a93. Revert "Merge remote-tracking branch 'linaro/linaro-1.42.9' into aosp_master" This reverts commit e97b2b6fc82f840e84dfc631b87f21be44ff2421, reversing changes made to 7e2fb9d09c245eba70ee008b78007315e9c0f1df. Revert "Prepare for upstream 1.42.9" This reverts commit 7e2fb9d09c245eba70ee008b78007315e9c0f1df. Bug: 13340735 Change-Id: If48b153a95ef5f69f7cdccb00e23524abff3c5a8 Signed-off-by: JP Abgrall <jpa@google.com>
* Fix blkid time diff bug, build binary.Jeff Sharkey2014-01-051-2/+3
| | | | | | | | When calculating time diffs, use difftime() instead of risking integer overflow. Also build a "blkid" binary. Bug: 11175082 Change-Id: I23521f45204574bb32f152926401c2cbad93175b
* Add files that would normally be generated by the e2fsprogs build systemBernhard Rosenkränzer2014-01-0515-13/+243
| | | | | | | | | | | | | | | | | Android doesn't run ./configure and friends, so it has to rely on pre-populated versions of the autogenerated files. This is somewhat bogus (e.g. hardcoded little-endian reference in lib/ext2fs/ext2_types.h) and should at some point be fixed, but it's what Android has always done, not a regression from the 1.41.14 branch. Also, don't #include config.h which we don't generate (we pass what it usually contains as -D parameters from Android.mk) anywhere. Add a new Android.mk file for the quota library. Change-Id: I162c6327fee5bd06261d9cdcc34bda10f04a6f21 Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
* Re-add Android makefiles from AOSP masterBernhard Rosenkränzer2013-12-311-0/+78
| | | | | Change-Id: I6c6dbe11baa395442f4cf845ad39801f1c426129 Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
* ext2fs,blkid: delete unused LIST_HEAD() macroAndreas Dilger2013-12-151-4/+1
| | | | | | | | | | The LIST_HEAD() macro conflicts with the <sys/queue.h> declaration of the same name. Delete the unused LIST_HEAD() macro from the libext2fs and libblkid headers to avoid compiler warnings. It can be replaced by INIT_LIST_HEAD() or LIST_HEAD_INIT() if needed. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* build: quiet LLVM non-literal string format warningAndreas Dilger2013-12-151-2/+2
| | | | | | | | | | | | | | | | | Compiling with LLVM generates a large number of warnings due to the use of _() for wrapping strings for i18n: warning: format string is not a string literal (potentially insecure) [-Wformat-security] ./nls-enable.h:4:14: note: expanded from macro '_' #define _(a) (gettext (a)) ^~~~~~~~~~~~ These warnings are fixed by using "%s" as the format string, and then _() is used as the string argument. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* build: use long long for __u64 by defaultAndreas Dilger2013-12-151-8/+8
| | | | | | | | | | | | | | | | | | | | | Don't print a verbose configure error in parse-types.h if <asm/types.h> missing and __[SU]*_TYPEDEF is unset. This is always the case for non-Linux builds. The printf formatting strings all use "%llu" for printing 64-bit values and this it produces a large number of warnings if __u64 is defined as "unsigned long". If __U64_TYPEDEF isn't set use "unsigned long long" for __u64 in ext2-types.h and blkid-types.h by default instead of using "unsigned long". Fix a few places where "%d" or "%u" or "%Lu" were used to print a 64-bit value, by converting them to use "%lld" or "%llu" instead. Fix a few places where "%lu" was used to print .tv_usec, by casting the variable to "(long)" since .tv_usec is "int" on some systems. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsprogs: add (optional) sparse checking to the buildDarrick J. Wong2013-10-111-0/+1
| | | | | | | | | | Run sparse against source files when building e2fsprogs with 'make C=1'. If instead C=2, it configures basic ext2 types for bitwise checking with sparse, which can help find the (many many) spots where conversion errors are (possibly) happening. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Try to use secure_getenv() in preference to __secure_getenv()Theodore Ts'o2013-06-161-1/+6
| | | | | | | | | If secure_getenv() use it in preference to __secure_getenv(). Starting with (e)glibc version 2.17, secure_getenv() exists, while __secure_getenv() only works with shared library links (where it is a weak symbol), but not for static links with /lib/libc.a Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* blkid: remove no-op statement which caused a clang warningTheodore Ts'o2013-03-131-3/+1
| | | | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* build: quiet some "gcc -Wall" compiler warningsAndreas Dilger2012-12-291-4/+8
| | | | | | | | | | | Quiet a number of simple compiler warnings: - pointers not initialized by ext2fs_get_mem() - return without value in non-void function - dereferencing type-punned pointers - unused variables Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* ext2fs, blkid: localize environment-specific variablesAndreas Dilger2012-11-261-49/+56
| | | | | | | | | | | Restructure the ext2fs_get_device_size() and blkid_get_dev_size() code to localize the variables used for different device probing methods. This at least reduces the #ifdef mess to only one part of the code for each method, and avoids "unused variable" compiler warnings added when variables are declared without being #ifdef'd. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Put ELF_OTHER_LIBS in the right place for the linkerTheodore Ts'o2012-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | Commit a7c17431b9 attempted to fix a problem where the system libraries might get used instead of local libraries for things like -lcom_err. It tried to accomplish this by moving $(ELF_OTHER_LIBS) to before $(LDFLAGS). Unfortunately, this was the wrong fix; $(ELF_OTHER_LIBS) *MUST* be after the object files, or the linker might not pull in the necessary library and not include it into the DT_NEEDED section of the shared library. The proper fix is to add a -L$(LIB) before $(LDFLAGS), and then remove the -L option from all of the ELF_OTHER_LIBS definitions in the library Makefiles. Addresses-Sourceforge-Bug: #3554345 Cc: Olivier Blin <olivier.blin@softathome.com> Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Change pkg-config files so that both <et/com_err.h> and <com_err.h> workTheodore Ts'o2012-05-141-1/+1
| | | | | | | | | | | | | | | | | | | Change the include path in the Cflags field so that #include <lib/foo.h> and <foo.h> will work. We had originally used a C flags which allowed <foo.h> to work, but many applications (especially those not using pkg-config) had been using the <lob/foo.h> formulation which didn't require an explicit -I{$includedir} option to the C compiler. If those applications then converted over to pkg-config, and the e2fsprogs libraries were installed with a prefix other than /usr, so that the header files were in some directory such as /usr/local/include, a program that used #include <lib/foo.h> would fail to compile. So change the pkg-config files to include both -I{$includedir} and -I{$includir}/lib. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* build: fix compile warnings on OSXAndreas Dilger2012-02-271-7/+6
| | | | | | | | Clean up some compile warnings related to fstat64(), which is verbosely deprecated on OSX. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Update Release Notes, Changelogs, version.h, etc. for 1.42 releaseTheodore Ts'o2011-11-291-12/+25
| | | | | | Also fixed depfix.sed Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Shorten compile commands run by the build systemTheodore Ts'o2011-09-1813-0/+13
| | | | | | | | | | | | | | | The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and this was starting to cause some tools heartburn. It also made "make V=1" almost useless, since trying to following the individual commands run by make was lost in the noise of all of the defines. So fix this by putting the configure-generated defines in lib/config.h and the directory pathnames to lib/dirpaths.h. In addition, clean up some vestigal defines in configure.in and in the Makefiles to further shorten the cc command lines. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* misc: clean up compiler warningsAndreas Dilger2011-06-111-3/+4
| | | | | | | | Fix several types of compiler warnings (unused variables/labels), uninitialized variables, etc that are hit with gcc -Wall. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsprogs: reserving code points for new ext4 quota featureAditya Kali2011-02-251-0/+1
| | | | | | | | | This patch adds support for detecting the new 'quota' feature in ext4. The patch reserves code points for usr and group quota inodes and also for the feature flag EXT4_FEATURE_RO_COMPAT_QUOTA. Signed-off-by: Aditya Kali <adityakali@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Don't use in-tree header files if using system uuid or blkid librariesTheodore Ts'o2009-10-043-36/+21
| | | | | | | | This commit forces the use of the system-provided blkid or uuid header files if we are using the system-provided blkid or uuid libraries. This avoids using the in-tree header files with the system libraries. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* blkid: Avoid a potentially error message when running "make clean"Theodore Ts'o2009-10-031-1/+2
| | | | | | | This error isn't terribly important, but apparently it causes some users/developers distress. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* blkid: support .ko.gz in modules.dep parserKarel Zak2009-08-271-9/+8
| | | | | | | | | | | | | The Linux kernel modules could be compressed, it means modules.dep parser in libblid has to support .ko.gz extension too. (Note, I've talked about this problem with Jon Masters and his suggestion is to exec(/sbin/modinfo) rather than directly parse modules.dep. BTW, the modules.dep file is deprecated.) Address-Red-Hat-Bug: #518572 Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Add support for configure --enable-verbose-makecmdsTheodore Ts'o2009-07-021-54/+54
| | | | | | | | | | | | | | | | | 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>
* blkid: Don't use a hard-coded path for /bin/rm in test_probe.inTheodore Ts'o2009-05-171-1/+1
| | | | | | Addresses-Sourceforge-Bug: #2780205 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* blkid: use /sys/block/dm-<N>/dm/nameKarel Zak2009-05-021-1/+29
| | | | | | | | | | | | The Linux kernel (since 2.6.29, patch 784aae735d9b0bba3f8b9faef4c8b30df3bf0128) exports the real DM device names in /sys/block/<ptname>/dm/name. The sysfs based solution is nicer and faster than scan for devno in /dev/mapper/. CC: Milan Broz <mbroz@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* blkid: use /dev/mapper/<name> rather than /dev/dm-<N>Karel Zak2009-05-021-2/+11
| | | | | | | | | | | | | | | | | | | | | The libblkid (since v1.41.1) returns private device-mapper names (e.g. /dev/dm-0). It's because the probe_one() function scans /dev before /dev/mapper. brw-rw---- 1 root disk 253, 0 2009-04-27 13:41 /dev/dm-0 brw-rw---- 1 root disk 253, 0 2009-04-27 13:41 /dev/mapper/TestVolGroup-TestLogVolume Old version: # blkid -t LABEL="TEST-LABEL" -o device /dev/dm-0 Fixed version: # blkid -t LABEL="TEST-LABEL" -o device /dev/mapper/TestVolGroup-TestLogVolume Addresses-Red-Hat-Bug: #497259 Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* blkid: remove whole-disk entries from cache when partitions are foundEric Sandeen2009-04-221-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | We can get into a situation in blkid where whole disks remain in the cache, even though partitions are found. For labels such as sun disklabels which may have the first partition beginning at sector 0, this is even somewhat likely. 1) create a sun disklabel w/partitions 2) mkfs the first partition (at sector 0) 3) remove the partition table 4) run blkid - this finds the fs on the whole disk, places in cache 5) recreate the partition table 6) run blkid - this finds the partition, places in cache And now we have both /dev/sda and /dev/sda1 in cache. There are heuristics in probe_all to avoid putting the whole disk in cache if it has partitions, but there is nothing to remove the whole-disk entry in the above case. I think the below patch suffices, although I haven't quite convinced myself that setting the lens[which]=0; is the right logic for that bit of state... Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* remove useless if-before-free testsJim Meyering2009-03-087-30/+15
| | | | | | | | | | | | | | | | | | | In case you're wondering about whether this change is safe from a portability standpoint, fear not. This has been beaten to death in other forums. Here are a few threads: http://thread.gmane.org/gmane.comp.version-control.git/74187 http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12712 http://thread.gmane.org/gmane.emacs.devel/98144 http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13092 There has been debate about whether it's a good idea from a performance standpoint, too, but imho you'll have a hard time finding an instance where this sort of change induces a measurable performance penalty. If you do, please let me know. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* blkid: Add fallback to ext4 for 2.6.29+ kernels if ext2 is not presentTheodore Ts'o2009-03-081-0/+83
| | | | | | | | Starting in 2.6.29, ext4 can be used to support filesystems without a journal. So if ext2 is not present, and the kernel version is greater than 2.6.29, and ext4 is present, return a filesystme type of ext4. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* blkid: recognize ext4(dev) without journalEric Sandeen2009-03-061-10/+0
| | | | | | | | | | | | | | | | ext4/ext4dev no longer require a journal. w/o this blkid doesn't recognize after: # mkfs.ext4 /dev/blah # tune2fs -O ^has_journal # blkid /dev/blah We still must have one ext3-incompat-feature to flag as ext4(dev) so we shouldn't ever mis-recognize it. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsprogs: fix potential null ptr defef in check_for_modules()Eric Sandeen2009-03-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The coverity scanner found this one. If a line in modules.dep has a ":" but no "/" then: if ((cp = strchr(buf, ':')) != NULL) *cp = 0; else continue; if ((cp = strrchr(buf, '/')) != NULL) cp++; /* XXX else cp is still null */ i = strlen(cp); ... we will deref a null pointer (cp). This can be demonstrated by putting a line like: foo.ko: into modules.dep. The below change just says that if no "/" is found, treat the whole string as the module name. Addresses-Red-Hat-Bugzilla: #486997 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* blkid: Add support for detecting user-level suspend as a swsuspend signatureTheodore Ts'o2009-01-201-0/+5
| | | | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* blkid: recognize btrfsEric Sandeen2009-01-202-0/+121
| | | | | | | | | | | Add btrfs detection to libblkid, now that the disk format should be recognizable in the future. # misc/blkid /tmp/fsfile /tmp/fsfile: LABEL="mylabel" UUID="102b07f0-0e79-4b42-8a4e-1dde418bbe6d" TYPE="btrfs" Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* blkid: recognize ext3 with test_fs set as ext3Eric Sandeen2008-10-181-4/+0
| | | | | | | | | | | | | | | | | | | | | | | 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. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* libblkid: Refuse to create a device structure for a non-existent deviceTheodore Ts'o2008-10-181-0/+2
| | | | | | | | | Fix blkid_get_dev() so it will never return a device structure if the device file doesn't exist. Addresses-Debian-Bug: #502541 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* libblkid: Fix file descriptor leak when checking for a moduleTheodore Ts'o2008-10-121-1/+3
| | | | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsprogs: fix blkid detection of ext4dev as ext4Eric Sandeen2008-10-121-2/+6
| | | | | | | | | | | | | 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. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Fix pkg-config files: use Requires.private and fix the include directoryTheodore Ts'o2008-09-021-2/+2
| | | | | | Addresses-Sourceforge-Bug: #2089537 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* Remove trailing whitespace for the entire source treeTheodore Ts'o2008-08-2713-101/+101
| | | | Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* libblkid: Give a priority bonus to "leaf" devicemapper devicesTheodore Ts'o2008-08-271-3/+37
| | | | | | | | 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>
* libblkid: Unexport the private symbol blkid_devdirsTheodore Ts'o2008-08-272-3/+2
| | | | | | | | 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>
* Remove use of devmapper library by the blkid libraryTheodore Ts'o2008-08-263-197/+2
| | | | | | The devmapper library is no longer needed given commit f4e89bcd. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* libblkid: Optimize devicemapper supportTheodore Ts'o2008-08-263-14/+28
| | | | | | | | | | | | | | | | | | | | 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. :-) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>