Commit Graph

61 Commits

Author SHA1 Message Date
Karel Zak 053939a45a fdisk: init libsmartcols debug
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 13:33:09 +02:00
Karel Zak 4bd02cdfdf libfdisk: fix fdisk_label_parse_parttype() for unknown types
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-15 15:42:22 +02:00
Karel Zak 8c73e5096d fdisk: differentiate between +<sector> and +<size>{M,G,...}
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-10 13:06:15 +02:00
Karel Zak 765004f3eb libfdisk: (gpt) make it possible to create really small partitions
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-08 16:02:17 +02:00
Karel Zak 6360bccad5 fdisk: provide more information by 'i'nfo command
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-05-11 12:45:21 +02:00
Jean-Loup 'clippix' Bogalho 3e3b51b3b1 fdisk: add the 'i'nfo command
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>
2015-05-11 12:26:30 +02:00
Karel Zak 9ff89c5d9c fdisk: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-13 18:11:38 +02:00
Karel Zak aeb9a30ba4 fdisk: add --protect-boot
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>
2015-04-13 17:24:45 +02:00
Karel Zak 84ab260aa2 fdisk: fix readline wrapper
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-25 16:06:26 +01:00
Karel Zak 740c36f657 fdisk: add GNU Readline support to fdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-25 10:31:37 +01:00
Karel Zak 5d51dc2a7f colors: cleanup man pages, add hint to usage()
cfdisk, fdisk, calm dmesg and hexdump

Signed-off-by: Karel Zak <kzak@redhat.com>

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-25 12:40:06 +01:00
Sami Kerola cd2a6f1cfd rpmatch: use symbolic value when evaluation return codes
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-24 12:42:06 +01:00
Karel Zak 68ddb13662 fdisk: check return and robust label usage [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-28 14:40:10 +01:00
Karel Zak 9bbcf43f88 libfdisk: don't use off_t in public API
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>
2015-01-26 12:26:00 +01:00
Karel Zak 354f8cc8cf libfdiskL add API to print SIZE field in bytes
The patch also add --bytes to fdisk and fdisk.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-19 11:24:48 +01:00
Karel Zak 2d7dffebac fdisk: add --output to usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-14 12:07:52 +01:00
Benno Schulenberg 451dbcfae1 textual: add a docstring to most of the utilities
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>
2015-01-06 11:27:38 +01:00
Karel Zak 0073a4cff2 libfdisk: rename sector_t to fdisk_sector_t
.. just to avoid too generic names for public API.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-04 11:41:51 +01:00
Karel Zak 0477369af4 libfdisk: remove flags from fdisk_ask API
We don't use it for anything usable, lets kill this over-engineering.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-21 15:31:55 +01:00
Boris Egorov 1ce1a112c4 fdisk: missing break in switch
Signed-off-by: Boris Egorov <egorov@linux.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-13 15:10:58 +01:00
Karel Zak 819d9a2975 include/debug: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-24 11:19:23 +02:00
Karel Zak 9b0b9fb1bf libfdisk: follow explicitly specified partition size
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-09 12:09:07 +02:00
Karel Zak fff8ad5882 fdisk: add --output <list> for print command(s)
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak d2c47697e1 sfdisk: add --verify
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 2d12903265 libfdisk: make yes/no dialogs more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 152788aacb fdisk: improve --list output
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:30 +02:00
Karel Zak fdb006e8b5 fdisk: move --list functionality to separated file
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:30 +02:00
Karel Zak c7119037f0 libfdisk: use reference counting for context
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-28 12:49:16 +02:00
Karel Zak 385810d22a libfdisk: remove debug dump function, cleanup API
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>
2014-08-22 10:25:35 +02:00
Karel Zak 6b11aad26b libfdisk: fix fdisk_get_optimal_iosize() and update tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-20 11:43:02 +02:00
Karel Zak e6d0c4c1ac fdisk: add independent debug stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-15 12:38:02 +02:00
Karel Zak 8eccde20dd fdisk: use libfdisk public API only
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-15 12:16:55 +02:00
Karel Zak a745611d69 libfdisk: final parttype API cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-14 13:28:37 +02:00
Karel Zak 5ab3760071 libfdisk: move get_parttypes to label API
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-14 12:01:38 +02:00
Karel Zak 11ee1177ff libfdisk: make it possible to get fields for all labes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-14 00:27:28 +02:00
Karel Zak 72d2965c44 libfdisk: cleanup label geometry API
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-14 00:09:48 +02:00
Karel Zak aa36c2cf2c libfdisk: cleanup fdisk_is_label stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 23:57:54 +02:00
Karel Zak 8d605c884a libfdisk: clean up API (alignment.c)
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 23:27:00 +02:00
Karel Zak 6a6321360d libfdisk: clean up API (context.c)
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 22:26:53 +02:00
Karel Zak bd85d11fba libfdisk: rename fdisk_column to fdisk_field
.. to make the API and fdisk(s) code more readable.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 11:12:27 +02:00
Karel Zak d44115f3b5 libfdisk: remove dependence on libsmartcols
It's application business to convert libfdisk_table to string.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 10:10:11 +02:00
Karel Zak 4fdde144f0 fdisk: update tests and clean up output
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-08 12:35:20 +02:00
Karel Zak c9400a1ea7 fdisk: always print warning for mis-aligned partitions
This patch restores the original fdisk behavior and always prints
information about misaligned partitions in 'p'print output.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-08 11:33:28 +02:00
Karel Zak 52d92543ff fdisk: fix -l [<device>]
* don't use err(), but warn(), so don't stop after the first error

 * display all errors when "-l <device> ..." specified

 * display only EACCES errors when list whole disks from
   /proc/partitions ("fdisk -l" )

Reported-by: Boian Bonev <bbonev@ipacct.com>
Addresses: https://github.com/karelzak/util-linux/pull/106
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-28 12:07:32 +02:00
Benno Schulenberg 09af3db48e textual: fix some typos and inconsistencies in various messages
Fixing plain typos, miswordings, inconsistent periods, some missing
angular brackets, and a proper pluralization (even when it involves
a constant, because for some languages the precise value matters).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-23 08:56:00 +02:00
Sami Kerola bbe67996ad fdisk: avoid code duplication
To me having call to close() twice is less readable than one new
variable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 18:35:38 +01:00
Karel Zak 4b4e391a28 fdisk: don't use --geom-* prefix for CHS options
We already use --cylinders, --heads and --sectors for sfdisk, let's
make new fdisk option compatible.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-30 15:10:29 +02:00
Karel Zak e3a4aaa7d3 fdisk: add long options, cleanup man page and usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 13:31:14 +02:00
Karel Zak a22c6eb206 fdisk: use sysfs_devno_is_wholedisk()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-17 12:15:59 +02:00
Karel Zak 496c979a09 fdisk: support colors customization
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:13:02 +02:00