cfdisk: add [Sort] operation

Signed-off-by: Karel Zak <kzak@redhat.com>
cfdisk: resize UI on SIGWINCH

Signed-off-by: Karel Zak <kzak@redhat.com>
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>
mount: add btrfs to mount.8

Based on Documentation/filesystems/btrfs.txt

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
libsmartcols: add debug messages

Signed-off-by: Karel Zak <kzak@redhat.com>
travis-ci: refactor and add .travis-functions.sh

Travis yaml syntax, where we can only use shell one-liners, is awful
and ugly. We add a real shell script and source it from .travis.yml.

This commit squashes a lot changes because we don't want to pollute
history with this meta CI stuff.

Highlights of this commit:
  - enable make distcheck
  - cleanup configure options (enable all progs, with python and docs)
  - shorter config.log dump
  - out-of-tree build supported
  - workaround broken libtool on travis host
  - now it's easy to add temporary debugging stuff
  - testing locally is possible now

What are we testing now:
  - gcc and clang compiler
  - configure mostly with --enable-all-programs, --with-python and
    --enable-gtk-doc
  - make check with and without root permissions
  - make distcheck
  - make install (with and without --prefix as well as DESTDIR=...)
  - usually we always build in-tree but distcheck does out-of-tree

What do we want/expect at all:
  - This travis setup is intended to always work without fixing or
    updating this build script all the time. Thats why we only use a
    few configure flags.
  - We want to avoid predictable failures on travis host to not make
    developers tired of this machinery. Any tested feature which is
    known to be (sometimes) broken should be fixed or skipped as soon
    as possible.
  - If this works like wanted then in future almost any point in master
    commit history should at least survive the build and common tests
    on this reference host/arch. Moreover we will have a comparable,
    deterministic build log history. This could make bisecting real
    bugs easier.
  - It's not our goal to test any kind of config flags, host setup and
    arch combination. This would be done better by external build
    scripts which do not live within the project itself.
  - Of course this machinery can be also used to reproduce bugs with
    more exotic config and host setup by pushing a debug branch with
    modified travis script to github.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
umount: Make sure exit code does not overflow

POSIX exit code is only 8-bit, and since umount sums up error
codes, it can sometimes report success (exit code 0) even though
a number of operations failed.

For example, running, in an empty directory:
 umount `seq 1 7`
returns 224 (7*32), since none of the 7 mount point exists but
 umount `seq 1 8`
returns 0 (8*32=256)

This patch clips the return value to 255.

Signed-off-by: Nicolas Boichat <nicolas@boichat.ch>
tests: rewrite hwclock test

Major changes:
 - don't use deprecated ntpdate but sntp client
 - don't update sys time from ntp, just compare offsets
 - now hwclock is the only command which needs root permissions
 - resolve ntp server to one fixed IP to get comparable offsets
   always from the same remote machine
 - don't enter the systohc/hctosys loop if not even --show works
 - verbose but not too ugly debug output

Note, maybe later the resolve_host function could be moved to functions.sh
because other tests (e.g. last) should check whether dns is available.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
libfdisk: fix bsd_translate_fstype() for alpha

Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
flock: document exit status of flock in man page

The man page did not indicate that the exit status of flock
is actually that of the child command, when one is run.
lib/fileutils: add mkdir_p() from libmount
lib/fileutils: add stripoff_last_component() from libmount

Signed-off-by: Karel Zak <kzak@redhat.com>
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>
libfdisk: fix fdisk_context_assign_device() comment

Signed-off-by: Karel Zak <kzak@redhat.com>
Merge branch 'tests-hwclock' of https://github.com/rudimeier/util-linux

* 'tests-hwclock' of https://github.com/rudimeier/util-linux:
  tests: rewrite hwclock test
Merge branch 'travis-functions' of https://github.com/rudimeier/util-linux
tests: fix fdisk/bsd for big endian systems

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>