Commit Graph

1122 Commits

Author SHA1 Message Date
Karel Zak 205dbb7a6c build-sys: add BUILD_ vars for all Linux-only utils
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 13:53:44 +02:00
Stephan Müller 4b8f83361b mount: fix tiny typo in man page
adjust command to use /dev/loop3 as described in text

Signed-off-by: Stephan Mueller <fruktopus@gmail.com>
2014-05-19 11:10:49 +02:00
Ondrej Oprala 914e20a00a lslogins: move to login-utils
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Ondrej Oprala ab1cfad5b7 lslogins(1): skeleton and argparsing for a new utility
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Karel Zak f4bc7f96a6 dmesg: support colors customization
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:13:02 +02:00
Karel Zak 3e55659feb losetup: return EXIT_FAILURE on unsuccessful -f
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 11:34:30 +02:00
Sami Kerola 198556b76c cytune: remove from util-linux
Assumption is there are not many who need this tool.  Whom ever they
might be the recommendation is to use the command from old util-linux
release.  Second reason to removal is difficulty to test hardware
specific command when none of the active project members does not seem to
have such.  Basically the command has reached dead end what comes to
maintainability of it.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-12 13:06:59 +02:00
Karel Zak 08ca3e26a8 lib/timeutils: remove get_boot_time from libcommon
clock_gettime() needs -lrt, so let's keep this stuff
outside libcommon.la

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 13:16:05 +02:00
Karel Zak f55b4b4512 hwclock: fix typo
Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 12:51:42 +02:00
Stanislav Brabec db8fc5f377 hwclock: Check drift value in /etc/adjtime
Due to bug in older versions of hwclock, /etc/adjtime can contain
excessive drift value (up to many years per day). Prevent it
from applying.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2014-05-06 12:49:56 +02:00
Stanislav Brabec f196fd1a5f hwclock: Prevent excessive drift values
Failure of CMOS battery can cause writing of excessive drift
values (up to many years per day).

This causes excessive hwclock adjustment next time, which may lead
to overflow in calculate_adjustment() (and hang before 4a44a54b).

Prevent this situation, check drift for limits and reset drift to zero
instead.

Steps to reproduce:

mv /etc/adjtime /etc/adjtime.backup

rm /etc/adjtime
hwclock --set --date 2001-01-01\ 01:00:00

changing of /etc/adjtime.
mv /etc/adjtime /etc/adjtime.saved
hwclock --set --date 2001-01-02\ 01:00:01
mv /etc/adjtime.saved /etc/adjtime

echo "======= The /etc/adjtime has a \"correct\" look:"
cat /etc/adjtime

hwclock --debug --systohc --utc
echo "======= The /etc/adjtime now has deeply failed drift value:"
cat /etc/adjtime

mv /etc/adjtime /etc/adjtime.saved
hwclock --set --date 2015-01-01\ 01:00:00
mv /etc/adjtime.saved /etc/adjtime

hwclock --debug --adjust
echo "======= And the last /etc/adjtime:"
cat /etc/adjtime

mv /etc/adjtime.backup /etc/adjtime
hwclock --systohc --utc

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2014-05-06 12:49:55 +02:00
Andy Lutomirski cc89383b32 setpriv: Fix --selinux-label
This commit:

    commit 05cef8eafb
    Author: Sami Kerola <kerolasa@iki.fi>
    Date:   Sat Apr 13 20:54:59 2013 +0100

        setpriv: check writing to a file descriptor was successful

broke --selinux-label.  It checks whether fsyncing /proc/self/attr/exec
succeeds, and it doesn't, because fsync isn't supported on that file.

I have stealthily improved the error message as part of this fix.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2014-05-06 11:27:52 +02:00
Benno Schulenberg aa06617f6e textual: remove square brackets from around three dots
Also improve some option descriptions here and there.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-05-06 11:12:13 +02:00
Benno Schulenberg 0de963ce41 ipcs: do not gettextize wordless strings
Also tweak a few parts of the usage message.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-05-06 11:09:29 +02:00
Karel Zak d12d063b4a dmesg: add missing include
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 10:28:26 +02:00
Sami Kerola 24f83f7392 swapon, swapheader, mkswap: move swap signature to header
Both swapon and mkswap need to know what is valid device signature, so
share the value.

[kzak@redhat.com: - use SWAP_SIGNATURE_SZ properly in write_signature()]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 10:16:54 +02:00
Sami Kerola eb397d19e4 swapon: swaps with legacy version label are not supported
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-06 10:12:14 +02:00
Sami Kerola 8a101b1447 mkswap, swaplabel: move version number to header
Corrently only the swap version 1 is supported, which is a magic value so
move it to header.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-04 11:42:03 +01:00
Sami Kerola 929f939e6a dmesg: move get_boot_time() to lib/timeutils
In future the last(1) will use get_boot_time() as well.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-04 11:42:03 +01:00
Karel Zak 4593e07513 mount: note that -c unused for mount.<type> in man page
Addresses: https://github.com/karelzak/util-linux/issues/70
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-25 10:07:24 +02:00
Karel Zak 885717c63e Revert "dmesg: don't use brow/yellow in output"
It will be better to support colors customization than use
ugly blue color. BTW, for example git-log uses brow/yellow too
by default.

This reverts commit 0b6fbc2599.
2014-04-23 11:09:44 +02:00
Karel Zak 4a94144136 nsenter: add + to getopt_long()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-18 13:12:24 +02:00
Karel Zak a9a4af9030 unshare: add + to getopt_long()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-18 13:12:13 +02:00
Lukas Czerner 1fd4f609ee fallocate: add FALLOC_FL_ZERO_RANGE support
Recent Linux kernel supports FALLOC_FL_ZERO_RANGE in fallocate(2).
This patch adds FALLOC_FL_ZERO_RANGE support to fallocate utility,
by introducing a new option -z|--zero-range.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
2014-04-18 12:49:42 +02:00
Dongsu Park 83cc932d74 fallocate: introduce an option -c to support COLLAPSE_RANGE
Introduce a new option -c (or --collapse-range) to support a new flag
FALLOC_FL_COLLAPSE_RANGE for fallocate(2). It will nullify a particular
range [offset, offset+len] by shifting extents beyond the range to the
beginning of the hole.

Cc: Lukas Czerner <lczerner@redhat.com>
Cc: Namjae Jeon <namjae.jeon@samsung.com>
Cc: Ashish Sangwan <a.sangwan@samsung.com>
Signed-off-by: Dongsu Park <dongsu.park@profitbricks.com>
2014-04-18 12:49:39 +02:00
Karel Zak 004ff2d696 fstrim: add hint to man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-10 09:58:36 +02:00
Karel Zak a39461d355 fstrim: daily -> weekly in systemd timer
* add link to fstrimg man page
 * less aggressive frequency

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-10 09:38:17 +02:00
Karel Zak ebff016a19 build-sys: consolidate systemd support
* systemd (since v209) uses only one library (when compiled
   without --enable-compat-libs)

 * all systemd build-sys stuff is merged into HAVE_SYSTEMD
  (automake) and HAVE_LIBSYSTEMD (C macro) now

 * all is controlled by --with-systemd, default is to automatically
   check for systemd libs

 * no more --enable-socket-activation and --enable-journald

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-09 12:23:30 +02:00
Karel Zak 4856a7bc01 build-sys: fix fstrim systemd stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-08 19:19:14 +02:00
Anton Blanchard 95bf26fd68 setarch: Fix ppc64le architectures
setarch currently fails on ppc64le because it tries to
use big endian architecture names. Fix it.

Signed-off-by: Anton Blanchard <anton@samba.org>
2014-04-07 12:38:22 +02:00
Jonathan Liu 8356d27d66 umount: fix typo in usage
Signed-off-by: Jonathan Liu <net147@gmail.com>
2014-04-07 12:38:20 +02:00
Thomas Bächler 877cd8944b fstrim: add systemd units
This adds a timer and a service for systemd that runs
fstrim -a once a day.

The Persistent=true option used will only work on systemd 212
or newer.
2014-04-07 12:38:18 +02:00
Bjarni Ingi Gislason 0d05f1619d mount.8: Some typographical and prefix corrections to the manual
I forgot to add the patch to the attachment.

  Additional changes to "Changes:"

  " \(em " changed to " \(en ", as the em-dash with a word space on each
side is to long (troff)

  ".na/.ad" is not used but .nf/.fi for a long command line and it is
split into two lines

  Word "illegal" is changed to "invalid"

  Word "hyphen-separated" is changed to '"hyphen-minus"-separated' as
the meaning is the code and not the glyph (on the command line) (beware
of UTF-8)

--
Bjarni I. Gislason
2014-04-07 12:16:02 +02:00
Karel Zak b6bdccc710 mount: apply "nofail" to MNT_ERR_NOSOURCE libmount error
fstab:
     UUID=nonexist /mnt/nonexist1 ext4 nofail 0 1

 # mount -av
 mount: can't find UUID=nonexist

.. this is bug of course.

Reported-by: Patrick McLean <chutzpah@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:09:11 +02:00
Karel Zak 0ce2fe8738 umount: more robust success message for --all
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:00:51 +02:00
Karel Zak 8ab82185ee mount: fix --all and nofail return code
Now the "nofail" affects warnings warning messages only. That's wrong
and regression (against original non-libmount version). The nofail has
to control return code too.

Reported-by: Patrick McLean <chutzpah@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 11:53:05 +02:00
Dave Reisner c7832fb8f1 switch_root: verify initramfs by f_type, not devno
As of linux 3.14, the initramfs device will have both major and
minor 0, causing our paranoia check to fail. Make this version agnostic
by checking the filesystem type, rather than a device number.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2014-04-04 14:55:13 +02:00
Karel Zak 0925a9dd6c libsmartcols: clean up flags usage
* rename flags functions to scols_table_enable_*
 * rename *_no_foo() functions to _nofoo()
 * output formats are mutually exclusive, so don't use flags there
 * don't assume symbols in scols_new_table(), use scols_table_set_symbols()

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 16:09:57 +02:00
Karel Zak 98f87c507d wdctl: clean up scols usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:21 +02:00
Karel Zak e516634844 swapon: clean up scols usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:20 +02:00
Karel Zak 05186e79ff prlimit: clean up scols usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:20 +02:00
Karel Zak e7213e34f3 lscpu: clean up scols usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:20 +02:00
Karel Zak 145766440a losetup: tiny change to usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:20 +02:00
Karel Zak 48f1f38b73 losetup: clean up scols usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:20 +02:00
Ondrej Oprala fe7af530a9 wdctl: use libsmartcols
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:19 +02:00
Ondrej Oprala 248a7f70dd swapon: use libsmartcols
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:19 +02:00
Ondrej Oprala 226d76e667 prlimit: use libsmartcols
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:19 +02:00
Ondrej Oprala 83db4eb2c2 lscpu: use libsmartcols
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:19 +02:00
Ondrej Oprala 7e86cd5470 losetup: use libsmartcols
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:19 +02:00
Ruediger Meier 94b559e08e mount: update mount.8 about barrier mount options defaults
This patch comes originally from Jan Kara <jack@suse.cz> and updates
the default behaviour of the kernel which has been changed some years
ago. See kernel docs
  Documentation/filesystems/ext3.txt
  Documentation/filesystems/ext4.txt
2014-04-01 18:43:33 +02:00