Commit Graph

1515 Commits

Author SHA1 Message Date
Sami Kerola 7ee26cbf02 maint: fix shadow declaration
This change fixes all shadow declarations.  The worth while to mention
fix is with libfdisk sun geometry.  It comes from bitops.h cpu_to_be16
macro that further expands from include/bits/byteswap.h that has the
shadowing.

libfdisk/src/sun.c:961:173: warning: declaration of '__v' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:69: warning: shadowed declaration is here [-Wshadow]
libfdisk/src/sun.c:961:178: warning: declaration of '__x' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:74: warning: shadowed declaration is here [-Wshadow]

That could have caused earlier some unexpected results.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 10:08:21 +01:00
Karel Zak 185aa9e5b8 fallocate: create mode 0666, that's what umask is for
User's umask will typically mask the mode down to 0664 or 0644.

Reported-by: Peter Cordes <peter@cordes.ca>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-07 09:57:55 +01:00
Karel Zak 17bf9c1c39 ipcrm: fix usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-06 11:55:21 +01:00
Benno Schulenberg 7009af0e0d ipc*: use customary fputs() instead of fprintf() with the usage macros
Also use the clearer word <number> with the --semaphore option.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:50:18 +01:00
Benno Schulenberg 26b0b857c9 textual: list the options of setarch in a more alphabetical order
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:43:16 +01:00
Benno Schulenberg 682430494c setarch: make the usage synopsis comprehensible for translators
Use two separate strings for the two different forms of setarch,
instead of filling in an untranslated word into a single string.
Also use the standard angular brackets for nonliteral arguments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:42:41 +01:00
Benno Schulenberg 6ad5b22ca6 docs: restore the alternative form of setarch in its man page
Commit c372860ddb accidentally removed
the alternative form of setarch in which the command name specifies
the architecture to be set.  Also improve some formatting.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:41:03 +01:00
Benno Schulenberg 4e788f4621 ipcrm: gettextize the command synopsis of the usage text
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:41:03 +01:00
Benno Schulenberg afd86656de ipcs: in usage show resource option as nonoptional when used with -i
Also, the resource option -a is not valid with -i, so show the valid
ones explicitly.  Also gettextize the synopsis as a single string, as
the two lines are tightly related and other synopses do this too.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:40:01 +01:00
Benno Schulenberg 451dbcfae1 textual: add a docstring to most of the utilities
This adds a concise description of a tool to its usage text.

A first form of this patch was proposed by Steven Honeyman
(see http://www.spinics.net/lists/util-linux-ng/msg09994.html).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:27:38 +01:00
Karel Zak 929c257548 ipcs: fix shmctl() usage
The function shmctl() has to be called with 'struct shmid_ds', and if
you need 'struct shminfo' then the right way is to cast:

bad way:
  struct shm_info info;

  shmctl(0, SHM_INFO, &info);

right way:
  struct shmid_ds buf;
  struct shm_info *info;

  shmctl(0, SHM_INFO, &buf);
  info = (struct shm_info *) &buf);

The patch also fixes bug in ipc_shm_get_limits() where is missing
lim->shmmax in code based on shmctl().

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-19 13:42:41 +01:00
Sami Kerola 3ce29d6d46 ipcs: fix two data type errors [AddressSanitizer]
==3218==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffa577e2b0 at pc 0x4501f9 bp 0x7fffa577e130 sp 0x7fffa577e108
WRITE of size 112 at 0x7fffa577e2b0 thread T0
    #0 0x4501f8 in shmctl /home/users/aadgrand/LLVM/releases/ubuntu/final/llvm.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:2502
    #1 0x48bd13 in ipc_shm_get_info /home/travis/build/kerolasa/lelux-utiliteetit/sys-utils/ipcutils.c:157
    #2 0x488884 in do_shm /home/travis/build/kerolasa/lelux-utiliteetit/sys-utils/ipcs.c:279
    #3 0x4844a8 in main /home/travis/build/kerolasa/lelux-utiliteetit/sys-utils/ipcs.c:175
    #4 0x2afb3f8c176c (/lib/x86_64-linux-gnu/libc.so.6+0x2176c)
    #5 0x48408c in _start (/home/travis/build/kerolasa/lelux-utiliteetit/ipcs+0x48408c)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-19 11:32:38 +01:00
Sami Kerola 772420322d lscpu: blacklist vmware_bdoor() AddressSanitizer check
AddressSanitizer is identifying the __asm__ segment as suspicious.

==1215==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000
(pc 0x0000004ccffd bp 0x7fff9b7184f0 sp 0x7fff9b7184e0 T0)
    #0 0x4ccffc in vmware_bdoor /home/src/util-linux/sys-utils/lscpu.c:660

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-19 11:32:38 +01:00
Benno Schulenberg f49ccec212 docs: don't use bold or italics for "[option]" in synopsis of man pages
As per the convention shown in Documentation/howto-man-page.txt.
Also make a few other tiny adjustments along the way.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:23 +01:00
Karel Zak 01966ce852 libmount: allow unspecified source on remount
kernel does not require mount source (e.g. device name) on remount, it
means that fstab/mtab/mountinfo should be optional in this case.
For example:

 mount -o rw,remount /

has to work on system without mounted /proc.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-18 10:47:39 +01:00
Cristian Rodríguez fad25f02a3 build-sys: hwclock requires -lm
hwclock uses fabs and therefore needs libm, otherwise a linking
error ocurrs when building with -fno-builtin.
2014-12-09 09:19:36 +01:00
Karel Zak bc265f7cfa eject: use sysfs API to detect hotplug
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-02 11:00:19 +01:00
Karel Zak 784467ad2d blkdiscard: fix compiler warning
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-26 12:38:53 +01:00
Karel Zak 41525ce062 ldattach: add fallback for N_GSM0710
Addresses: https://github.com/karelzak/util-linux/issues/133
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-21 13:57:14 +01:00
Karel Zak cd2876d252 build-sys: move all around clock_gettime() to monotonic.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-19 11:54:47 +01:00
Karel Zak a4830f617e build-sys: use CLOCKGETTIME_LIBS
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-19 11:23:05 +01:00
Karel Zak 700031ade7 misc: use monotonic time rater than gettimeofday
Based on patch Alexander Samilovskih <alexsamilovskih@gmail.com>

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-18 14:35:21 +01:00
Ville Skyttä 9779f59831 docs: Spelling fixes
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-18 13:59:19 +01:00
Karel Zak 8596f63914 ldattach: GSM0710 support, add intro modem command
Patch add:
 --intro-command string  : send command to modem
 --pause value           : define delay between intro command and ldattach

Based on patch from Martin Schmid <scm@aps-systems.ch>

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-18 13:49:42 +01:00
Tobias Stoeckmann 6cbf75e56e lscpu: theoretical buffer overflow
there is a theoretical buffer overflow possible in the hypervisor
parsing code of lscpu.  It would require a proc entry to return way more
than expected so it's no high priority.  But better be safe than sorry.

At first I thought about switching to fgets but there is another
code file that adds a format specifier.  The diff is less intrusive
that way, too.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-18 11:38:21 +01:00
Benno Schulenberg df48a72161 hwclock: improve wording and formatting of man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-11-13 15:09:16 +01:00
Karel Zak 64d0cee6c0 include/statfs_magic: use macro rather than type for f_type
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-10 11:29:42 +01:00
Benno Schulenberg f4cae17663 swapon: reword some usage strings
Also remove some inconsistent periods and properly punctuate
the closing sentence.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-11-07 13:21:06 +01:00
Benno Schulenberg 24930e7088 docs: fix some wording, grammar and formatting in man page of swapon
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-11-07 13:21:06 +01:00
Karel Zak 52f2fd9bcc swapoff: swapoff swap files by LABEL and UUID
# swapon --show=NAME,UUID
 NAME                   UUID
 /dev/sda3              8d52fca3-bf48-41d6-b826-2315e518a305
 /home/fs-images/2g.img 6fa72b96-b802-441f-a31c-091d65c0212c

 # swapoff UUID=6fa72b96-b802-441f-a31c-091d65c0212c
 swapoff: cannot find the device for UUID=6fa72b96-b802-441f-a31c-091d65c0212c

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-07 12:08:11 +01:00
Karel Zak 8f806bb1ea switch_root: improve statfs->f_type portability
__SWORD_TYPE is not available everywhere, for example it's not defined
by musl libc. It also seems that __SWORD_TYPE is not used for f_type
on some architectures (s390x).

Reported-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-06 12:50:27 +01:00
Karel Zak 0bf037402a lib/loopdev: replace custom DBG() with include/debug.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-04 14:08:45 +01:00
Karel Zak 68e422ecae docs: update info about env debug variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:13:54 +01:00
Karel Zak 03b5e5975a swapon: improve man page notes about holes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 10:11:58 +01:00
Karel Zak 54f2e4563d swapon: remove extra word from usage
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-31 10:58:27 +01:00
Benno Schulenberg 6ee8e19489 textual: slice up the usage text of swapon for ease of translation
A new option was added recently; seize this opportunity to cut the
usage text into small and easily managed chunks.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-31 10:39:11 +01:00
Benno Schulenberg b1301d7865 docs: fix some wording and formatting in man page of swapon
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-31 10:39:08 +01:00
Sami Kerola b35c37274c fstrim: initialize path variable
Reading the code this initialization is not necessary, so the change is
mostly about silencing a compiler warning and ensuring the program keeps
on working if there is a future bug that could make uninitialized 'path'
reachable to use.

sys-utils/fstrim.c:247: warning: 'path' may be used uninitialized in this
function

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-31 10:38:58 +01:00
Karel Zak 8fc4a88630 build-sys: properly check for -lrt
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-27 11:05:14 +01:00
Karel Zak c0dedab013 build-sys: old glibc requires -lrt clock_gettime()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-27 10:47:32 +01:00
Karel Zak 4f55368cc5 blkdiscard: fix includes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-27 10:00:19 +01:00
Karel Zak 8f59654a40 blkdiscard: update man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-27 09:42:51 +01:00
Federico Simoncelli c472a7e35a blkdiscard: add support for steps and progress
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2014-10-27 09:16:49 +01:00
Federico Simoncelli d7ce9acb33 blkdiscard: fail on sector misalignment 2014-10-27 09:16:47 +01:00
J William Piggott bbb4c273e9 hwclock: Reduce drift factor update period
To facilitate the calculation of 'cold' vs 'warm' Hardware Clock drift
factor the limit on the update period needs to be less than 8 hours.

4 hours should be enough drift to allow calculations that are not
grossly out of range.

For example, with a workstation that is shutdown every night the cold
drift factor can be significantly different than a drift factor based on
a 24 hour period.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-20 15:22:24 -04:00
J William Piggott 66af1c0f44 hwclock: fix superfluous 'if' statement and typo
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-20 14:48:07 -04:00
J William Piggott 5cb71d2bca hwclock: adjust wording of v2.26 notes
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-20 14:07:27 -04:00
Sami Kerola 6f7f155c0c eject: move unreachable code to preprocessor #else block [smatch scan]
eject.c:466 toggle_tray() info: ignoring unreachable code.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-20 14:07:18 +02:00
Karel Zak 732ac3a52a hwclock: add notes about default behavior changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-20 14:01:25 +02:00
Karel Zak fc56c36368 hwclock: cleanup man and usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-20 13:31:36 +02:00
Karel Zak e2c1eb9913 Merge branch 'master' of https://github.com/jwpi/util-linux into hwclock 2014-10-20 11:41:38 +02:00
Karel Zak e07fdac476 swapon: add -o <list> for compatibility with mount
The new option allows to specify swap options by fstab compatible
string. The concept is the same as for mount(8).

   swapon -o pri=1,discard=pages,nofail /dev/sda2

The advantage is that tools (like systmed) that parses fstab can call
swapon without translation from fstab options to swapon(8) command
line options.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-20 10:59:08 +02:00
Karel Zak ba986e815c mount: don't ignore mtab for --bind -o remount
Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-17 08:53:54 +02:00
J William Piggott cd950279f1 hwclock: Add --update-drift option MAN
Update hwclock man page for the
hwclock: Add --update-drift option patch.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 16:15:06 -04:00
J William Piggott f276d71a3e hwclock: Add --update-drift option
There are cases where we need to refresh the
timestamps in the adjtime file without updating the
drift factor.

For example, with ntpd and an Eleven Minute Mode
kernel, we need to call systohc at shutdown to
facilitate drift correction.  With the current
behavior hwclock will clobber the drift factor to
near zero, because the Hardware Clock and System
Clock are synced by Eleven Minute Mode.  What
actually needs to be done is refresh the adjtime
file timestamps and not calculate a new drift
factor.

Because it is a manual process to craft a good
Hardware Clock drift factor, that is, there is no
automated method that will produce a good drift
factor, this patch changes the default drift
calculation behavior to off, and it is turned on
by using the --update-drift option. Once we have a good
drift factor for a given machine we do not want
anything clobbering it, including an administrator
forgetting to turn off recalculation. A system
administrator should make a concious effort in
telling hwclock with the --update-drift option that
(s)he wants to recalculate the drift factor.

Without using the --update-drift option with calibrate
operations only the timestamps are refreshed in
the adjtime file. With the --update-drift option the old
default behavior of refreshing the timestamps and
updating the drift factor is performed.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 15:48:17 -04:00
J William Piggott 8db424dcbc hwclock: persistent_clock_is_local MAN
Update hwclock man page for the
hwclock: persistent_clock_is_local patch.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 14:48:07 -04:00
J William Piggott d17a12a368 hwclock: persistent_clock_is_local
When hctosys is used at boot time, making it the
first caller of settimeofday, the responsibility
of setting persistent_clock_is_local is thrust
upon it.  Currently hctosys always leaves this
variable uninitialized.  This causes a Hardware
Clock configured to use the local timescale to be
clobbered with the UTC timescale by the kernel's
NTP eleven minute mode.

This patch fixes this hctosys bug, by having it
properly set persistent_clock_is_local according
to the time scale configured for the Hardware
Clock.

It does this via the kernel warp_clock function
but this in inconsequential, because we set the
system time immediately afterward.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 14:45:29 -04:00
J William Piggott cb7efbc12d hwclock: hctosys drift compensation II MAN
Update hwclock man page for the
hwclock: hctosys drift compensation II patch.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 14:37:08 -04:00
J William Piggott ede32597f5 hwclock: hctosys drift compensation II COMMENTS
Update source comments and --help output for the
hwclock: hctosys drift compensation II patch.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 14:32:31 -04:00
J William Piggott 2794995ad9 hwclock: hctosys drift compensation II
Allowing hctosys to drift compensate facilitates:

More precise setting of the System Clock early in
the boot process when --adjust cannot be used
because the file system is not writeable.

Applies sub second drift corrections immediately,
where as --adjust cannot.

Reduces boot time by not calling hwclock multiple
times, e.g., --hctosys early before fsck when the
file system is read-only, then --adjust later when
the file system is read-write and --hctosys again
for drift correction.

Use of --adjust elsewhere may no longer be
necessary.

Part II

After the original submission of this patch I
realized that now all operations except --systz
require drift corrected Hardware Clock time.
Therefore, it should be done only once early in
the process. Upon implementation of that premise
many improvements were facilitated:

* Adds drift correction to --hctosys.
* Adds setting system time with sub-second precision.
* Adds --get, a drift corrected 'show' operation.
* Improves drift factor calculation precision while
   greatly simplifying its algorithm.
* Fixes --show bug, printing integer sub-seconds, and
   now uses a more intuitive positive value.
* Fixes --predict bug, drift correction must be
   negated to predict future RTC time.
* Reduces the number of function arguments and
   lines of code.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2014-10-15 14:21:13 -04:00
Karel Zak 0c75b6a470 blkdiscard: fix err->errx()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-14 12:14:05 +02:00
Raphael S. Carvalho 303884a495 blkdiscard: fix underflow when offset is greater than device size
If offset (range[0]) is greater than device size (blksize), the variable 'end'
will be greater than blksize, and range[1] (length) will be recalculated.
The underflow happens when subtracting range[0] (offset) from blksize, thus
range[1] will be the result of an underflow. The bug leads to unwanted behavior
from the program, where range[1] is likely to be a high number and then will
discard a considerable amount of blocks from the device. The fix consists of
exitting the program with an error message when the condition stated above is
true. Spotted while auditing the code.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2014-10-14 12:04:14 +02:00
Karel Zak 33ecab2b9c dmesg: improve reltime colors
[  +0.004034] sd 113:0:0:0: [sdb] Attached SCSI disk
[Oct10 13:04]  sdb: unknown partition table
[  +0.034011]  sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 >

.. the "Oct10 13:04" is possible to colorize by "timebreak"
scheme (default is bold green).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-14 10:20:19 +02:00
Karel Zak c4604c38b5 flock: zero timeout is valid
This patch reverts Sami's "timeout cannot be zero", introduced
in commit 605325b23b.

The --timeout 0 has been originally interpreted as --nonblock. The
patch also add hint about this behavior to the man page.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1149974
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 12:12:39 +02:00
Karel Zak f1453d528e losetup: improve man page -D docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 11:54:33 +02:00
Sami Kerola 83aa4ad797 hwclock: use fabs() instead abs() when argument is double
sys-utils/hwclock.c:1219:13: warning: using integer absolute value function
      'abs' when argument is of floating point type [-Wabsolute-value]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 13:09:36 +02:00
Sami Kerola db433bf737 textual: use usage() text element macros
Translating these text elements should happen only once, which is
more likely when the text macros are used properly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:26 +02:00
Sami Kerola a587cc5520 textual: use manual tail usage() macro
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:24 +02:00
Sami Kerola f627750083 textual: use version printing macro everywhere
Only mount, umount, and blkid remains not using the macro because they
are print also library references.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:23 +02:00
Sami Kerola c5c056e7fe flock: add error message to translations
And remove type casting.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:18 +02:00
Sami Kerola 7d2600e2d0 docs: update deprecation banners
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:11 +02:00
Sami Kerola a12124ce7a swapon: align available columns section in usage()
Commit 5db57cfc46 missed doing this change.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:10 +02:00
Benno Schulenberg 42f00a7df5 textual: there may be no space between option and optional =arg
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:11 +02:00
Benno Schulenberg 298dc4ff6b textual: angular brackets around a non-literal argument, singular
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:10 +02:00
Benno Schulenberg 548696c442 textual: grammarize another error message
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:09 +02:00
Benno Schulenberg 7a853ebc38 textual: using angular brackets around individual arguments
And separate short and long options with the standard comma.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:08 +02:00
Benno Schulenberg 6269814950 textual: grammarize an error message
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:07 +02:00
Benno Schulenberg b73142b97a textual: not using angular brackets around literal arguments
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:06 +02:00
Benno Schulenberg 09638694d4 textual: use angular brackets around each individual argument
In usage texts each word that is an argument should be marked
separately with angular brackets.  Also add a translator comment.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:02 +02:00
Karel Zak 8a4c64e6ac mount: improve --move docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-09-25 11:01:39 +02:00
Karel Zak 286f1e229b Merge branch 'misc' of git://github.com/kerolasa/lelux-utiliteetit
* 'misc' of git://github.com/kerolasa/lelux-utiliteetit:
  textual: share crypt() error message in sulogin and newgrp
  newgrp: avoid use of obsolete getpass() function
  newgrp: use libc function to read gshadow if it is available
  setarch: use personality() system call when it is available
  setarch: reindent code
  hwclock: remove referal to deprecated keyboard interface
  eject: make open_device() and select_speed() to use struct eject_control
  eject: add struct eject_control to remove global variables
  mountpoint: simplify if statement
  mkfs.minix: fix couple compiler warnings
  mountpoint: add struct mountpoint_control
  last: improve code readability by renaming variable names
  last: make is_phantom() when kernel config does not include audit support
  lib: remove xgetpass()
  include: simplify fputc_careful() in carefulputc.h
  libuuid: add extern qualifiers to uuid/uuid.h system header
2014-09-22 14:55:37 +02:00
Karel Zak fb2ba06663 Merge branch 'renice' of git://github.com/kerolasa/lelux-utiliteetit
* 'renice' of git://github.com/kerolasa/lelux-utiliteetit:
  renice: reorder usage() option descriptions
  rename: add getpriority() message lookup table
  renice: fix numeric uid argument parsing
  renice: avoid having same lines of code twice
  renice: disallow --priority <arg> without pid argument
  rename: use usage and version print out macros
  renice: reorder functions to avoid need of function prototype
2014-09-22 14:43:30 +02:00
Karel Zak 18b3e5495b swapon: split swapon-common.c
swapon    - requires libmount and libblkid
 swapoff   - requires libmount
 swaplabel - requires libblkid

This patch add lib/swapprober.c with blkid stuff for swap. It allows
to use and link libblkid only when necessary.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-09-22 13:16:25 +02:00
Sami Kerola 94b1623be3 renice: reorder usage() option descriptions
Make the Usage: and Options: sections to be in same order, which I found
to be quicker to use than alphabetical order.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:13 +01:00
Sami Kerola ce4030e484 rename: add getpriority() message lookup table
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:13 +01:00
Sami Kerola 80ca9e2039 renice: fix numeric uid argument parsing
The following was inconflict with what usage() tells are valid option
arguments.

$ renice 1 -u 1000
renice: unknown user 1000
$ id
uid=1000(kerolasa) ...

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:13 +01:00
Sami Kerola 00b490f002 renice: avoid having same lines of code twice
Add getprio() function to avoid duplication of a simple task.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:13 +01:00
Sami Kerola 0bb01bb0b7 renice: disallow --priority <arg> without pid argument
Earlier a lonely priority with an argument but without pid resulted to no
action and success, when the invocation should have failed.

$ renice --priority 42 ; echo $?
0

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:12 +01:00
Sami Kerola 6dcc066f3b rename: use usage and version print out macros
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:12 +01:00
Sami Kerola 5ebcab664e renice: reorder functions to avoid need of function prototype
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:12 +01:00
Sami Kerola 9ed11cc260 setarch: use personality() system call when it is available
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:02 +01:00
Sami Kerola 77eb13b965 setarch: reindent code
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:02 +01:00
Sami Kerola 846c7d30b3 hwclock: remove referal to deprecated keyboard interface
The KDGHWCLK has been gone quite a while.

Reference: http://marc.info/?l=linux-kernel&m=104171103925897
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:02 +01:00
Sami Kerola 25a3fa8159 eject: make open_device() and select_speed() to use struct eject_control
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:02 +01:00
Sami Kerola 257a003528 eject: add struct eject_control to remove global variables
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:02 +01:00
Sami Kerola ee5de88c51 mountpoint: simplify if statement
Returning straight after print_devno() makes the code to be more obvious
and removes need for long else statement.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:01 +01:00
Sami Kerola f112f41e05 mountpoint: add struct mountpoint_control
This unifies variable names in different functions, and removes redundant
stat() calls.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:01 +01:00
Karel Zak 29607edf65 Merge branch 'master' of https://github.com/stevenhoneyman/util-linux 2014-09-17 11:56:13 +02:00
Andreas Henriksson 2eaac5489b ipcrm: add hacks to avoid FTBFS
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-09-17 10:15:14 +02:00
Aurelien Jarno e4a382b777 ipcs: remaining kFreeBSD hackery for building.
Addresses-Debian-Bug: #527384
Signed-off-by: LaMont Jones <lamont@debian.org>
2014-09-17 10:14:19 +02:00
Boris Egorov 73f2bec5f8 lscpu: fix cppcheck warnings
CppCheck founds a few wrong arguments in format strings and a NULL
pointer dereference.

Amended version with fixed strcmp() usage.

Signed-off-by: Boris Egorov <egorov@linux.com>
2014-09-16 11:16:09 +02:00
Steven Honeyman 0a55b319d4 zramctl: fixed two -Wformat-security warnings
(they prevented compilation if -Werror=format-security is enabled)

Signed-off-by: Steven Honeyman <stevenhoneyman@users.noreply.github.com>
2014-09-15 21:59:31 +01:00
Dave Reisner 44e9d52e52 mountpoint: clarify that it works on files
fef4dfa174 removed the restriction that the argument must explicitly be
a directory, so let's fix up the documentation to reflect that.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-22 08:14:29 +02:00
Dave Reisner fef4dfa174 mountpoint: drop S_ISDIR check
Files can be mountpoints, too.
2014-08-21 15:05:45 +02:00
Benno Schulenberg 882be62610 docs: improve the description of --size in the man page of zramctl
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-20 10:47:07 +02:00
Sami Kerola 3077ff49f3 swapon: remove invalid error string print outs
To avoid messages like this:

$ swapon /dev/zram0
swapon: /dev/zram0: read swap header failed: Success

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-08-11 14:51:56 +02:00
Benno Schulenberg 1d23119072 textual: remove some inconsistent periods from error messages
While doing so, also improve translatability and some wordings.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-11 14:51:54 +02:00
Mike Frysinger 7845b91dbc lscpu: clean up vmware inline asm
This code is not PIC clean which means it fails to build on hardened
32bit x86 systems (i.e. building as PIE).

While here, optimize the existing cpuid logic slightly.

URL: https://bugs.gentoo.org/518936
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-08-11 14:51:53 +02:00
Sami Kerola 1fa6c3e0b9 zramctl: improve option combination error messaging
Use of --algorithm or --streams is not expected to work without
reseting device, that happens when --size is specified, so ensure the
former options to be combined with the later.

[kzak@redhat.com: - make it more generic]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-11 14:47:08 +02:00
Karel Zak 342436c66a zramctl: cannonicalize devname when no fullpath specified
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-11 14:39:46 +02:00
Sami Kerola 929c7b2817 zramctl: improve error message
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-08-11 14:27:13 +02:00
Karel Zak 116c9ce23d zramctl: fail status printout when device does not exist
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-11 14:26:20 +02:00
Sami Kerola ef567176b1 zramctl: add details to --size option documentation
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-11 13:58:35 +02:00
Karel Zak 423c0d75ec zramctl: remove extra \n from usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-06 15:04:58 +02:00
Steven Honeyman 1b19ea31a3 docs: fix inconsistencies in man pages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-06 14:50:20 +02:00
Karel Zak b07ca5160c zramctl: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-06 09:02:09 +02:00
Karel Zak 6ed7f01127 zramctl: fix typo
Reported-by: Steven Honeyman
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-05 15:47:36 +02:00
Benno Schulenberg f0b3e6c2f9 docs: improve the wording and formatting of the zramctl man page
Especially fix the mistaken short option -h for --noheadings.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-05 15:37:42 +02:00
Benno Schulenberg 1c35e62517 zramctl: fix the wording of some message strings
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-05 15:37:41 +02:00
Benno Schulenberg 851c2bd55d docs: restore the mention of uhelper= and helper= in man page of umount
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-05 15:37:36 +02:00
Karel Zak 0624d8406b zrmactl: add new command to control /dev/zramN devices
Co-Author: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-01 12:09:55 +02:00
Sami Kerola 3d595f92c8 build-sys: remove swap-common.h from sys-utils/Makemodule.am
The commit 25a365e moved the file to include/

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-30 20:48:46 +01:00
Karel Zak 47f42c1d14 nsenter: allow to use --set{uid,gid} for all namespaces
Now it's possible to set UID and GID for user namespaces only. This
patch removes this restriction and allow to use --set{uid,gid} in all
cases. The default for user namespaces is still GID=0, UID=0.

Reported-by: Tomas Doran <bobtfish@bobtfish.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-29 13:07:44 +02:00
Benno Schulenberg d6983300a2 docs: remove all mention of helper= and uhelper= from umount man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-29 12:14:57 +02:00
Benno Schulenberg ae4cc2adea docs: sort the options in the man pages of hwclock and uuidd
Also improve the formatting a bit.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-29 12:14:56 +02:00
Benno Schulenberg 61ef38eb1b docs: bring the rtcwake man page closer to standard formatting
Also sort the options alphabetically, and use the standard comma
instead of the vertical bar to separate short from long option.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-29 12:14:56 +02:00
Karel Zak 68030a76d7 hwclock: check for permissions before use clock interface
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-29 08:27:00 +02:00
Sami Kerola 25a365ef5a swaplabel: move swapon-common to include directory
This fixes the following compiler warning.

disk-utils/swaplabel.c:175:2: warning: implicit declaration of function
'get_swap_prober' [-Wimplicit-function-declaration]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-28 12:28:05 +02:00
Lauri Nurmi 5adf126ef2 hwclock: use pluralized translations. 2014-07-28 11:47:50 +02:00
Benno Schulenberg 6070a9853a various: erase all traces of the long-obsolete ext filesystem
The same argument as for xiafs: dead for over ten years.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:58 +02:00
Benno Schulenberg 556c9c4842 various: erase all traces of the long-obsolete xiafs
The xiafs filesystem was removed from the kernel fifteen years ago,
and any kernel that contained it reached end of life ten years ago.
It's time to stop mentioning it in the mount man page and elsewhere.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:57 +02:00
Benno Schulenberg 00d1cc1ddf docs: improve some wordings in the man page of mount
Also sort the command-line options alphabetically
(with the customary exception of -V and -h).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:55 +02:00
Benno Schulenberg 5e43af7e34 docs: fix some things that were overlooked during the first pass
Mainly more option sorting, some formatting adjustments, and the adding
of a missing --version here and there.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:53 +02:00
Karel Zak e9b6e76a26 mount: clean up -t info in mount.8 and fstab.5
* remove the huge and unmaintained list of filesystems, just keep
   only very basic FS types in the man pages

 * add info about command delimited lists to fstab.5

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-25 13:08:41 +02:00
Karel Zak 64a7e20980 libmount: don't use /{proc,ext}/filesystems when more fs types specified
# mkfs.ext4 /dev/sda1
 # mount -t foo,bar /dev/sda1 /mnt

successfully mount the device, this is unexpected as extN is no
between wanted (by -t specified) filesystems.

Summary about -t:

 * "mount -t foo"        mount(2) with "foo" type

 * "mount -t foo,bar"    try mount(2) with "foo" or "bar"

 * "mount -t foo,auto"   try mount(2) with "foo" or ask libblkid for
                         the type

 * "mount -t nofoo,bar"  try types from /{etc,proc}/filesystems, but
                         exclude "foo" and "bar"

Note that more filesystems may be specified in fstab (as comma
delimited list). The stuff from fstab is always interpreted as list
and never as a pattern ("no" prefix makes no sense in fstab).

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-25 12:28:34 +02:00
Karel Zak a3c74d88e1 swapon: don't print errors as data in smartcols table
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-22 12:29:38 +02:00
Karel Zak 7c1fa4691f swapon: don't use empty strings for smartcols output
The libsmartcols is smart enough to accept NULL for empty fields
rather than empty strings.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-22 12:24:56 +02:00
Sami Kerola 5db57cfc46 swapon: share get_swap_prober() with swaplabel to print uuid and label
The swapon(8) listing was almost complete, apart from label and uuid.
This change moves the code from swaplabel(8) to shared scope to be used
for printouts in other swap commands, such as swapon.

Adding this feature to lsblk(8) was a consideration, but lsblk is not
interested of swapfiles, so the swapon seems like a better option to add
this information.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-22 12:17:20 +02:00
Benno Schulenberg b59c86c8d5 docs: bring one more man page closer to standard formatting
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-22 10:43:04 +02:00
Karel Zak c6f637e667 prlimit: remove repeating words from man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-21 16:09:38 +02:00
Benno Schulenberg c372860ddb docs: bring eight more man pages closer to standard formatting
Also, for chcpu, the options -c, -d, -e and -g are mutually exclusive,
and for the mode argument the option -p is not optional.  For ldattach,
use the standard options separator ", " instead of the unusual " | ".
And add the missing --version to several of the pages.  Besides, improve
the wording and the consistency of the spacing.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-21 10:29:44 +02:00
Benno Schulenberg cf8e0bae34 docs: bring five more man pages closer to standard formatting
Also, for renice, adapt the descriptions to the behaviour: the -g,
-p and -u options do not actually need to be followed by any ID.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-21 10:29:43 +02:00
Karel Zak 06716dffdc mount: update info about mtab in mount.8
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-21 10:27:25 +02:00
Karel Zak 7887c6e0f0 prlimit: clean up columns[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-18 13:54:31 +02:00
Karel Zak a560a3487b swapon: clean up columns[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-18 13:53:02 +02:00
Karel Zak d78deddc6d losetup: clean up columns[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-18 13:52:02 +02:00
Karel Zak 059a91f8d0 wdctl: clean up columns[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-18 13:50:33 +02:00
Karel Zak 86c58c4a82 umount: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-17 15:12:35 +02:00
Karel Zak df1a1ca0c9 fstrim: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-17 15:07:49 +02:00
Benno Schulenberg d179d01950 docs: bring four more man pages closer to standard formatting
In the IPC man pages strictly adhere to the memory, queue, semaphore
order, to reduce disorientation.  And for 'ipcmk', the arguments for
-M and -S and -p are not optional.  Add --version for 'mountpoint'.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-17 14:01:04 +02:00
Sami Kerola e612ead96a fstrim: avoid TOCTOU race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-17 14:01:02 +02:00
Sami Kerola 0407c1bef9 fallocate: avoid unnecessary computation
Where POSIX_FADV_SEQUENTIAL and HAVE_POSIX_FADVISE are not available it
is waste of resources to have variables that are meaningful only for
posix_fadvise().  Also initialize the variables immediately to correct
values, and since cachesz is never changed mark it read only.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-17 14:01:00 +02:00
Benno Schulenberg e33ee284f9 docs: bring some more man pages closer to standard formatting
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-16 12:03:26 +02:00
Benno Schulenberg 08626e33d4 docs: mount -o nouser is not useful, be clearer about that
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-15 13:22:29 +02:00
Benno Schulenberg 3711f11307 docs: many tiny formatting and wording improvements to man page of mount
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-14 16:21:35 +02:00
Benno Schulenberg 1f94a78ce8 docs: improve formatting and wording of a few man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-14 16:21:34 +02:00
Sami Kerola 4e6604e51a lscpu: avoid double free
The double free was possible for architectures other than x86_64 or i386.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 18:35:39 +01:00
Sami Kerola 7370501f60 setpriv: avoid alloca() use xmalloc() instead
The getgroups() can return up to NGROUPS_MAX supplementary groups, that
is (since kernel 2.6.3) 65536 in total.  The git_t is 4 bytes, so maximum
request is 256 kilobytes.  When a system happen to have memory preasure
alloca() may not be able to allocate enough memory, making debugging
unnecessarily difficult.  IMHO 64 pages is significant enough amount of
memory to be properly error checked at a time of allocation.

Reference: http://www.gnu.org/software/libc/manual/html_node/Disadvantages-of-Alloca.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 18:35:38 +01:00
Sami Kerola d9bdd89db1 dmesg: avoid unnecessary variable assignment
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 18:35:38 +01:00
Sami Kerola 9dd2d49735 lscpu: avoid use of bzero() in favor of memset()
The bzero() is marked as LEGACY in POSIX.1-2001.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 17:29:23 +01:00
Sami Kerola 0e65dcde88 textual: fix some typos
Found with misspell-check version 2.0d.

Reference: https://github.com/lyda/misspell-check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 17:21:02 +01:00
Karel Zak a6c6662d7c swapon: mark --sumarry as deprecated
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-30 11:03:12 +02:00
Sami Kerola 7471244148 swapon: align --summary fields
This commit makes  partitions and files to have remaining three columns
aligned.  Below print out demonstrates earlier misalignment.

$ swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda2                               partition       4194300 0       3
/home/src/util-linux/newswap            file    496     0       -1

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-06-30 10:43:04 +02:00
Benno Schulenberg 6ec8a0bac5 umount: slightly improve the man page
Remove some stray words from option arguments.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-06-30 10:22:38 +02:00
Karel Zak 575718a04a fallocate: use O_CREAT only for the default behavior
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-26 14:45:02 +02:00
Bernhard Voelker 38a5440c95 fallocate: fix check of number of arguments
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2014-06-26 14:27:08 +02:00
Pádraig Brady 14c9b68096 fallocate: clarify usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-26 13:05:16 +02:00
Karel Zak b7f3f147f2 fallocate: use err_exclusive_options(), cleanup getopt_long() stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-26 12:38:04 +02:00
Karel Zak 634a4cf1b2 fallocate: make man page readable for humans
Well, let's copy & past from fallocate(2) syscall man page rather than
try to be creative with another description for the flags.

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-26 12:04:12 +02:00
Karel Zak dac1cb536b fallocate: fix FALLOC_FL_ZERO_RANGE flag check
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-26 12:01:13 +02:00
peppe 033effcacd hwclock: sometimes one day lasts 23 hours.
If less than 23 hours have passed since the last calibration, hwclock
says "Not adjusting drift factor because it has been less than a day since
the last calibration.", but in fact compares to 23 hours, not 24.

This was originally reported at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689534

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-06-23 11:48:14 +02:00
Karel Zak 2ad2196349 build-sys: support ./configure ADJTIME_PATH=
.. to override the default /etc/adjtime path.

Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-19 10:30:56 +02:00
Karel Zak 8eba5feabe mount: fix man page [checkmans]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-18 12:58:49 +02:00
Karel Zak 65322517eb lscpu: fix ifdef HAVE_sys_io_h [checkconfig]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-18 12:51:25 +02:00
Karel Zak 58d1d54de9 mount: more hints about default mount options to man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-12 11:15:00 +02:00
Phillip Susi ce6d69ddac 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.
2014-06-09 10:46:02 +02:00
Nicolas Boichat a9add961e9 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>
2014-06-07 21:46:02 +08:00
Karel Zak 710ed55dcd libsmartcols: add debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-06 13:47:06 +02:00
Gui Hecheng f36de15e2f mount: add btrfs to mount.8
Based on Documentation/filesystems/btrfs.txt

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
2014-06-06 12:16:54 +02:00
Karel Zak ee312c654b 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>
2014-06-06 09:49:35 +02:00
Karel Zak 3859baf9c5 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
2014-05-30 12:01:27 +02:00
Ruediger Meier 60cb2c3720 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
2014-05-30 01:18:09 +02:00
Ruediger Meier b7744730f6 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>
2014-05-29 13:17:46 +02:00
Ruediger Meier 5bd31c6d6e 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>
2014-05-29 13:16:32 +02:00
Karel Zak b5f81ce2f5 build-sys: add sys-utils/uname26.8 to gitignore
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-29 11:50:44 +02:00
Ruediger Meier ae2c3b5bee 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>
2014-05-29 09:52:26 +02:00
Ruediger Meier 96ce475f96 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>
2014-05-29 01:27:25 +02:00
Stanislav Brabec d6ef7d6c69 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>
2014-05-28 09:18:40 +02:00
Karel Zak a37811b51f 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
2014-05-26 12:48:35 +02:00
Karel Zak edecf6376f 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>
2014-05-26 12:17:48 +02:00
Karel Zak fd7c492401 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>
2014-05-26 11:37:02 +02:00
Ruediger Meier f6eb160c6e 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>
2014-05-22 09:25:12 +00:00
Ruediger Meier 34c265f01c 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>
2014-05-22 09:41:24 +02:00
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
Karel Zak 0b6fbc2599 dmesg: don't use brow/yellow in output
The color used for subsystem prefix is useless on
while background. Let's use blue.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-01 14:32:38 +02:00
Karel Zak 742b128523 Merge branch 'fix-ipcs-q-fallback' of https://github.com/rudimeier/util-linux
* 'fix-ipcs-q-fallback' of https://github.com/rudimeier/util-linux:
  travis-ci: abort if make check fails
  ipcs: fix memleak in ipc_*_get_info functions
  ipcs: fix ipc_sem_get_info fallback case
  ipcs: fix ipc_shm_get_info fallback case
  ipcs: fix ipc_msg_get_info fallback case
  tests: add basic test case for ipcs -m -i n
  tests: add basic test case for ipcs -s -i n
  tests: add basic test case for ipcs -q -i n
  tests: quote generated arguments for ipcrm
  ipcs: cleanup jumplabel stlyes
2014-03-28 10:51:17 +01:00
Karel Zak 32ebf7e04e Merge branch 'fix-lscpu-cache' of https://github.com/rudimeier/util-linux
* 'fix-lscpu-cache' of https://github.com/rudimeier/util-linux:
  tests: cleanup, remove unused lscpu output
  tests: add lscpu dump for ppc cpu with no cache size
  lscpu: cleanup, use _PATH_SYS_CPU/NODE
  lscpu: don't abort if cache size is unknown
2014-03-28 10:41:44 +01:00
Ruediger Meier 1d56b55ea1 lscpu: cleanup, use _PATH_SYS_CPU/NODE
This make most lines shorter than 80 chars again (tab-witdh 4).

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-03-27 09:25:47 +01:00
Ruediger Meier 10d927ab3b lscpu: don't abort if cache size is unknown
There are systems where the size file does not exist. Most badly even
lscpu -p would abort allthough it does not use the size:
$ lscpu -p
lscpu: error: cannot open
/sys/devices/system/cpu/cpu0/cache/index0/size: No such file or directory

This patch does not abort in this case and prints "unknown size" in
human-readable case. For examle on this qemu pcc test machine:
$ lscpu
Architecture:          ppc
CPU op-mode(s):        32-bit
Byte Order:            Big Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
Model:                 Power Macintosh
BogoMIPS:              33.25
L1d cache:             unknown size
L1i cache:             unknown size

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-03-27 09:11:57 +01:00
Karel Zak caf1ba11a3 flock: use nfs4 fallback on EBADF too
The kernel regression (probably v3.4, commit 55725513) introduces a
new errno for O_RDONLY on NFS. Now it returns EBADF rather than EIO.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1078618
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-24 11:26:21 +01:00
Ruediger Meier d754315c54 unshare: include libmount.h to provide missing MS_* defines
Since 6728ca10 we are using MS_PRIVATE and MS_REC which are not defined
in some systems's sys/mount.h.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-03-17 11:48:47 +01:00