summaryrefslogtreecommitdiffstats
path: root/libblkid
Commit message (Collapse)AuthorAgeFilesLines
* libblkid: correct the return values in squashfs probeDavid Shea2014-06-241-3/+3
| | | | | | Returning -1 can cause squashfs v3 detection to make v4 detection fail. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix compiler warning [-Wimplicit-function-declaration]Karel Zak2014-06-182-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/sysfs: add sysfs_devno_is_lvm_private() from libblkidKarel Zak2014-06-174-32/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Only move shared libraries to /lib if they existsThomas Petazzoni2014-06-161-1/+1
| | | | | | | | | | | | | | | | | | In several Makemodule.am, there is a install-exec-hook-<library> target whose role is to move the shared library from /usr/lib to /lib, while keeping a symbolic link /usr/lib/libuuid.so -> ../../lib/<library>.so.<version>. However, when util-linux is built with --enable-static --disable-shared (as is needed on noMMU platforms that don't support shared libraries), no <library>.so is built, but the install-exec-hook-libuuid creates an invalid /usr/lib/<library>.so symbolic link, pointing to ../../lib (yes, the directory). This causes troubles later one when other libraries/programs are compiled with -l<library>, as gcc thinks a shared library is available because there's a file named /usr/lib/<library>.so. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* libblkid: cleanup internal return codesKarel Zak2014-06-103-27/+34
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: ignore private LVM devicesKarel Zak2014-06-106-3/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The virtual private LVM devices do not contain any blkid relevant data and it does not make any sense to scan for superblocks or partitions on the devices, because we can interpret data from the devices in bad way. Unfortunately, for LVM has "private" very special meaning. The private LVM devices are accessible and readable (according to LVM guys it's feature, because debugging etc.). The problem is pretty visible with LVM thin provisioning where a virtual pool device contains segments from the top-level thin devices. Mountable top-level LVM-thin device: # blkid -o udev -p /dev/mapper/vg-thin1 ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c ID_FS_TYPE=ext4 Virtual private LVM-pool device (contains data from all thin devices): # blkid -o udev -p /dev/mapper/vg-pool0 ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c ID_FS_TYPE=ext4 ... this is incorrect, vg-pool0 is unmountable. LVM uses special UUID suffixes for private devices. All devices with uuid in format "LVM-<uuid>-<type>" are private. This patch modifies libblkid to not scan such devices. The high-level API ignores such devices at all now. The low-level API allows to assign the device to blkid_prober, but all scan functions always return nothing and library does not read anything from the device. The another functionality (get parental device, topology, sector sizes, etc.) still works as expected. The change affects only probing code. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1101345 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: fix "behaviour" vs. "behavior"Karel Zak2014-06-061-1/+1
| | | | | | | | Sometimes we use "behaviour" and "behavior" in the same text, let's use "behavior" only everywhere. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1011068 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: rename libs xml/version.xml to xml/version-utils.xmlKarel Zak2014-06-031-1/+1
| | | | | | | It seems that gtk-docs stuff is confused when we use version.xml (package version) and xml/version.xml (library version functions). Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: (zfs) let's keep compiler happyKarel Zak2014-05-301-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'fix-build-sys' of https://github.com/rudimeier/util-linuxKarel Zak2014-05-261-1/+1
|\
| * build-sys: fix typo, sparc vs spark (62b2c024)Ruediger Meier2014-05-231-1/+1
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | libblkid: detect squashfs 3 vs 4Ruediger Meier2014-05-263-15/+50
|/ | | | | | | | | | | | | | | | | | | | | | Detect squashfs version <= 3 as squashfs3 and version >= 4 as squashfs. squashfs kernel module version 4.0 (kernel 2.6.29) is not backward compatible to open squashfs created with previous versions. Also fixed version number parsing, see $ mkdir test $ mksquashfs test test.sqsh $ blkid -p test.sqsh - test.sqsh: VERSION="1024.0" TYPE="squashfs" USAGE="filesystem" + test.sqsh: VERSION="4.0" TYPE="squashfs" USAGE="filesystem" This patch comes from openSUSE / SLE. Original author was probably Miklos Szeredi. Internal SUSE references: bnc#666893, sr226509 CC: Stanislav Brabec <sbrabec@suse.cz> CC: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libblkid/libblkid.3: Improve the typsetting of the manualBjarni Ingi Gislason2014-05-061-3/+3
| | | | | | | Correct space between sentences to two space characters (or begin each sentence on a new line). Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* libblkid: make new_partition() more robustKarel Zak2014-04-181-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix return codes from PART_ENTRY_* probingKarel Zak2014-04-151-1/+11
| | | | | | | | | | | | | | | | The partitions prober does two step: 1) probe the assigned device for partition table 2) probe whole-disk device for partition table if the assigned device is a partition (this generates PART_ENTRY_* results for blkid -p -o udev)) The step 2) is optional and the return code from this probing should not override success (rc=0) from the step 1) -- except situations when the step 2) ends with I/O error or when the step 1) found nothing, but 2) was successful. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: remove private function from docsKarel Zak2014-04-071-7/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fix .h.in usage in libblkid and libmountKarel Zak2014-04-071-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix partitions probingKarel Zak2014-03-284-5/+11
| | | | | | | | | | | * PART_ENTRY_* stuff is optional and should not overwrite previous probing result in partitions_probe() * missing minix parental partition is not error * blkid_probe_is_vfat() usage has to be more robust Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use new debug functionsKarel Zak2014-03-2134-218/+196Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'common_debug' of https://github.com/ooprala/util-linuxKarel Zak2014-03-212-26/+7Star
|\ | | | | | | | | | | | | | | | | | | | | | | * 'common_debug' of https://github.com/ooprala/util-linux: clean up redundant macros and defines libfdisk: use include/debug.h libblkid: use include/debug.h libmount: further debug.h integration libcommon: don't mention lib versions in debug macros libcommon: define more debugging macros libmount: use macros from include/debug.h libcommon: add common debugging routines
| * clean up redundant macros and definesOndrej Oprala2014-03-132-10/+1Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
| * libblkid: use include/debug.hOndrej Oprala2014-03-132-21/+11Star
| | | | | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* | blkid: convert superblocks to new calling conventionHannes Reinecke2014-03-2056-303/+376
| | | | | | | | | | | | | | | | | | | | | | | | | | With the previous patch the scanning functions were modified to return a differentiated return code. To correctly abort scanning when an I/O error occurs we need to differentiate between 'error' (= -1) and 'not found' (= 1) in the probe functions. This patch updates all superblock scanning functions to the new calling convention. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* | blkid: stop scanning on I/O errorHannes Reinecke2014-03-204-36/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever we fail to read from a device it's pointless to continue with probing; we should be failing immediately. Otherwise the system will continue logging I/O errors. This patch updates the probe functions to return the negative error number on error and BLKID_PROBE_NONE if not found. [kzak@redhat.com: - fix s/return errno/return -errno/] Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid: convert GPT attributes to host endianessKarel Zak2014-03-121-1/+1
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: sort gitignore filesSami Kerola2014-03-122-10/+10
| | | | | | Use 'LC_ALL=C sort -fu' order for all lists. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libblkid: improve commentKarel Zak2014-03-121-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: don't connect _DEPENDENCIES and _LIBADDKarel Zak2014-03-051-6/+5Star
| | | | | | | | | The _DEPENDENCIES has to be used for dependencies on another in-tree files, but _LIBADD is to specify additional libs (including external libs). Reported-by: oleid <notifications@github.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add extra checks to XFS proberKarel Zak2014-02-191-16/+142
| | | | | | The current code rely on XFS magic string only. It seems too fragile. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: detect alone PMBRKarel Zak2014-01-203-2/+44
| | | | | | | | wipefs(8) has to also erase PMBR, not GPR header only, otherwise the device could be still interpreted as a device with a partition table. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1054186 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: no more probe for btrfs backup superblockKarel Zak2014-01-164-19/+2Star
| | | | | | | | | | | | | * Linux kernel cares about the first superblock only * backup superblock are FS specific stuff and there is no reason to care about it in generic tools * the problem with broken btrfs utils has been already fixed (it was possible to use the utils on filesystem with erased primary superblok without any warning message). Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add blkid_partlist_get_partition_by_partno()Karel Zak2014-01-154-0/+40
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: (nilfs2) check also backup superblockKarel Zak2014-01-131-24/+42
| | | | | | | | | * read also backup superblock * check which superblock is newer * set minimal device size to 1MiB Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: Identify extN file system properlyLukas Czerner2013-12-121-180/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when trying to identify extN file system we're playing games with searching for kernel modules and parsing /proc/filesystem. All of this just because ext4 module can be used to mount ext3 and ext2 file systems on recent kernel and also because of ext4dev. However all of this is not necessary. Ext4 module which does support mounting ext2 and ext3 file system is able to recognize and mount ext2 and ext3 type so there is no need to disguise it and ext4dev should only be ever used for testing and not as fallback when other modules are missing (use -t instead). This also introduces a bug when in situation that we only have ext4 modules with ext2/ext3 support which is not loaded and we try to mount ext2 file system we will mount it incorrectly as ext4. This will not happen if the ext4 module is already loaded. With this patch we remove all the unnecessary checks and return the real type of the file system which is on the device. This fixes the issue. However on the kernel which was not compiled with EXT4_USE_FOR_EXT23 support one would have to provide file system type (-t) to be able to mount the file system with ext4 driver. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix sgi PT parser to report system partitionsKarel Zak2013-11-271-2/+1Star
| | | | | | ... to be compatible with Linux kernel. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix memory leak in blkid_parse_tag_string()Karel Zak2013-11-191-5/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix swap-area versionKarel Zak2013-11-041-3/+3
| | | | | | | | | | | * v1: hdr->version = 1, magic string = SWAPSPACE2 * v0: no versio in header, magic string = SWAP-SPACE The mistake has been introduced in the old udev volume_id binary where the version was set according to magic string. Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* COPYING: fix grammar of referring phrase, and indicate location betterBenno Schulenberg2013-10-081-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libblkid: use proper type in xfs log checker [coverity scan]Karel Zak2013-10-011-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: update docsKarel Zak2013-09-272-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: Get rid of an unnecessary checkKarel Zak2013-09-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix kboff usage in BSD proberKarel Zak2013-09-161-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: move bsd definitions to pt-bsd.hKarel Zak2013-09-161-78/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add mbr_get_partition()Karel Zak2013-09-163-10/+7Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: use functions from pt-mbr.hKarel Zak2013-09-163-14/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: rename sys_type to sys_indKarel Zak2013-09-163-10/+10
| | | | | | | This makes struct dos_partition more compatible with the current fdisk code. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: move MBR definitions to include/pt-mbr.hKarel Zak2013-09-165-53/+8Star
|
* libblkid: move MBR partition types to include/Karel Zak2013-09-168-142/+20Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: move SGI disklabel definitions to include/Karel Zak2013-09-161-77/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: export info about bad csumKarel Zak2013-09-111-4/+11
| | | | | | | If a bad check sum is detected and BLKID_SUBLKS_BADCSUM is enabled than SBBADCSUM=1 is added to the probing result. Signed-off-by: Karel Zak <kzak@redhat.com>