]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
11 years agotests: fix fdisk/bsd for big endian systems
Ruediger Meier [Thu, 29 May 2014 17:52:52 +0000 (19:52 +0200)] 
tests: fix fdisk/bsd for big endian systems

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agoMerge branch 'travis-functions' of https://github.com/rudimeier/util-linux
Karel Zak [Mon, 9 Jun 2014 10:18:47 +0000 (12:18 +0200)] 
Merge branch 'travis-functions' of https://github.com/rudimeier/util-linux

11 years agoMerge branch 'tests-hwclock' of https://github.com/rudimeier/util-linux
Karel Zak [Mon, 9 Jun 2014 10:13:18 +0000 (12:13 +0200)] 
Merge branch 'tests-hwclock' of https://github.com/rudimeier/util-linux

* 'tests-hwclock' of https://github.com/rudimeier/util-linux:
  tests: rewrite hwclock test

11 years agolibfdisk: fix fdisk_context_assign_device() comment
Karel Zak [Mon, 9 Jun 2014 10:09:18 +0000 (12:09 +0200)] 
libfdisk: fix fdisk_context_assign_device() comment

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agofsck: use private lock file rather than whole-disk directly
Karel Zak [Mon, 9 Jun 2014 09:59:44 +0000 (11:59 +0200)] 
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>
11 years agolib/fileutils: add stripoff_last_component() from libmount
Karel Zak [Mon, 9 Jun 2014 09:54:32 +0000 (11:54 +0200)] 
lib/fileutils: add stripoff_last_component() from libmount

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolib/fileutils: add mkdir_p() from libmount
Karel Zak [Mon, 9 Jun 2014 08:59:18 +0000 (10:59 +0200)] 
lib/fileutils: add mkdir_p() from libmount

11 years agoflock: document exit status of flock in man page
Phillip Susi [Tue, 3 Jun 2014 13:55:52 +0000 (09:55 -0400)] 
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.

11 years agolibfdisk: fix bsd_translate_fstype() for alpha
Ruediger Meier [Sun, 8 Jun 2014 13:32:48 +0000 (15:32 +0200)] 
libfdisk: fix bsd_translate_fstype() for alpha

Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: rewrite hwclock test
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.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agoumount: Make sure exit code does not overflow
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>
11 years agotravis-ci: refactor and add .travis-functions.sh
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.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agolibsmartcols: add debug messages
Karel Zak [Fri, 6 Jun 2014 11:47:06 +0000 (13:47 +0200)] 
libsmartcols: add debug messages

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agomount: add btrfs to mount.8
Gui Hecheng [Thu, 5 Jun 2014 02:05:19 +0000 (10:05 +0800)] 
mount: add btrfs to mount.8

Based on Documentation/filesystems/btrfs.txt

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
11 years agodocs: fix "behaviour" vs. "behavior"
Karel Zak [Fri, 6 Jun 2014 07:49:35 +0000 (09:49 +0200)] 
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>
11 years agocfdisk: resize UI on SIGWINCH
Karel Zak [Thu, 5 Jun 2014 12:32:51 +0000 (14:32 +0200)] 
cfdisk: resize UI on SIGWINCH

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agocfdisk: add [Sort] operation
Karel Zak [Thu, 5 Jun 2014 10:13:41 +0000 (12:13 +0200)] 
cfdisk: add [Sort] operation

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'misc-build-sys' of https://github.com/rudimeier/util-linux
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

Conflicts:
Makefile.am

11 years agobuild-sys: fix with_python usage, improve logic
Karel Zak [Wed, 4 Jun 2014 11:43:15 +0000 (13:43 +0200)] 
build-sys: fix with_python usage, improve logic

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>
11 years agobuild-sys: add --enable-pylibmount
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>
11 years agotests: fix python tests for dist and out-of-tree builds
Ruediger Meier [Tue, 3 Jun 2014 22:17:58 +0000 (00:17 +0200)] 
tests: fix python tests for dist and out-of-tree builds

- 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>
11 years agobuild-sys: fix update-potfiles script
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".

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agobuild-sys: restore make distcheck's configure flags
Ruediger Meier [Mon, 2 Jun 2014 21:59:07 +0000 (23:59 +0200)] 
build-sys: restore make distcheck's configure flags

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>
11 years agobuild-sys: use automake's PYTHON primary for __init__.py
Ruediger Meier [Mon, 2 Jun 2014 14:34:47 +0000 (16:34 +0200)] 
build-sys: use automake's PYTHON primary for __init__.py

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>
11 years agotests: ignore deprecated last
Ruediger Meier [Mon, 2 Jun 2014 20:59:27 +0000 (22:59 +0200)] 
tests: ignore deprecated last

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: remove deprecated mount tests
Ruediger Meier [Sun, 1 Jun 2014 19:43:34 +0000 (21:43 +0200)] 
tests: remove deprecated mount tests

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agobuild-sys: fix ENABLE_ALL
Karel Zak [Tue, 3 Jun 2014 10:52:33 +0000 (12:52 +0200)] 
build-sys: fix ENABLE_ALL

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibsmartcols: fix docs
Karel Zak [Tue, 3 Jun 2014 10:41:58 +0000 (12:41 +0200)] 
libsmartcols: fix docs

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodocs: rename libs xml/version.xml to xml/version-utils.xml
Karel Zak [Tue, 3 Jun 2014 10:37:33 +0000 (12:37 +0200)] 
docs: rename libs xml/version.xml to xml/version-utils.xml

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>
11 years agobuil-sys: disable in UL_BUILD_INIT() on --disable-all-programs
Karel Zak [Mon, 2 Jun 2014 09:34:21 +0000 (11:34 +0200)] 
buil-sys: disable in UL_BUILD_INIT() on --disable-all-programs

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: don't compile deprecated last(1) on --enable-all-programs
Karel Zak [Mon, 2 Jun 2014 09:21:35 +0000 (11:21 +0200)] 
build-sys: don't compile deprecated last(1) on --enable-all-programs

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoscript: fix spurious exit from input read loop on EINTR.
Csaba Kos [Fri, 30 May 2014 09:40:15 +0000 (18:40 +0900)] 
script: fix spurious exit from input read loop on EINTR.

11 years agoscript: fix a rare deadlock after child termination
Csaba Kos [Fri, 30 May 2014 05:33:32 +0000 (14:33 +0900)] 
script: fix a rare deadlock after child termination

11 years agolibsmartcols: clean up test.c example
Karel Zak [Fri, 30 May 2014 12:17:29 +0000 (14:17 +0200)] 
libsmartcols: clean up test.c example

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agodocs: update TODO
Karel Zak [Fri, 30 May 2014 11:50:10 +0000 (13:50 +0200)] 
docs: update TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'lscpu-detect-v3' of https://github.com/rudimeier/util-linux
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

11 years agolibblkid: (zfs) let's keep compiler happy
Karel Zak [Fri, 30 May 2014 09:27:41 +0000 (11:27 +0200)] 
libblkid: (zfs) let's keep compiler happy

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'warnings-squashed' of https://github.com/rudimeier/util-linux
Karel Zak [Fri, 30 May 2014 09:26:43 +0000 (11:26 +0200)] 
Merge branch 'warnings-squashed' of https://github.com/rudimeier/util-linux

* 'warnings-squashed' of https://github.com/rudimeier/util-linux:
  build: fix some compiler warnings

11 years agolibfdisk: (gpt) fix last LBA code for S_ISREG
Karel Zak [Fri, 30 May 2014 08:51:53 +0000 (10:51 +0200)] 
libfdisk: (gpt) fix last LBA code for S_ISREG

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild: fix some compiler warnings
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

11 years agolslogins: fix pretty-print columns
Karel Zak [Thu, 29 May 2014 13:08:26 +0000 (15:08 +0200)] 
lslogins: fix pretty-print columns

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: cleanup some command line options
Karel Zak [Thu, 29 May 2014 13:05:10 +0000 (15:05 +0200)] 
lslogins: cleanup some command line options

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: cleanup default outputs
Karel Zak [Thu, 29 May 2014 12:48:45 +0000 (14:48 +0200)] 
lslogins: cleanup default outputs

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: cleanup -a output
Karel Zak [Thu, 29 May 2014 12:17:41 +0000 (14:17 +0200)] 
lslogins: cleanup -a output

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: improve COL_PWD_WARN and COL_NPROCS desc
Karel Zak [Thu, 29 May 2014 11:37:58 +0000 (13:37 +0200)] 
lslogins: improve COL_PWD_WARN and COL_NPROCS desc

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: cleanup usage()
Karel Zak [Thu, 29 May 2014 11:32:03 +0000 (13:32 +0200)] 
lslogins: cleanup usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: fix nologins check
Karel Zak [Thu, 29 May 2014 11:24:35 +0000 (13:24 +0200)] 
lslogins: fix nologins check

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: cleanup time formats
Karel Zak [Thu, 29 May 2014 11:21:57 +0000 (13:21 +0200)] 
lslogins: cleanup time formats

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolscpu: improve vmware detection
Ruediger Meier [Tue, 20 May 2014 11:26:48 +0000 (11:26 +0000)] 
lscpu: improve vmware detection

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>
11 years agotests: add lscpu IBM pSeries test data
Ruediger Meier [Wed, 28 May 2014 19:15:24 +0000 (21:15 +0200)] 
tests: add lscpu IBM pSeries test data

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>
11 years agolscpu: detect OS/400 and pHyp hypervisors
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>
11 years agotests: add vbox lscpu dump
Ruediger Meier [Tue, 20 May 2014 12:18:04 +0000 (12:18 +0000)] 
tests: add vbox lscpu dump

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>
11 years agolslogins: clean up password hash check
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

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: add sys-utils/uname26.8 to gitignore
Karel Zak [Thu, 29 May 2014 09:50:44 +0000 (11:50 +0200)] 
build-sys: add sys-utils/uname26.8 to gitignore

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: remove --sort-by-name
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.).

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: improve nologins and shadow usage
Karel Zak [Thu, 29 May 2014 09:28:39 +0000 (11:28 +0200)] 
lslogins: improve nologins and shadow usage

 * fix coding style
 * don't require shadow entries
 * check for /var/run/nologin

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agosetarch: add generic support for setarch $(uname -m) ...
Ruediger Meier [Thu, 29 May 2014 00:53:18 +0000 (02:53 +0200)] 
setarch: add generic support for setarch $(uname -m) ...

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolscpu: minor cleanup and improve hypervisor detection
Ruediger Meier [Tue, 20 May 2014 11:26:48 +0000 (11:26 +0000)] 
lscpu: minor cleanup and improve hypervisor detection

- 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>
11 years agobuild-sys: fix typo, set HAVE_LIBUUID
Karel Zak [Wed, 28 May 2014 08:05:22 +0000 (10:05 +0200)] 
build-sys: fix typo, set HAVE_LIBUUID

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: enable chfn and chsh by default
Karel Zak [Wed, 28 May 2014 07:57:55 +0000 (09:57 +0200)] 
build-sys: enable chfn and chsh by default

The util-linux version (is the best:-) uses libuser,
so it usable for non-local users (LDAP, etc.).

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'tests-stuff' of https://github.com/rudimeier/util-linux
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

11 years agolosetup: don't ignore EBUSY in losetup when the loop device is given
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>
11 years agolosetup: don't clear FD at EBUSY error in loopcxt_setup_device()
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>
11 years agolslogins: print systemd journal logs
Karel Zak [Tue, 27 May 2014 15:34:15 +0000 (17:34 +0200)] 
lslogins: print systemd journal logs

Co-Author: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild_sys: fix default estate usage
Karel Zak [Tue, 27 May 2014 15:22:28 +0000 (17:22 +0200)] 
build_sys: fix default estate usage

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolslogins: count per-user processes
Ondrej Oprala [Mon, 19 May 2014 10:25:06 +0000 (12:25 +0200)] 
lslogins: count per-user processes

[kzak@redhat.com: - rename column, align to right]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoMerge branch 'setterm' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Tue, 27 May 2014 14:23:46 +0000 (16:23 +0200)] 
Merge branch 'setterm' of git://github.com/kerolasa/lelux-utiliteetit

* 'setterm' of git://github.com/kerolasa/lelux-utiliteetit:
  docs: setterm.1 clean up manual page groff style
  docs: setterm.1 add options compatibility note
  docs: setterm.1 add missing options to manual page and remove duplicate
  setterm: add usage() descriptions

11 years agoMerge branch 'uuid' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Tue, 27 May 2014 14:15:30 +0000 (16:15 +0200)] 
Merge branch 'uuid' of git://github.com/kerolasa/lelux-utiliteetit

11 years agocal: all output must use my_putstring
Ruediger Meier [Tue, 27 May 2014 13:07:05 +0000 (15:07 +0200)] 
cal: all output must use my_putstring

Replace all puts, fputs and printf calls by my_putstring() because
we don't want to mix different output channels (buffers).

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agosfdisk: suppress Linux-irrelevant warnings with -L
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.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
11 years agodocs: update howto regards to build-system changes
Karel Zak [Tue, 27 May 2014 13:37:26 +0000 (15:37 +0200)] 
docs: update howto regards to build-system changes

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: split off losetup scsi_debug part
Ruediger Meier [Mon, 26 May 2014 22:43:37 +0000 (00:43 +0200)] 
tests: split off losetup scsi_debug part

It's a pity that we would skip the whole test if scsi_debug is not
available.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agodocs: remove obsolete cfdisk.txt
Karel Zak [Tue, 27 May 2014 13:18:35 +0000 (15:18 +0200)] 
docs: remove obsolete cfdisk.txt

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: add missing dependencies to libsmartcols
Karel Zak [Tue, 27 May 2014 09:45:24 +0000 (11:45 +0200)] 
build-sys: add missing dependencies to libsmartcols

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: fix UL_BUILD_INIT()
Karel Zak [Tue, 27 May 2014 12:58:14 +0000 (14:58 +0200)] 
build-sys: fix UL_BUILD_INIT()

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: add disable-all.conf to config-gen
Karel Zak [Tue, 27 May 2014 09:37:18 +0000 (11:37 +0200)] 
build-sys: add disable-all.conf to config-gen

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: add --disable-all-programs
Karel Zak [Tue, 27 May 2014 09:34:15 +0000 (11:34 +0200)] 
build-sys: add --disable-all-programs

This is necessary to build only explicitly specified program/library,
for example to build only libblkid.so

   ./configure --disable-all-programs --enable-libblkid

or to build only hwclock(8):

   ./configure --disable-all-programs --enable-hwclock

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: add UL_DEFAULT_ENABLE() and $ul_default_estate
Karel Zak [Tue, 27 May 2014 09:33:48 +0000 (11:33 +0200)] 
build-sys: add UL_DEFAULT_ENABLE() and $ul_default_estate

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agotests: fix, typo schedutils/cpuset
Ruediger Meier [Mon, 26 May 2014 12:05:45 +0000 (14:05 +0200)] 
tests: fix, typo schedutils/cpuset

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: run tests in deterministic order
Ruediger Meier [Wed, 21 May 2014 13:04:55 +0000 (13:04 +0000)] 
tests: run tests in deterministic order

Not really needed but it makes debugging of existing build logs
much more easier.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: ts_scsi_debug_init skip instead of die
Ruediger Meier [Wed, 21 May 2014 23:37:17 +0000 (01:37 +0200)] 
tests: ts_scsi_debug_init skip instead of die

If any of these modprobe commands fails then it's not a broken test.
ALso ts_die often does not work correctly from subtests which should
be fixed someday too.

BTW modprobe dry-run (even the real modprobe) is not reliable.
Moreover now we respect blacklisted modules (-b).

This error handling is not only useful to let the test-suite succeed
on broken systems but also to not fail all "scsi_debug tests" after
just one of them failed to umount something.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agouuidd: do not mix signed type and unsigned code
Sami Kerola [Sat, 24 May 2014 17:49:53 +0000 (18:49 +0100)] 
uuidd: do not mix signed type and unsigned code

Both the strtou32_or_err() and alarm() expect timeout to be unsigned.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agouuidgen: use type definitions from uuid.h
Sami Kerola [Sat, 24 May 2014 17:41:08 +0000 (18:41 +0100)] 
uuidgen: use type definitions from uuid.h

There is no need to re-invent wheel.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agouuidd: set options to be mutually exclusive
Sami Kerola [Sat, 24 May 2014 16:58:05 +0000 (17:58 +0100)] 
uuidd: set options to be mutually exclusive

--pid     || --no-pid
--debug   || --quiet
--random  || --time

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agouuidd: ensure pid file is wrote when it is requested
Sami Kerola [Sat, 24 May 2014 16:38:49 +0000 (17:38 +0100)] 
uuidd: ensure pid file is wrote when it is requested

Earlier for example this 'uuidd --pid /dev/full' worked, now error is
printed about truncating not being possible for character device and
assuming someone would write pid to full disk it should not be go by
unnoticed.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodocs: setterm.1 clean up manual page groff style
Sami Kerola [Sat, 24 May 2014 11:04:05 +0000 (12:04 +0100)] 
docs: setterm.1 clean up manual page groff style

Underline option arguments, and use bold for options.  Avoid use of \f
font style change in paragraphs, but use them when describing options.

Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodocs: setterm.1 add options compatibility note
Sami Kerola [Sat, 24 May 2014 09:58:27 +0000 (10:58 +0100)] 
docs: setterm.1 add options compatibility note

Both --option and -option formats are accepted.

Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodocs: setterm.1 add missing options to manual page and remove duplicate
Sami Kerola [Sat, 24 May 2014 09:38:16 +0000 (10:38 +0100)] 
docs: setterm.1 add missing options to manual page and remove duplicate

Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agosetterm: add usage() descriptions
Sami Kerola [Sat, 24 May 2014 09:17:01 +0000 (10:17 +0100)] 
setterm: add usage() descriptions

Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoMerge branch 'fix-build-sys' of https://github.com/rudimeier/util-linux
Karel Zak [Mon, 26 May 2014 10:52:18 +0000 (12:52 +0200)] 
Merge branch 'fix-build-sys' of https://github.com/rudimeier/util-linux

11 years agoMerge branch 'setarch' of https://github.com/rudimeier/util-linux
Karel Zak [Mon, 26 May 2014 10:48:35 +0000 (12:48 +0200)] 
Merge branch 'setarch' of https://github.com/rudimeier/util-linux

* 'setarch' of https://github.com/rudimeier/util-linux:
  setarch: add shortcut binary uname26
  setarch: flush output streams before exec

11 years agoMerge branch 'master' of https://github.com/rudimeier/util-linux
Karel Zak [Mon, 26 May 2014 10:44:31 +0000 (12:44 +0200)] 
Merge branch 'master' of https://github.com/rudimeier/util-linux

11 years agomount: add note about order for -a to the man page
Karel Zak [Mon, 26 May 2014 10:17:29 +0000 (12:17 +0200)] 
mount: add note about order for -a to the man page

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agolibblkid: detect squashfs 3 vs 4
Ruediger Meier [Tue, 20 May 2014 10:23:33 +0000 (10:23 +0000)] 
libblkid: detect squashfs 3 vs 4

Detect squashfs version <= 3 as squashfs3 and version >= 4 as squashfs.

squashfs kernel module version 4.0 (kernel 2.6.29) is not backward
compatible to open squashfs created with previous versions.

Also fixed version number parsing, see
$  mkdir test
$  mksquashfs test test.sqsh
$  blkid -p test.sqsh
- test.sqsh: VERSION="1024.0" TYPE="squashfs" USAGE="filesystem"
+ test.sqsh: VERSION="4.0" TYPE="squashfs" USAGE="filesystem"

This patch comes from openSUSE / SLE. Original author was probably
Miklos Szeredi.
Internal SUSE references: bnc#666893, sr226509

CC: Stanislav Brabec <sbrabec@suse.cz>
CC: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agotests: skip umount-alltargets on regular mtab
Karel Zak [Mon, 26 May 2014 09:43:27 +0000 (11:43 +0200)] 
tests: skip umount-alltargets on regular mtab

Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agoumount: add info that --all-targets works with mtab symlink only
Karel Zak [Mon, 26 May 2014 09:37:02 +0000 (11:37 +0200)] 
umount: add info that --all-targets works with mtab symlink only

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 years agobuild-sys: fix typo, sparc vs spark (62b2c024)
Ruediger Meier [Fri, 23 May 2014 15:15:05 +0000 (15:15 +0000)] 
build-sys: fix typo, sparc vs spark (62b2c024)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agobuild-sys: fix typo, look vs loop (1b15cbd1)
Ruediger Meier [Fri, 23 May 2014 11:08:28 +0000 (11:08 +0000)] 
build-sys: fix typo, look vs loop (1b15cbd1)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agosetarch: add shortcut binary uname26
Ruediger Meier [Thu, 22 May 2014 07:42:32 +0000 (09:42 +0200)] 
setarch: add shortcut binary uname26

There are some uname26 binaries flying around. Let's make it available
everywhere.

Internal SUSE references: fate313476, sr226509

CC: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
11 years agosetarch: flush output streams before exec
Ruediger Meier [Thu, 22 May 2014 07:19:08 +0000 (09:19 +0200)] 
setarch: flush output streams before exec

This fixes the following (non-deterministic) discrepancy:

$ setarch x86_64 -RFZLvXBIST3 --uname-2.6 echo success
Switching on READ_IMPLIES_EXEC.
Switching on ADDR_LIMIT_32BIT.
Switching on SHORT_INODE.
Switching on WHOLE_SECONDS.
Switching on STICKY_TIMEOUTS.
Switching on ADDR_LIMIT_3GB.
Switching on UNAME26.
success

$ setarch x86_64 -RFZLvXBIST3 --uname-2.6 echo success  &> /tmp/bla; cat /tmp/bla
success

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