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>
libblkid: ignore private LVM devices

The virtual private LVM devices do not contain any blkid relevant data
and it does not make any sense to scan for superblocks or partitions
on the devices, because we can interpret data from the devices in bad
way.

Unfortunately, for LVM has "private" very special meaning. The private
LVM devices are accessible and readable (according to LVM guys it's
feature, because debugging etc.).

The problem is pretty visible with LVM thin provisioning where a virtual
pool device contains segments from the top-level thin devices.

Mountable top-level LVM-thin device:

	# blkid -o udev -p /dev/mapper/vg-thin1
	ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c
	ID_FS_TYPE=ext4

Virtual private LVM-pool device (contains data from all thin devices):

	# blkid -o udev -p /dev/mapper/vg-pool0
	ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c
	ID_FS_TYPE=ext4

... this is incorrect, vg-pool0 is unmountable.

LVM uses special UUID suffixes for private devices. All devices with
uuid in format "LVM-<uuid>-<type>" are private.

This patch modifies libblkid to not scan such devices. The high-level
API ignores such devices at all now.

The low-level API allows to assign the device to blkid_prober, but all
scan functions always return nothing and library does not read
anything from the device. The another functionality (get parental
device, topology, sector sizes, etc.) still works as expected. The
change affects only probing code.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1101345
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: cleanup internal return codes

Signed-off-by: Karel Zak <kzak@redhat.com>
build-sys: use gettext 0.18.3 if possible

We add a little hack for backward compatibility on systems with
older gettext installed

See 0576dbd3 and 81ed13ed.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
build-sys: fix autopoint gettext version fun

We avoid or fix many portability issues.

The first more generic "sort --version-sort" solution was almost
useless anyway because autopoint itself can also only deal with
a few hardcoded versions.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
utmpdump: fix localtime() error handling

If current TZ has no representation of a given time_t then localtime()
would return NULL and break the next strftime().

In practice this happens very likely on systems with 64bit time_t when
parsing broken binary data. Seen on aarch64 (and probably s390) using
our (incompatible) test wtmp data.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: merge last/ and utmpdump/ into new utmp/ dir

We want to prepare and simplify utmp sepcific fixes. Beside all this
renaming we also update/add some text data to have it more consistent.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: skip utmpdump tests for exotic archs

We introduce utmp_functions.sh and skip tests if size of utmp struct
does not match our wtmp test data.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: provide missing test data for "last" on exotic archs

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: add utmpdump-circle test (arch independent)

This one is a completely arch independent conversion round:
  text -> bin -> text -> bin

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: split last into dns and nodns subtests

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: skip some last tests if no dns support

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
rename: remove reference to mmv gtom man page

It seems better to not have a reference to the program that is not
available in many cases on usual Linux installation.

Signed-off-by: Karel Zak <kzak@redhat.com>
mount: more hints about default mount options to man page

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