Commit Graph

557 Commits

Author SHA1 Message Date
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
Karel Zak 3d9fdac5ea build-sys: add --disable-minix
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 12:13:12 +02:00
Karel Zak deedae5f5c fsck.cramfs: cleanup usage() and warning messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-20 10:32:57 +02:00
Ruediger Meier ae2f9c71ae mkfs.cramfs: fix crash when -b 0
Now -b 0 gives us the default (page size) like we do it in
fsck.cramfs.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:29 +02:00
Ruediger Meier dfd7dbb468 fsck.cramfs: update man page (--extract and --blocksize)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:26 +02:00
Ruediger Meier 2c972db424 tests: remove test_fsck.cramfs (reverts 6c32ae78)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:22 +02:00
Ruediger Meier 34731f89c7 fsck.cramfs: remove define INCLUDE_FS_TESTS
There is only one non-trivial issue where we now print a
warning instead of exit error.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:06 +02:00
Ruediger Meier 2d317f117b fsck.cramfs: refactor option -x/--extract
We want to clean it up to compile it later per default (not only
if defined INCLUDE_FS_TESTS).

- Rename option --destination to --extract.
- DIR argument is now optional because we want to keep the use
  case "test uncompression without writing files" ... but we
  don't want it always.
- Remove shortopt -x because shortopts with optional args are
  evil.

Changing the cmd interface is no compatibility issue here because
all affected options errored out per default in past.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 15:07:17 +02:00
Ruediger Meier 5cd50ebc96 fsck.cramfs: add option --blocksize
.. similar to mkfs.cramfs

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:48 +02:00
Ruediger Meier 38141baff6 fsck.cramfs: rename variable page_size to blksize
... similar to mkfs.cramfs.c

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:44 +02:00
Ruediger Meier b7a7520692 fsck.cramfs: ifdef unused outbuffer and page_size
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:39 +02:00
Ruediger Meier f991dbd31f fsck.cramfs: allow smaller superblock sizes
We are already fine with checking for different endianess. Now we
also succeed if systems's page size does not match.

Note that page_size is only really used if INCLUDE_FS_TESTS is
defined, see followups.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:19:29 +02:00
Karel Zak 538c18569e cfdisk: update man page COLORS section
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:13:02 +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
Karel Zak e66a662726 lib/colors: allow to temporary disable colors
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:09:02 +02:00
Karel Zak a08fa9ab57 cfdisk: fix compiler warning [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 09:58:58 +02:00
Benno Schulenberg aa06617f6e textual: remove square brackets from around three dots
Also improve some option descriptions here and there.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-05-06 11:12:13 +02:00
Sami Kerola 24f83f7392 swapon, swapheader, mkswap: move swap signature to header
Both swapon and mkswap need to know what is valid device signature, so
share the value.

[kzak@redhat.com: - use SWAP_SIGNATURE_SZ properly in write_signature()]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 10:16:54 +02:00
Sami Kerola 506b499991 mkswap: remove legacy swap structure
If software archeolgists want to know how the old, and unused, swap
header looked they can dig it from the revision history.

[kzak@redhat.com: - use sizeof() for SWAP_HEADER_SIZE]

Reference: 4c85aa3a4c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 10:08:51 +02:00
Sami Kerola 8a101b1447 mkswap, swaplabel: move version number to header
Corrently only the swap version 1 is supported, which is a magic value so
move it to header.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-04 11:42:03 +01:00
Bjarni Ingi Gislason 46b11619a1 swaplabel: Improve the typesetting of the manual
Change macro 'IR' to 'I' if it has only one (italic) argument

  Remove space at end of lines

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2014-04-22 12:14:38 +02:00
Bjarni Ingi Gislason 2ad6d4fefe sfdisk: Improve the typesetting of the manual
FIXME
  Units KB, MB, GB, etc. are ambiguous (not necessarily used here)
  Prefixes kilo, mega, giga, etc. are ambiguous with the unit byte (ditto)

  Change ' \- ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)

  Change ' - ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)

  Change '\-' to '-' (code "hyphen-minus", rendered with the glyph
hyphen in troff), if it is a part of a compound name.
  A minus is not used in words.  People using UTF-8 and copy-and-paste
can(?) (may?) use "info", "man --ascii" or the command "man" should
have an option to display the '-' ("hyphen-minus") in names of options
with the code (character name) "hyphen-minus" (u002D) instead of
"u2010" (code (character) name "hyphen").

  Change '-' to '\-', if it indicates an option

  Protect a full stop (.), that begins or ends a string, with \&

  Correct space between sentences to two space characters (or begin
each sentence on a new line).

  Change '--' to '\-\-', if it indicates an option

  Add \~ (no-break space) around '|' (means "or")

  Change ' -- ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2014-04-22 12:14:28 +02:00
Bjarni Ingi Gislason 930f40e319 raw: Improve the typesetting of the manual
Remove space at end of lines

  Change '-' to '\-', if it indicates an option

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2014-04-22 12:14:17 +02:00
Bjarni Ingi Gislason b4261b5eda partx: Improve the typesetting of the manual
Add a space character around '|' (means "or")

  Add "(hyphen-minus)" after "\-" to show character name for input

  Change '\-\-' to '\en', when it is used as a dash (pause, separation)

  Add a comma before "or" in a series of words (3 or more)

  Change '-' to '\(en' (an en-dash), if it means a range

  Protect a full stop (.), that begins or ends a string, with \&

  Change '--' to '\-\-', if it indicates an option

  Change '-' to '\-', if it indicates an option

  Change '-' to '\-', if means a minus

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2014-04-22 12:14:10 +02:00
Karel Zak dd7ba60463 libfdisk: add partitions reorder operation to label API
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-18 13:26:08 +02:00
Karel Zak 8b60872ec0 libfdisk: add generic function to check partitions order
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-16 12:51:08 +02:00
Ondrej Oprala b32fc3bb32 delpart: minor man page improvements
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:46:05 +02:00
Ondrej Oprala df0a8e7a78 cfdisk: minor man page improvements
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:46:04 +02:00
Ondrej Oprala d2d5466d77 addpart: minor man page improvements
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:46:02 +02:00