summaryrefslogtreecommitdiff
path: root/fdisks
AgeCommit message (Collapse)AuthorFilesLines
2013-03-11fdisk: differentiate between get and read operationKarel Zak1-9/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: move label identifier to label structKarel Zak8-13/+20
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add fdisk_label to driver APIKarel Zak7-68/+141
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: kill dos_compatible_flag global variableKarel Zak3-20/+61
... move the variable to label private struct. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add fdisk_new_context(), reuse contextKarel Zak2-38/+45
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: split label and label operationsKarel Zak7-82/+277
Changes: - fdisk_label is a private label driver struct - generic header of the fdisk_label points to fdisk_label_operations - the private fdisk_label stuff is always allocated for all drivers during fdisk_context initialization - context->labels[] contains pointers to all supported labels (drivers) - context->label is a pointer to the currently used label This change allows to: - store label specific global settings (e.g. dos compatible mode, display units, ...) independently on the current label - add label specific function to the API Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: cleanup the rest of fdisks/utils.c stuffKarel Zak1-7/+0
- remove obsolete code - move fdisk_{set,get}_partition_type() to label.c (this is label driver operation) Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add context functionsKarel Zak3-118/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add probing functionKarel Zak2-90/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add fdisk_reset_alignment()Karel Zak2-34/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add topology and geometry functionsKarel Zak3-275/+9
- rename __discovery_* to fdisk_discovery_* - rename fdisk_context_force_sector_size() to fdisk_override_sector_size() - rename fdisk_context_set_user_geometry() to fdisk_override_geometry() - remove non-default sector size warning Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add firstsector utilsKarel Zak2-42/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11fdisk: remove duplicate code (already in libfdisk)Karel Zak1-27/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add generic label codeKarel Zak2-107/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add alignment codeKarel Zak4-104/+8
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add parttype codeKarel Zak2-216/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11libfdisk: add basic structsKarel Zak1-105/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11fdisk: use debug stuff from libfdiskKarel Zak2-42/+8
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-30fdisk: add support for the Xtensa architectureKarel Zak1-1/+1
Based on patch from Chris Zankel <chris@zankel.net>. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-25textual: use UTIL_LINUX_VERSION everywhereKarel Zak1-2/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-10build-sys: add files to distributionSami Kerola1-3/+4
To fix 'make distcheck' compilation. The fdisks/Makemodule.am has one new entry 'dos_part_types.h', the rest is about sorting the list. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-20fdisk: (gpt) fix compiler warningsKarel Zak1-12/+14
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-17fdisk: remove crappy bugs section from man pageKarel Zak1-36/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-04fdisk: (gpt) check if the "First sector" is unusedKarel Zak1-0/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-04fdisk: (gpt) align newly created partitionsKarel Zak4-35/+61
- default "First sector" has to be aligned - "Last sector" has to be aligned if specified by +<size><suffix> convention Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-04fdisk: (gpt) fix {last,first}_usable_lba usageKarel Zak1-7/+14
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-04fdisk: cleanup partition start/end usageKarel Zak1-40/+48
- always use pointers to make the code more generic - always use "const" is possible - always use le64_to_cpu() to access numbers Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-04fdisk: (gpt) check partitions alignmentKarel Zak1-3/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-04fdisk: report PT type, inform about new GPTKarel Zak2-3/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-04fdisk: (gpt) use topology to define FirstUsableLBAKarel Zak1-3/+11
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-03fdisk: move DOS units stuff to fdiskdoslabel.cKarel Zak7-53/+64
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-03fdisk: use BLKSSZGET as default for io-limits rather than hardcoded limitKarel Zak1-6/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-03fdisk: remove global variable sector_offsetKarel Zak5-77/+161
- add cxt->first_lba as replacement to sector_offset - add label->reset_alignment() to overwrite the default alignment setting - add fdisk_reset_alignment() to setup grain, first LBA offset, etc. Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-30fdisk: zerosize EBR bufferKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-30fdisk: api: propagate add partitions to usersDavidlohr Bueso8-41/+57
Similarly to commit 1f5eb51b79275e32d045fd6718753bf04cde8374 we do not propagate problems when adding partitions to user visible api. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-11-30fdisk: remove dead codeDavidlohr Bueso1-9/+0
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-11-30fdisk: api: move disklabel type to cxtDavidlohr Bueso10-129/+146
Get rid of it as a global variable as it belongs in the context. To compare a disklabel on the device, the fdisk_dev_is_disklabel() function is introduced. Also, to avoid naming issues, the fdisk_labeltype members where renamed to FDISK_DISKLABEL_<type>. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-11-30fdisk: don't fails silently if EBR is outside of diskKarel Zak2-9/+23
Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-14fdisk: gpt: check header sizeDavidlohr Bueso1-1/+8
UEFI states that the size of the GPT header must be between 92 and the sector size. Add the check when verifying a valid header. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-11-13fdisk: don't offer GPT stuff in BSD menuKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-02gpt: create empty disklabelsDavidlohr Bueso2-6/+200
This patch enables creating a new, empty, GPT disklabel from either an empty disk or one that already has a disklabel. For this purpose, a 'g' option is added to the main menu and is visible to all labels. Here's an example for a scsi_debug device (/dev/sdb): ... Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x20a614c8. 3696: fdisk: CONTEXT: zeroize in-memory first sector buffer Command (m for help): g 3696: fdisk: LABEL: changing to gpt label 3696: fdisk: CONTEXT: zeroize in-memory first sector buffer 3696: fdisk: LABEL: created new empty GPT disklabel (GUID: D4EA0706-F011-46DC-B7DE-6A72C7090AF8) Command (m for help): w The partition table has been altered! ... Acked-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-11-02fdisk: gpt: write entire first sectorDavidlohr Bueso1-2/+5
We were writing only 1 byte in LBA0, and GPT requires dealing with an entire sector. This bug wasn't affecting when dealing with already existing devices with GPT as we weren't writing an important part of the first sector, thus leaving it unchanged. Also use write_all() wrapper from all-io.h Acked-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-11-02sfdisk: fix formatting typo in man pageKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-23fdisk: fix compiler warning [-Wpointer-arith] and floating point exceptionKarel Zak1-11/+13
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-18fdisk: gpt: use swap_efi_guid for new partitionsDavidlohr Bueso1-11/+1
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-10-18fdisk: fix segfault when printing gpt raw dataDavidlohr Bueso1-1/+2
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-10-18fdisk: api: improve some commentsDavidlohr Bueso1-14/+34
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-10-18fdisk: api: propagate partition deletion to usersDavidlohr Bueso8-21/+33
The generic fdisk_delete_partition() function returns 0 when a partition is correctly deleted, otherwise it's corresponding error (negative values). This, however, does not include problems that can occur in actual label specific contexts, so we need to propagate the corresponding return code, back to the user visible api. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-10-10sfdisk: fix aliasing warningsMike Frysinger1-4/+6
Compiles down to the same code. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-10-09fix bold style of man page referencesMike Frysinger1-2/+2
Signed-off-by: Mike Frysinger <vapier@gentoo.org>