summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdisk.c
Commit message (Collapse)AuthorAgeFilesLines
* fdisk: fix type dialogKarel Zak2017-05-111-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk, sfdisk: avoid non-ANSI function declarations [smatch scan]Sami Kerola2017-03-141-0/+1
| | | | | | | | | | | | | | | Adding _FUNCTION_DEF definition will exclude compatibility type definitions that do include void key word in empty argument list. /usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function' These functions has been replaced by set of new ones in readline 4.2 (April 2001), and removed in 6.3 (February 2014). Reference: https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES Rererence: https://blueslugs.com/blog/2016-10-23-updating-cppfunction-in-old-readline-consumers/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fdisk: improve --wipe functionalityKarel Zak2017-02-141-18/+27
| | | | | | | | | * always (except --wipe=never) wipe old partition tables * improve warn messages * improve man page Addresses: https://github.com/karelzak/util-linux/issues/410 Signed-off-by: Karel Zak <kzak@redhat.com>
* Use --help suggestion on invalid optionKarel Zak2016-12-191-1/+1
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: don't be silent when list non-existing deviceKarel Zak2016-12-131-2/+6
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/376 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: use PAGER for 'l' command.Karel Zak2016-08-261-0/+6
| | | | | | | The list of the partition types is too long. Let's try to use $PAGER. Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: make -l <dev ...> behaves like fdisk -lThierry Vignaud2016-07-141-1/+6
| | | | | | aka having the same spacing between disks Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: Fix various typosSebastian Rasmussen2016-05-311-1/+1
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* fdisk: add --wipe-partitions=auto|never|defaultKarel Zak2016-05-041-1/+10
| | | | | | | | | | | | | The option allows to remove filesystes/RAIDs from newly created partitions before the partition table is updated (and partition device created). The default is "auto" in this case wipe is enabled in interactive mode only and user's confirmation (yes/no dialog) is required. Note that keep filesystem signature on partition is pretty valid use-case, so we don't erase anything by default. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix the grammar of an option descriptionBenno Schulenberg2016-03-171-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fdisk, cfdisk, sfdisk: improve the grammar of three messagesBenno Schulenberg2016-03-161-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* sfdisk, fdisk: add fflush()Karel Zak2016-03-101-0/+2
| | | | | | | Let's add fflush(stdout) before we print to stderr to make output order more deterministic. Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: again fixing many printf format stringsRuediger Meier2016-03-071-10/+15
| | | | | | | | | | | | | | | | | | | This is again a huge patch regarding printf format strings to fix compiler warnings seen on clang/OSX. I'm trying to follow these rules strictly: #type #format #cast uintmax_t %ju - intmax_t %jd - uint64_t PRIu64 - int64_t PRId64 - size_t %zu - ssize_t %zd - ino_t %ju (uintmax_t) off_t %jd (intmax_t) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fdisk: remove unused include sysfs.hRuediger Meier2016-03-071-1/+0Star
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fdisk: fix warning, incompatible pointer types passing 'uint64_t *'Ruediger Meier2016-02-291-2/+2
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fdisk: add --wipeKarel Zak2016-02-181-1/+27
| | | | | | | | | | | | | | This patch changes fdisk behavior and it wipes foreign signatures from the device to avoid collisions. The wipe functionality is automatically enabled in the interactive mode only (user is always warned about it), otherwise it's possible to control all by --wipe <auto|never|always>. The program does not change behavior when executed in scripts (echo <something> | fdisk), the option "--wipe=always" is required to enable in this case. Signed-off-by: Karel Zak <kzak@redhat.com>
* Fix trivial typosYuri Chornoivan2015-08-251-1/+1
|
* textual: adjust grammar and punctuation of some messagesBenno Schulenberg2015-08-031-1/+1
| | | | | | | Also equalize three messages to one other one, and fix a typo in USE_COLORS_BY_DEFAULT. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fdisk: value is never read [clang analyze]Karel Zak2015-07-291-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: init libsmartcols debugKarel Zak2015-07-271-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix fdisk_label_parse_parttype() for unknown typesKarel Zak2015-07-151-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: differentiate between +<sector> and +<size>{M,G,...}Karel Zak2015-06-101-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) make it possible to create really small partitionsKarel Zak2015-06-081-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: provide more information by 'i'nfo commandKarel Zak2015-05-111-6/+4Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add the 'i'nfo commandJean-Loup 'clippix' Bogalho2015-05-111-0/+44
| | | | | | | Add the 'i'nfo command to fdisk that prints details about a specific partition. Details are everything the function 'fdisk_label_get_field' can return. Signed-off-by: Jean-Loup 'clippix' Bogalho <clippix@lse.epita.fr>
* fdisk: fix typoKarel Zak2015-04-131-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add --protect-bootKarel Zak2015-04-131-1/+6
| | | | | | | | Now fdisk erases the begin of the device when create a new disk label, it seems like disadvantage for some use-cases. Reported-by: Jean-Loup 'clippix' Bogalho <clippix@lse.epita.fr> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix readline wrapperKarel Zak2015-03-251-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add GNU Readline support to fdiskKarel Zak2015-03-251-14/+50
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* colors: cleanup man pages, add hint to usage()Karel Zak2015-02-251-0/+3
| | | | | | | | cfdisk, fdisk, calm dmesg and hexdump Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* rpmatch: use symbolic value when evaluation return codesSami Kerola2015-02-241-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fdisk: check return and robust label usage [coverity scan]Karel Zak2015-01-281-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: don't use off_t in public APIKarel Zak2015-01-261-3/+3
| | | | | | | | | | | | It's better to use exact and explicitly defined types (e.g. uint64_t) rather than something like off_t to make code more portable. [reported with gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3)] The patch also fixes one debug message. Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdiskL add API to print SIZE field in bytesKarel Zak2015-01-191-1/+8
| | | | | | The patch also add --bytes to fdisk and fdisk. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add --output to usage()Karel Zak2015-01-141-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-061-0/+3
| | | | | | | | | This adds a concise description of a tool to its usage text. A first form of this patch was proposed by Steven Honeyman (see http://www.spinics.net/lists/util-linux-ng/msg09994.html). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk: rename sector_t to fdisk_sector_tKarel Zak2014-12-041-5/+7
| | | | | | .. just to avoid too generic names for public API. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: remove flags from fdisk_ask APIKarel Zak2014-11-211-1/+1
| | | | | | We don't use it for anything usable, lets kill this over-engineering. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: missing break in switchBoris Egorov2014-11-131-0/+1
| | | | | Signed-off-by: Boris Egorov <egorov@linux.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include/debug: fix typoKarel Zak2014-10-241-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: follow explicitly specified partition sizeKarel Zak2014-10-091-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add --output <list> for print command(s)Karel Zak2014-10-071-1/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: add --verifyKarel Zak2014-10-071-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: make yes/no dialogs more robustKarel Zak2014-10-071-4/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: improve --list outputKarel Zak2014-10-071-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: move --list functionality to separated fileKarel Zak2014-10-071-218/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use reference counting for contextKarel Zak2014-08-281-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: remove debug dump function, cleanup APIKarel Zak2014-08-221-1/+1
| | | | | | | The fdisk_dump_* prefix will be used for sfdisk-like functionality. The patch also add FDISK_ prefix to fdisk_get_unit() options. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix fdisk_get_optimal_iosize() and update testsKarel Zak2014-08-201-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add independent debug stuffKarel Zak2014-08-151-3/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>