Karel Zak [Mon, 16 Jun 2014 13:47:50 +0000 (15:47 +0200)]
findmnt: add --nocanonicalize to avoid realpath()
* in some cases is realpath() overkill
* sometimes you want to search for explicitly specified paths (e.g.
"findmnt --fstab /mnt/symlink") rather than for real paths
* you want to avoid readlink() and stat() on NFS
Thomas Petazzoni [Thu, 12 Jun 2014 20:10:27 +0000 (22:10 +0200)]
Only move shared libraries to /lib if they exists
In several Makemodule.am, there is a install-exec-hook-<library>
target whose role is to move the shared library from /usr/lib to /lib,
while keeping a symbolic link /usr/lib/libuuid.so ->
../../lib/<library>.so.<version>.
However, when util-linux is built with --enable-static
--disable-shared (as is needed on noMMU platforms that don't support
shared libraries), no <library>.so is built, but the
install-exec-hook-libuuid creates an invalid /usr/lib/<library>.so
symbolic link, pointing to ../../lib (yes, the directory). This causes
troubles later one when other libraries/programs are compiled with
-l<library>, as gcc thinks a shared library is available because
there's a file named /usr/lib/<library>.so.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Karel Zak [Mon, 16 Jun 2014 12:37:39 +0000 (14:37 +0200)]
Merge branch 'tests-utmp' of https://github.com/rudimeier/util-linux
* 'tests-utmp' of https://github.com/rudimeier/util-linux:
tests: skip some last tests if no dns support
tests: split last into dns and nodns subtests
tests: add utmpdump-circle test (arch independent)
tests: provide missing test data for "last" on exotic archs
tests: skip utmpdump tests for exotic archs
tests: merge last/ and utmpdump/ into new utmp/ dir
utmpdump: fix localtime() error handling
Ruediger Meier [Wed, 11 Jun 2014 15:31:56 +0000 (17:31 +0200)]
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.
Ruediger Meier [Tue, 10 Jun 2014 16:44:08 +0000 (18:44 +0200)]
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.
Karel Zak [Tue, 10 Jun 2014 10:16:59 +0000 (12:16 +0200)]
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.
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>
Ruediger Meier [Fri, 6 Jun 2014 11:40:48 +0000 (13:40 +0200)]
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.
Nicolas Boichat [Sat, 7 Jun 2014 13:38:00 +0000 (21:38 +0800)]
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>
Ruediger Meier [Sun, 1 Jun 2014 22:58:01 +0000 (00:58 +0200)]
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.
Karel Zak [Wed, 4 Jun 2014 12:16:22 +0000 (14:16 +0200)]
Merge branch 'misc-build-sys' of https://github.com/rudimeier/util-linux
* 'misc-build-sys' of https://github.com/rudimeier/util-linux:
tests: fix python tests for dist and out-of-tree builds
build-sys: fix update-potfiles script
build-sys: restore make distcheck's configure flags
build-sys: use automake's PYTHON primary for __init__.py
tests: ignore deprecated last
tests: remove deprecated mount tests
Karel Zak [Wed, 4 Jun 2014 09:16:48 +0000 (11:16 +0200)]
build-sys: add --enable-pylibmount
* globally disable all Python bindings by --without-python
* use --with-python=<version> to specify Python version
* --enable-pylibmount to override --disable-all-programs
Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Ruediger Meier [Tue, 3 Jun 2014 17:07:37 +0000 (19:07 +0200)]
build-sys: fix update-potfiles script
Now are using "git ls-files" to avoid finding non-project
files or autoheaders which could break the dist tarball.
For non-git source dirs we assume that any existing POTFILES.in is
up-todate (build from tarball) or we provide at least an empty list
to not be a show-stopper for builds from poor "git archive".
Karel Zak [Fri, 30 May 2014 10:01:27 +0000 (12:01 +0200)]
Merge branch 'lscpu-detect-v3' of https://github.com/rudimeier/util-linux
* 'lscpu-detect-v3' of https://github.com/rudimeier/util-linux:
lscpu: improve vmware detection
tests: add lscpu IBM pSeries test data
lscpu: detect OS/400 and pHyp hypervisors
tests: add vbox lscpu dump
lscpu: minor cleanup and improve hypervisor detection
Ruediger Meier [Thu, 29 May 2014 23:18:09 +0000 (01:18 +0200)]
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
Ruediger Meier [Tue, 20 May 2014 11:26:48 +0000 (11:26 +0000)]
lscpu: detect OS/400 and pHyp hypervisors
This patch comes originally from openSUSE / SLE. Author was probably
Petr Uzel.
Internal SUSE references: fate310255, sr226509
In comparison to the original patch we have slightly corrected iSeries
and pSeries detection according to Alexander Graf's comments on
util-linux@vger.kernel.org. Maybe we would need to add some more code
to detect pSeries emulated by Qemu/KVM.
CC: Stanislav Brabec <sbrabec@suse.cz> CC: Petr Uzel <petr.uzel@suse.cz> CC: Alexander Graf <agraf@suse.de> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Karel Zak [Thu, 29 May 2014 10:48:40 +0000 (12:48 +0200)]
lslogins: clean up password hash check
* rename to PWD-* column names
* add PWD-DENY for accounts where is no possible to login by password
* PWD-LOCK (was LOCKED) checks for valid but locked pawwords
* LOGIN renamed to USER
Karel Zak [Thu, 29 May 2014 09:37:15 +0000 (11:37 +0200)]
lslogins: remove --sort-by-name
If we really need a sort functionality hardcoded into lslogins(1) then we need
a generic sort options (like for lsblk,--sort <column>).
Note that it seems that "lslogins | sort --key <col>" is good enough for now as
lslogins(1) does not convert any data to human readable non-precise format (like
for example lsblk SIZE column etc.).
Karel Zak [Wed, 28 May 2014 07:37:41 +0000 (09:37 +0200)]
Merge branch 'tests-stuff' of https://github.com/rudimeier/util-linux
* 'tests-stuff' of https://github.com/rudimeier/util-linux:
tests: split off losetup scsi_debug part
tests: fix, typo schedutils/cpuset
tests: run tests in deterministic order
tests: ts_scsi_debug_init skip instead of die
Stanislav Brabec [Tue, 27 May 2014 18:38:17 +0000 (20:38 +0200)]
losetup: don't ignore EBUSY in losetup when the loop device is given
losetup ignores the EBUSY error. In the loop fo A_CREATE action, it skips
the error handling when errno = EBUSY. It's OK for the case where no loop
device is specified, but the error has to be handled when the device is given
explicitly.
Author: Takashi Iwai <tiwai@suse.de> Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Stanislav Brabec [Tue, 27 May 2014 18:38:10 +0000 (20:38 +0200)]
losetup: don't clear FD at EBUSY error in loopcxt_setup_device()
loopback lib clears the existing FD unconditionally at error in
loopcxt_setup_device(). This is done even after EBUSY, thus the second call
actually clears the previous setup wrongly.
Author: Takashi Iwai <tiwai@suse.de> Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Petr Uzel [Mon, 26 May 2014 16:28:03 +0000 (18:28 +0200)]
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.