summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/libfdisk.sym
Commit message (Collapse)AuthorAgeFilesLines
* libfdisk: add fdisk_assign_device_by_fd()Karel Zak2019-06-181-0/+1
| | | | | | | | It's possible that caller has the device already opened for some other task, so let's reuse the file descriptor. Requested-by: Lennart Poettering <lennart@poettering.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_script_set_table()Karel Zak2019-06-171-0/+4
| | | | | | | | | | | | This small change improves possibility to modify by script described PT and use script API in another tools as primary way to create partitions. All you need is to compose script by fdisk_script_set_header() and fdisk_script_set_table() and than apply by fdisk_apply_script(). Requested-by: Lennart Poettering <lennart@poettering.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_get_devmodel() and fdisk_get_devno()Karel Zak2018-08-301-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: Accept negative numbers for last sector inputAwal Garg2018-07-311-0/+4
| | | | | | | | [kzak@redhat.com: - add note to the man page - add '-' to the dialog query - cleanup functions names and libfdisk.sym] Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: extend API to provide label specific geometry rangesKarel Zak2018-01-021-0/+6
| | | | | | | Now fdisk provides DOS specific geometry ranges in expert menu. Addresses: https://github.com/karelzak/util-linux/issues/556 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_save_user_grain()Karel Zak2017-08-221-0/+1
| | | | | | | | | | | Let's provide API for applications that don't want to use the default 1MiB grain. The new function allow to use "as minimal as possible" if grain is set by fdisk_save_user_grain() to 512. If the phy sector size (or minimal I/O size) is greater than specified grain size than smallest possible setting is used. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_disable_dialogs()Karel Zak2017-07-191-0/+2
| | | | | | | | | | | | | | | The default (for historical reasons) is to use dialog driven partitioning. It's possible to avoid dialogs by fdisk_partition template for fdisk_add_partition(). Unfortunately in some case (mostly DOS driver) it's not enough, because we need to distinguish between logical and primary partitions. If we know that dialogs are unwanted then we can default to primary partition, etc. This function simplify semantic of the library for non-interactive programs. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use BLKPG ioctls to inform kernel about changesKarel Zak2017-07-141-0/+1
| | | | | | | | | | | | | This patch introduces fdisk_reread_changes(). The function is less invasive alternative to fdisk_reread_partition_table(). The new function uses BLKPG ioctls for modified partitions. The another partitions are not affected. This solution allows to successfully use fdisks on disk where some partitions are still use (mounted). For example if you want to resize the last partition on the device. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_device_is_used()Karel Zak2017-07-141-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_reassign_device()Karel Zak2017-07-101-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_partition_has_wipe()Karel Zak2017-05-091-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: classify collision typeKarel Zak2017-02-141-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: don't use blkdev ioctls for regular filesKarel Zak2017-01-131-0/+1
| | | | | | | | | | | | | $ fdisk <diskimage> open("sdc.img", O_RDONLY|O_CLOEXEC) = 3 ioctl(3, BLKSSZGET, 0x7ffcf51357c4) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(3, BLKGETSIZE64, 0x7ffcf51357b0) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(3, BLKGETSIZE, 0x7ffcf51356c8) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(3, FDGETPRM, 0x7ffcf51356d0) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(3, HDIO_GETGEO, 0x7ffcf5135790) = -1 ENOTTY (Inappropriate ioctl for device) Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: support empty label use-caseKarel Zak2016-11-301-0/+5
| | | | | | | | | | | | | | | By default sfdisk creates partition table when a first partition is specified, otherwise the device is not modified. This force users to create at least one partition. This commit allows to create empty label without partitions if "label: <name>" header line is specified by script. The commit also modifies "New situation:" output to list label name and label identifier. Addresses: https://github.com/karelzak/util-linux/issues/374 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: Add support for altering GPT sizeSassan Panahinejad2016-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | | This is useful in two situations: 1. More than 128 partitions are required. Or 2. The partition table must be restricted in size, such as when a system expects to find a bootloader at a location that would otherwise overlap the partition table. The gdisk partitioner supports this feature. libfdisk is already capable of reading and writing partition tables of any size, but previously could only create ones of 128 entries and could not resize. This change should be fairly safe, as it has no effect unless explicitly activated. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add API for work with labelitemsKarel Zak2016-05-121-0/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_wipe_partition()Karel Zak2016-05-041-0/+4
| | | | | | | | | | | | | | | | | | | Now libfdisk provides functionality wipe disk device only ([s]fdisk option --wipe). This patch allows to probe for filesystems/RAIDs on newly created partitions. It means we can remove signatures before the partition node (device) is created. This reduces udev events and it's unnecessary to call wipefs for all partitions. For example sfdisk --wipe=always --wipe-partitions=always /dev/sda <<< ... EOF is a elegant way how to create new disk layout without any obsolete filesystems/RAIDs. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add API to control signatures wipingKarel Zak2016-02-181-0/+6
| | | | | | | | | | | | | | | | | Now libfdisk warns if another filesystem/RAID/PT signature is detected on the device. It seems better and user-friendly to make it possible to wipe the signatures when we write a new disk label to the device. This patch adds to the library API fdisk_enable_wipe() fdisk_has_wipe() fdisk_get_collision() to control this new feature. The device modification is done by libblkid (the same we use in some mkfs-like utils). Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add JSON dump outputKarel Zak2015-06-151-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add new API to read label specific dataKarel Zak2015-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * removes list() label operation from internal API The list() has been based on fdisk_info() it was useless for anything else than print on stdout... * add a new get_item() label operation and fdisk_get_disklabel_item() public API The new API provides abstract and pretty simple way how to get label specific disk label information, for example fdisk_get_disklabel_item(cxt, GPT_LABELITEM_ENTRIESLBA, &iterm); return LBA of the array with GPT entries. Note that this patch does not implement public functions to get data from the @item object. * removes get_id() label operation -- it's subset of the new get_item() * the new internal API is also used to implement backwardly compatible fdisk_list_disklabel() and fdisk_get_disklabel_id() Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_label_get_fields_ids_all()Karel Zak2015-05-111-5/+6
| | | | | | | | The current fdisk_label_get_fields_ids() is too smart as it differentiate between details mode etc. It's useful for default output, but in some cases it's better to provide all output fields. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) add API for raw partition attributesMichael Marineau2015-05-051-0/+2
| | | | | | | | | | | | | | | | | The existing APIs can only toggle individual bits or get and set bits in a complex text representation, making it impractical to use libfdisk for manipulating the GPT partition attribute field in more complex ways such as updating a value that is multiple bits wide. For example priority based partition selection originally designed for ChromeOS includes two integer values that are 4-bits wide. http://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format#TOC-Trusting-the-GPT [kzak@redhat.com: - add new symbols to .sym file and docs - remove unused variables from test program] Signed-off-by: Michael Marineau <michael.marineau@coreos.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_table_get_partition_by_partno()Karel Zak2015-04-221-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: support bootbits protection from (p)MBRKarel Zak2015-04-131-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fgets() callback for scriptsKarel Zak2015-03-251-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix symbols versioning scriptKarel Zak2015-03-251-4/+5
| | | | | | | | | | | Really stupid copy & past mistake. The libfdisk symbols should not be prefixed by MOUNT_ suffix. This change makes binaries linked with libfdisk 2.26 incompatible with new libfdisk. Fortunately, 2.26 has been the first release and very probably the library has been used for util-linux fdisks only. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_partition_is_wholedisk()Karel Zak2015-02-101-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdiskL add API to print SIZE field in bytesKarel Zak2015-01-191-0/+2
| | | | | | The patch also add --bytes to fdisk and fdisk. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add version.cKarel Zak2015-01-131-1/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: remove 'end' from struct fdisk_partitionKarel Zak2014-12-041-0/+2
| | | | | | This struct member duplicate "start+size". Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: rename and move functionKarel Zak2014-11-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: create a regular shared libfdisk.soKarel Zak2014-11-261-0/+232
- symbols versioning - SONAME from configure.ac - library version to header file - modify build-sys to compile and install shared lib Signed-off-by: Karel Zak <kzak@redhat.com>