summaryrefslogtreecommitdiffstats
path: root/shlibs/blkid/src/partitions
Commit message (Collapse)AuthorAgeFilesLines
* build-sys: use top-level directory for libblkid rather than shlibs/blkidKarel Zak2011-06-0917-3633/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add some debug messagesKarel Zak2011-05-301-2/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add ID_PART_ENTRY_{OFFSET,SIZE,DISK}Karel Zak2011-05-231-0/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use partno for partitions mapped by DMKarel Zak2011-05-231-4/+44
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [sysfs.c] make sysfs_read_* function more robustKarel Zak2011-05-181-3/+7
| | | | | | | The functions does not modify result if the requested sysfs attribute does not exist. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use stuff from sysfs.h and at.hKarel Zak2011-05-161-3/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use cached buffers for nested PT probingKarel Zak2011-05-161-19/+30
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: make whole disk probing more robustKarel Zak2011-05-161-58/+9Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: cleanup prober initializationKarel Zak2011-05-161-1/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: cleanup flagsKarel Zak2011-05-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add PART_ENTRY_* to docsKarel Zak2011-03-111-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix gcc warningsKarel Zak2011-03-011-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix EFI GPT uuid byte orderKarel Zak2011-03-011-11/+23
| | | | | | | | Intel uses little-endians for UUID, the rest of the sane world uses 16 byte big-endian array... Reported-by: Andrew Lutomirski <luto@mit.edu> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: try to detect if PT is newer than LVMKarel Zak2011-02-243-1/+6
| | | | | | | | | | | | | | | | | | | | LVM (pvcreate) wipes the begin of the device. If there is a PT in the wiped area then LVM signature is obsolete. # pvcreate /dev/sdb # fdisk /dev/sdb old version: # blkid -p -o udev /dev/sdb ID_FS_TYPE=LVM2_member new version: # blkid -p -o udev /dev/sdb ID_PART_TABLE_TYPE=dos Reported-by: Matej Cepl <mcepl@redhat.com> Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=679799 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use PRId64 in PT parserKarel Zak2011-01-011-7/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix MBR detection on iPod and cleanup vfat codeKarel Zak2010-10-151-12/+12
| | | | | | | | | | | - move all FAT code to superblocks/vfat.c only - add a generic function to verify FAT superblock and use it in FAT prober as well as in MBR parser - add a more robust FAT cluster_count check (it seems that iPod contains an "almost valid" FAT superblock before MBR) Reported-by: Davidlohr Bueso <dave.bueso@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: consolidate magic strings detection codeKarel Zak2010-10-151-24/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: wrong PT detection on RAID0Karel Zak2010-08-131-1/+1
| | | | | Reported-by: Yulia Kopkova <ykopkova@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: improve MD 0.90 detectionKarel Zak2010-05-181-0/+13
| | | | | | | | | We don't have to check for collision between partition table and RAID on all RAIDs. This problem is specific to MD, where underlying device could be a partition. The RAIDs like via, intel, ... always use whole-disks only. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: cleanup some docsKarel Zak2010-04-231-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add blkid_partlist_get_table()Karel Zak2010-04-231-11/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: don't gather PART_ENTRY_* values for binary interfaceKarel Zak2010-04-231-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix collision between RAID and PT probingKarel Zak2010-04-221-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | The RAID signature is usually at end of the block device. We have to differentiate between: - RAID signature at the end of disk, and - RAID signature at the end of the last partition The position of the signature is same in both cases... It means we have to the parse partition table and check if the area where is RAID signature is covered by any partition. If yes, then the RAID signature belongs to the partition and has to be ignored during whole-disk probing. The second problem are RAID1 underlaying disks (=raid members). The RAID device could be partitioned, in such a case the partition table is visible from underlaying devices. These partition tables has to be ignored. The libblkid ignores partition tables on raid members now. Note that all these changes are implemented for blkid_do_safeprobe() only. The others functions allow to access all detected superblocks or partition tables. Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=543749 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: export functions to get whole-disk devnoKarel Zak2010-04-191-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add ultrix PT supportKarel Zak2010-04-074-0/+91
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix 'partno' usageKarel Zak2010-04-076-10/+26
| | | | | | | | | | | | | | | | | | | | | | | Linux kernel ignores empty partitions, but partition number is always allocated for the partition. (This rule is used for primary partitions only.) For example: part 1. size=12345 part 2. size=0 part 3. size=24567 the final list of partitions: sda1 sda3 'sda2' is not defined and partno=2 is not used for any other partitions. The libblkid library has to be compatible with this rule. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix blkid_partlist_devno_to_partition() for extended partitionsKarel Zak2010-04-061-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: support alignment_offset=-1Karel Zak2010-03-031-2/+2
| | | | | | | | | | | | | | Unfortunately, Linux kernel uses "signed int" for alignment_offset and the offset could be -1 for devices with undefined alignment (if no compatible sizes and alignments exist for stacked devices). There is no way how libblkid caller can respond to the value -1, so we are going to hide this corner case... TODO: maybe we can export an extra boolean value 'misaligned' rather then complete hide this problem. We will see... Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: improve Sun VTOCKarel Zak2010-02-191-18/+30
| | | | | | | | | | | It seems that for example GNU Parted is able to generate Sun VTOC with empty sanity, version and nparts fields. But there is still useful info about partition flags in such VTOC. This change makes libblkid Sun PT parser compatible with Sun PT parser in Linux kernel. Signed-off-by: Karel Zak <kzak@redhat.com>
* blkid: encode PART_ENTRY_TYPEKarel Zak2010-02-181-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add PART_ENTRY_{SCHEME,NUMBER}Karel Zak2010-02-181-0/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add support for partition flags/attributesKarel Zak2010-02-188-1/+40
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add blkid_partition_set_type()Karel Zak2010-02-1811-24/+60
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add support for PART_ENTRY_* valuesKarel Zak2010-02-181-6/+127
| | | | | | | | | | | | blkid(8) will be replacement for devkit-disks-part-id, so we have to be able to found entry in partition table for requested partition. This functionality is enabled by BLKID_PARTS_ENTRY_DETAILS flag (see blkid_probe_set_partitions_flags() for more details). This patch also add a new public function blkid_partlist_devno_to_partition(). Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: don't probe for nested PT on tiny disks (<=1.44MiB)Karel Zak2010-02-181-14/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: don't return error on empty filesKarel Zak2010-02-041-1/+1
| | | | | | | | | | | | | | Currently, the library does not allow to initialize blkid_probe if the file (or block device) is empty. The empty file is reported as an error. That's wrong. The empty file should be interpreted as a file without any FS or PT. It means that blkid_do_{probe,safeprobe,fullprobe}() have to return 1 ("nothing"). Reported-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: don't probe for GPT and Unixware PT on floppiesKarel Zak2010-01-213-0/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add sanity checks for FAT to DOS PT parserKarel Zak2010-01-211-6/+19
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fix out-of-source buildKarel Zak2009-11-061-1/+1
| | | | | | The blkid.h file is generated and stored in $top_builddir. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: convert GPT partition LBA to 512-byte sectorsKarel Zak2009-10-221-4/+9
| | | | | | | | | | | | | | The libblkid keeps information about partitions in 512-byte counts. This patch: * convert GPT partition LBA to 512-byte sectors * fix n+1 bug in GPT partition size, because: "The partition is defined as all the logical blocks **inclusive** of the StartingLBA and EndingLBA." (UEFI 2.3) Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use BLKSSZGET for GPT sectorsKarel Zak2009-10-221-10/+28
| | | | | | | | | | | | | | The current implementation uses fixed sector size (512 bytes), that's wrong. UEFI standard requires real logical sector size -- it means BLKSSZGET for Linux. The size of GPT header is not static, but whole sector is allocated for the header. In theory the HeaderSize field could be greater than sizeof(struct gpt_header). It means we have to read whole sector with the header, because the header crc32 checksum is counted according to HeaderSize. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add missing packed attributesKarel Zak2009-10-165-11/+11
| | | | | | | | This patch add __attribute__((packed)) to almost all superblock and disk label definitions. Well, in many cases this is not necessary, but it's a cheap way how to keep the code robust... Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add blkit_[un]ref() to TODOKarel Zak2009-10-011-0/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use blkid_new_probe_from_filename() in docsKarel Zak2009-09-291-10/+6Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: trim tailing whitespace from unicode LABELsKarel Zak2009-09-221-9/+3Star
| | | | | | | | | | | | | | | | | | | | | | old version: $ ./blkid -o udev -p iso-joliet.img ID_FS_LABEL=ThisIsLabel ID_FS_LABEL_ENC=ThisIsLabel\x20\x20\x20\x20\x20 ID_FS_VERSION=Joliet\x20Extension ID_FS_TYPE=iso9660 ID_FS_USAGE=filesystem new version: $ ./blkid -o udev -p iso-joliet.img ID_FS_LABEL=ThisIsLabel ID_FS_LABEL_ENC=ThisIsLabel ID_FS_VERSION=Joliet\x20Extension ID_FS_TYPE=iso9660 ID_FS_USAGE=filesystem Reported-by: Maxim Levitsky <maximlevitsky@gmail.com> Addresses-Ubuntu-Bug: #432215 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add blkid_partition_get_type_string()Karel Zak2009-09-174-12/+75
| | | | | | | .. because for example Mac and GPT don't use numbers, but strings or UUIDs as partition type identifier. Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add EFI GPT partitions supportKarel Zak2009-09-164-1/+360
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add MINIX partitions supportKarel Zak2009-09-165-2/+105
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add MS-DOS partitions supportKarel Zak2009-09-165-1/+297
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: add MAC partitions supportKarel Zak2009-09-164-1/+182
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>