libfdisk: fix logical partition reorder command

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: make new_partition() more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols: fix buffer usage

Signed-off-by: Karel Zak <kzak@redhat.com>
fallocate: introduce an option -c to support COLLAPSE_RANGE

Introduce a new option -c (or --collapse-range) to support a new flag
FALLOC_FL_COLLAPSE_RANGE for fallocate(2). It will nullify a particular
range [offset, offset+len] by shifting extents beyond the range to the
beginning of the hole.

Cc: Lukas Czerner <lczerner@redhat.com>
Cc: Namjae Jeon <namjae.jeon@samsung.com>
Cc: Ashish Sangwan <a.sangwan@samsung.com>
Signed-off-by: Dongsu Park <dongsu.park@profitbricks.com>
fallocate: add FALLOC_FL_ZERO_RANGE support

Recent Linux kernel supports FALLOC_FL_ZERO_RANGE in fallocate(2).
This patch adds FALLOC_FL_ZERO_RANGE support to fallocate utility,
by introducing a new option -z|--zero-range.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
unshare: add + to getopt_long()

Signed-off-by: Karel Zak <kzak@redhat.com>
nsenter: add + to getopt_long()

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: add partitions reorder operation to label API

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (gpt) implement 'fix order' commnad

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: fdisk added a partitions order message (8b60872e)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
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>
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>
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>
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>
Merge branch 'test-fdisk' of https://github.com/rudimeier/util-linux
libfdisk: (mbr) fix logical chain termination

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: (dos) improve logical partition reorder command

 - use qsort to sort by EBR offsets
 - sort by EBR data partition start sectors

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: add fdisk 'f' command MBR test

Signed-off-by: Karel Zak <kzak@redhat.com>
Revert "dmesg: don't use brow/yellow in output"

It will be better to support colors customization than use
ugly blue color. BTW, for example git-log uses brow/yellow too
by default.

This reverts commit 0b6fbc25990d9498956e06bfcf699fca094e24a9.
tests: update fdisk sun test

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