summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* tests: skip utmpdump tests for exotic archsRuediger Meier2014-06-125-12/+26
| | | | | | | 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: merge last/ and utmpdump/ into new utmp/ dirRuediger Meier2014-06-1123-32/+51
| | | | | | | 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>
* utmpdump: fix localtime() error handlingRuediger Meier2014-06-111-2/+3
| | | | | | | | | | | 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>
* libblkid: cleanup internal return codesKarel Zak2014-06-103-27/+34
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: ignore private LVM devicesKarel Zak2014-06-106-3/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* tests: fix fdisk/bsd for big endian systemsRuediger Meier2014-06-091-0/+12
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Merge branch 'travis-functions' of https://github.com/rudimeier/util-linuxKarel Zak2014-06-092-26/+136
|\
| * travis-ci: refactor and add .travis-functions.shRuediger Meier2014-06-062-26/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'tests-hwclock' of https://github.com/rudimeier/util-linuxKarel Zak2014-06-091-21/+76
|\ \ | | | | | | | | | | | | * 'tests-hwclock' of https://github.com/rudimeier/util-linux: tests: rewrite hwclock test
| * | tests: rewrite hwclock testRuediger Meier2014-06-081-21/+76
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 fdisk_context_assign_device() commentKarel Zak2014-06-091-4/+0Star
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | fsck: use private lock file rather than whole-disk directlyKarel Zak2014-06-093-19/+58
| | | | | | | | | | | | | | | | | | | | | | 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>
* | lib/fileutils: add stripoff_last_component() from libmountKarel Zak2014-06-096-27/+15Star
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | lib/fileutils: add mkdir_p() from libmountKarel Zak2014-06-095-38/+41
| |
* | flock: document exit status of flock in man pagePhillip Susi2014-06-091-0/+3
| | | | | | | | | | The man page did not indicate that the exit status of flock is actually that of the child command, when one is run.
* | libfdisk: fix bsd_translate_fstype() for alphaRuediger Meier2014-06-091-0/+2
| | | | | | | | | | Reported-by: Tobias Klausmann <klausman@schwarzvogel.de> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | umount: Make sure exit code does not overflowNicolas Boichat2014-06-071-1/+1
|/ | | | | | | | | | | | | | | | 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>
* libsmartcols: add debug messagesKarel Zak2014-06-0617-20/+145
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: add btrfs to mount.8Gui Hecheng2014-06-061-0/+186
| | | | | | Based on Documentation/filesystems/btrfs.txt Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
* docs: fix "behaviour" vs. "behavior"Karel Zak2014-06-0612-27/+27
| | | | | | | | 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>
* cfdisk: resize UI on SIGWINCHKarel Zak2014-06-052-8/+108
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: add [Sort] operationKarel Zak2014-06-051-2/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'misc-build-sys' of https://github.com/rudimeier/util-linuxKarel Zak2014-06-0417-114/+65Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | * '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 Conflicts: Makefile.am
| * tests: fix python tests for dist and out-of-tree buildsRuediger Meier2014-06-049-8/+18
| | | | | | | | | | | | | | | | | | - add python helper scripts to the dist - helper scripts are always in srcdir - python libs are in builddir - abort tests if helpers are missing Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * build-sys: fix update-potfiles scriptRuediger Meier2014-06-041-10/+32
| | | | | | | | | | | | | | | | | | | | | | 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". Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * build-sys: restore make distcheck's configure flagsRuediger Meier2014-06-031-6/+9
| | | | | | | | | | | | | | | | | | | | They got lost with --enable-most-builds in 08b1c219. Note additionally we add --enable-gtk-doc but don't add --with-systemd because there are still many systems where systemd is not available. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * build-sys: use automake's PYTHON primary for __init__.pyRuediger Meier2014-06-032-3/+2Star
| | | | | | | | | | | | | | | | | | | | Actually the initial reason for this commit was to remove execute permission from installed __init__.py. Now after discovering automake's _PYTHON suffix we slightly cleanup Makemodule.am and we will install byte compiled .pyc and .pyo files. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: ignore deprecated lastRuediger Meier2014-06-032-0/+4
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: remove deprecated mount testsRuediger Meier2014-06-034-87/+0Star
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | build-sys: fix with_python usage, improve logicKarel Zak2014-06-041-5/+8
| | | | | | | | | | | | | | We have to set the default withval= on the default with_python=check otherwise uninitialized value is used. Signed-off-by: Karel Zak <kzak@redhat.com>
* | build-sys: add --enable-pylibmountKarel Zak2014-06-041-6/+10
| | | | | | | | | | | | | | | | | | * 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>
* | build-sys: fix ENABLE_ALLKarel Zak2014-06-031-1/+1
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix docsKarel Zak2014-06-031-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: rename libs xml/version.xml to xml/version-utils.xmlKarel Zak2014-06-037-7/+7
| | | | | | | It seems that gtk-docs stuff is confused when we use version.xml (package version) and xml/version.xml (library version functions). Signed-off-by: Karel Zak <kzak@redhat.com>
* buil-sys: disable in UL_BUILD_INIT() on --disable-all-programsKarel Zak2014-06-021-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: don't compile deprecated last(1) on --enable-all-programsKarel Zak2014-06-021-2/+3
| | | | | Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* script: fix spurious exit from input read loop on EINTR.Csaba Kos2014-06-021-1/+2
|
* script: fix a rare deadlock after child terminationCsaba Kos2014-06-021-8/+45
|
* libsmartcols: clean up test.c exampleKarel Zak2014-05-301-56/+28Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update TODOKarel Zak2014-05-301-20/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'lscpu-detect-v3' of https://github.com/rudimeier/util-linuxKarel Zak2014-05-306-4/+205
|\ | | | | | | | | | | | | | | | | * '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
| * lscpu: improve vmware detectionRuediger Meier2014-05-291-1/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch comes from openSUSE / SLE. Original author was probably Petr Uzel. Internal SUSE references: fate310255, sr226509 VMmware backdoor assembler code has been fixed for old clang compiler (travis), see see http://llvm.org/bugs/show_bug.cgi?id=9379 CC: Stanislav Brabec <sbrabec@suse.cz> CC: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: add lscpu IBM pSeries test dataRuediger Meier2014-05-292-0/+2
| | | | | | | | | | | | | | | | | | Just adding missing files /proc/device-tree/ibm,partition-name /proc/device-tree/hmc-managed? to our existing lscpu-ppc64-POWER7-64cpu dump. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * lscpu: detect OS/400 and pHyp hypervisorsRuediger Meier2014-05-292-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * tests: add vbox lscpu dumpRuediger Meier2014-05-292-0/+29
| | | | | | | | | | | | | | | | | | | | | | Taken from openSUSE-13.1 guest in VirtualBox-4.3.10 (host=Win7): Hypervisor vendor: Oracle Virtualization type: full Dump was provides by Bernhard Voelker. CC: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * lscpu: minor cleanup and improve hypervisor detectionRuediger Meier2014-05-292-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | - add HYPER_VBOX - improve HYPER_VMWARE This patch comes from openSUSE / SLE. Original author was probably Petr Uzel. Internal SUSE references: fate310255, sr226509 CC: Stanislav Brabec <sbrabec@suse.cz> CC: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | libblkid: (zfs) let's keep compiler happyKarel Zak2014-05-301-1/+1
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | Merge branch 'warnings-squashed' of https://github.com/rudimeier/util-linuxKarel Zak2014-05-307-9/+11
|\ \ | | | | | | | | | | | | * 'warnings-squashed' of https://github.com/rudimeier/util-linux: build: fix some compiler warnings
| * | build: fix some compiler warningsRuediger Meier2014-05-307-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | libfdisk: (gpt) fix last LBA code for S_ISREGKarel Zak2014-05-301-6/+9
|/ / | | | | | | | | Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>