Commit Graph

585 Commits

Author SHA1 Message Date
Karel Zak 14620822c0 cfdisk: add libfdisk independent debug stuff
Now it's possible to use
	CFDISK_DEBUG=0xffff ./cfdisk
to debug only cfdisk UI.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 21:21:46 +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
Benno Schulenberg 1d23119072 textual: remove some inconsistent periods from error messages
While doing so, also improve translatability and some wordings.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-11 14:51:54 +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 cd8414f7a1 cfdisk: move curs_set(1) to ui_end()
This is probably correct to have curs_set() in ui_end(), but according
to Martin it does not work with slang library from signal handler.

Reported-by: Martin Steigerwald <Martin@lichtvoll.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-06 15:39:27 +02:00
Steven Honeyman 1b19ea31a3 docs: fix inconsistencies in man pages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-06 14:50:20 +02:00
Karel Zak 80b037cc6f fdformat: clean up usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-29 13:53:26 +02:00
Jaromir Capik e0402441a1 fdformat: Add new switches -f/--from, -t/--to, -r/--repair
This commit introduces a support for user configurable
from/to track and a basic repair mode for broken floppies.
It also fixes a recently introduced bug that causes
a line breakage when printing the track number.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-29 13:44:04 +02:00
Sami Kerola 25a365ef5a swaplabel: move swapon-common to include directory
This fixes the following compiler warning.

disk-utils/swaplabel.c:175:2: warning: implicit declaration of function
'get_swap_prober' [-Wimplicit-function-declaration]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-28 12:28:05 +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
Lauri Nurmi 58ac82ae2f sfdisk: use pluralized translation. 2014-07-28 11:45:30 +02:00
Benno Schulenberg 556c9c4842 various: erase all traces of the long-obsolete xiafs
The xiafs filesystem was removed from the kernel fifteen years ago,
and any kernel that contained it reached end of life ten years ago.
It's time to stop mentioning it in the mount man page and elsewhere.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:57 +02:00
Andreas Henriksson 4f4daf8f90 cfdisk: reenable cursor when quitting
After quitting cfdisk (built with slang) the cursor would be
missing at the command prompt.

Reported-by: Martin Steigerwald <Martin@Lichtvoll.de>
Addresses-Debian-Bug: #755991
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-07-28 11:09:56 +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 5db57cfc46 swapon: share get_swap_prober() with swaplabel to print uuid and label
The swapon(8) listing was almost complete, apart from label and uuid.
This change moves the code from swaplabel(8) to shared scope to be used
for printouts in other swap commands, such as swapon.

Adding this feature to lsblk(8) was a consideration, but lsblk is not
interested of swapfiles, so the swapon seems like a better option to add
this information.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-22 12:17:20 +02:00
Benno Schulenberg 86407f2cae cfdisk: actually translate the partition types in the menu
[kzak@redhat.com: - translate also GPT types]

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-21 15:36:33 +02:00
Karel Zak a4f0a42dd2 cfdisk: use /dev/sda by default
.. this all is for backward compatibility.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-18 12:54:40 +02:00
Karel Zak d02c203512 cfdisk: make code more readable for analyzers [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-17 13:59:01 +02:00
Karel Zak a9408274b7 cfdisk: fix possible memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-17 13:46:27 +02:00
Benno Schulenberg 2ddfd9e424 cfdisk: restore the license that was lost in January
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 13:25:19 +02:00
Benno Schulenberg 9bef99ccb1 docs: improve wording and formatting of the man page of cfdisk
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-15 13:22:26 +02:00
Karel Zak 33f7c502c6 cfdisk: fix warning usage, improve 's' help
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 13:12:23 +02:00
Karel Zak bfdb3244e3 cfdisk: accept 's' as well as 'S' for sectors
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 13:01:56 +02:00
Karel Zak ad5d45c046 cfdisk: make menus sensitive to ESC
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 12:41:30 +02:00
Karel Zak 8fc37981cf cfdisk: use \n for messages on stdout and stderr
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 12:32:38 +02:00
Karel Zak bc787727d4 libfdisk: make disk sync() optional
... this allows to avoid unnecessary sync() from cfdisk.

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 12:32:03 +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
Sami Kerola 9cbf20040b mkfs.cramfs: use defined failure name rather than magic value
From manual page; 'On error, the value MAP_FAILED is returned, and errno
is set appropriately'.

Reference: http://man7.org/linux/man-pages/man2/mmap.2.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 18:35:32 +01:00
Sami Kerola 18b1fcb9cc fdformat: match variable and print format types
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 17:34:25 +01:00
Sami Kerola 3524452a71 cfdisk: add braces to ensure operation order
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 17:31:11 +01:00
Karel Zak 1bf9e264e2 fsck: uninitialized argument value [clang-analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 13:48:01 +02:00
Karel Zak a1da27a8c0 cfdisk: fix division by zero [clang-analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 13:25:46 +02: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 d121efdb6e cfdisk: add --zero command line option
The option has been supported by previous versions, we can easily
support it too.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-20 12:17:53 +02:00
Karel Zak dd626abdbe cfdisk: don't offer BSD
BSD is nested within DOS partition, so for disk without any partition
table it does not make any sense to offer BSD label.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-20 12:07:30 +02:00
Karel Zak 62acb047a6 build-sys: remove obsolete wholedisk.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-17 12:16:29 +02:00
Karel Zak 83b69e409c sfdisk: use sysfs_devno_is_wholedisk()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-17 12:16:05 +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 3bbdae633f fsck: use private lock file rather than whole-disk directly
It seems overkill to lock directly whole-disk device (for -l) when we use the
lock only to synchronize fsck instances.

It's fsck private business, so don't use system files, but let's use private
/run/fsck/<diskname>.lock file.

Addresses: https://bugs.freedesktop.org/show_bug.cgi?id=79576
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-09 11:59:44 +02:00
Karel Zak 934530c7e8 lib/fileutils: add mkdir_p() from libmount 2014-06-09 10:59:18 +02:00
Karel Zak 710ed55dcd libsmartcols: add debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-06 13:47:06 +02:00
Karel Zak ee312c654b docs: fix "behaviour" vs. "behavior"
Sometimes we use "behaviour" and "behavior" in the same text, let's
use "behavior" only everywhere.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1011068
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-06 09:49:35 +02:00
Karel Zak 7556c9443a cfdisk: resize UI on SIGWINCH
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-05 14:32:51 +02:00
Karel Zak d5314bf56f cfdisk: add [Sort] operation
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-05 12:13:41 +02:00
Ruediger Meier 60cb2c3720 build: fix some compiler warnings
Most of them catched on 32bit gcc and icc.

disk-utils/fsck.cramfs.c:     printf format type
lib/boottime.c:               unused variables
misc-utils/cal.c:             set but never used
sys-utils/losetup.c:          set but never used
sys-utils/lscpu-dmi.c:        defined but not used
sys-utils/switch_root.c:      comparison between signed and unsigned
tests/helpers/test_sysinfo.c: printf format type
2014-05-30 01:18:09 +02:00
Petr Uzel ee6369973e sfdisk: suppress Linux-irrelevant warnings with -L
Sfdisk prints out a warning about extended partition not
starting at a cylinder boundary. Since this is irrelevant
for linux, the -L option should suppress this warning.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2014-05-27 16:12:54 +02:00
Karel Zak ecc6047ecd build-sys: add BUILD_{SFDISK,BLOCKDEV,MKSWAP,IOSIZE,MKFS}
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 12:34:34 +02:00