Commit Graph

8706 Commits

Author SHA1 Message Date
Karel Zak 4dcea32061 libfdisk: clean up debug, add help debug mask
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:13:32 +01:00
Karel Zak 2deb7cc347 libsmartcols: clean up debug, add help debug mask
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:13:22 +01:00
Karel Zak 3533341614 libmount: clean up debug, add help debug mask
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:13:12 +01:00
Karel Zak b7da851e5a libblkid: clean up debug, add "help" debug mask
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:12:20 +01:00
Karel Zak ef316a27de include/debug: improve and cleanup
* use ul_debug_ prefix for all routines
* support <NAME>_DEBUG=all also for programs without debug mask names
  (so we can avoid 0xffff mask in man pages)
* add function to print debug help

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 12:51:17 +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
Bernhard Voelker 169b85c9f2 findmnt: document --uniq option in man page
* misc-utils/findmnt.8: Add an entry for the -U, --uniq option
added in commit v2.24-132-gbebdda3.
2014-10-31 10:39:21 +01:00
Natanael Copa 7235e70391 hexdump: use 'll' format modifier instead of the non-standard 'q'.
The printf(3) man page says about 'q':
("quad". 4.4BSD and Linux libc5 only. Don't use.) This is a synonym for ll.

This fixes hexdump with musl libc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2014-10-31 10:39:18 +01:00
Mike Frysinger 72a2a3f5d7 libmount: improve kernel command line parsing
The current command line parser will stop at the first occurrence of an
option, however the kernel does the opposite.  So if you have:
	root=/dev/sda1 root=/dev/sda2
When you look for "root", the kernel will use /dev/sda2, but util-linux
uses /dev/sda1.

Further, if args are passed to custom init programs, the parser will
pick those up as kernel options.  So if you have:
	root=/dev/sda1 -- /foo bar=yes
The kernel will stop at the "--" and pass the rest to userland.  But if
you look for "bar", util-linux will incorrectly return "yes".

Ultimately, there's no way for util-linux to exactly parse the command
line the same way as the kernel -- we don't know exactly which ones the
kernel picks up and which it passes on to userland (either as env vars
or as command line args).  The kernel passes all unrecognized options.
These updates are simple best effort.

URL: https://bugs.gentoo.org/526754
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-10-31 10:39:15 +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
Benno Schulenberg 2e6f289a4e docs: spelling, wording, and grammar fixes in the man page of whereis
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-31 10:39:06 +01:00
Sami Kerola e3da3b39b5 bash-completion: use swapon label and uuid listing support
Simplifies the script, and makes swapoff to work for files when get
requests by label or uuid.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-31 10:39:01 +01:00
Sami Kerola 53154dae39 bash-completion: stop being clever when listing block devices
Various commands such as blkid, cfdisk, fdisk, delpart, and so on listed
only partitions and missed for example disks and volume groups.  The
right thing to do is to list all block devices in all for all commands
performing operations with them.  This might occasionally list unexpected
devices that I think is lesser bad than missing some.

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764488
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-31 10:39:00 +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
Sami Kerola 5d36513976 sfdisk: return deterministic value from sfdisk_deinit()
disk-utils/sfdisk.c:222:9: warning: variable 'rc' is uninitialized when
used here [-Wuninitialized]
        return rc;
disk-utils/sfdisk.c:208:8: note: initialize the variable 'rc' to silence
this warning
        int rc;

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-31 10:38:55 +01:00
Mike Frysinger 346dc42381 bash-completion: fix runuser install
The runuser symlink used to depend on su being enabled, but a refactoring
broke that.  So if you build with runuser enabled but not su, you end up
with a broken symlink.  Rework the logic so it works in both cases.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-10-31 10:38:53 +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
Federico Simoncelli f4822fdfc5 tests: add blkdiscard offsets test
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2014-10-27 09:16:46 +01:00
Karel Zak 819d9a2975 include/debug: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-24 11:19:23 +02:00
Karel Zak 16714abef2 blkid: remove extra trailing spaces in output
$  blkid | egrep -i 'sda.*label' | cat -A
/dev/sda2: UUID="8382f307-fb43-489f-ab38-8d4cf37ca88c" SEC_TYPE="ext2" TYPE="ext3" LABEL="test" $
/dev/sda5: UUID="0b46d673-8c23-4709-b92c-3fdf460e1dd4" TYPE="ext3" LABEL="rescue" SEC_TYPE="ext2" $
/dev/sda6: UUID="cb9d814f-d885-435b-8e6d-ac17c0ac5aa1" TYPE="ext3" LABEL="root" $
/dev/sda8: UUID="1e2851bd-cc6f-4d72-bf9f-c6fa754155b1" TYPE="ext3" LABEL="data" SEC_TYPE="ext2" $
/dev/sda9: UUID="d16a2f42-9a50-4489-a788-8624c832a7f3" TYPE="ext3" LABEL="storage" SEC_TYPE="ext2" $
/dev/sda7: TYPE="swap" LABEL="swap" UUID="8393acfa-d4bd-40fc-8eb9-5ccd8d85e103" $

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586179
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-23 14:43:31 +02:00
Karel Zak f4802c9011 whereis: reset search mask more carefully
# whereis -m cal -M /usr/share/man/man1/ -f ls
 cal: /usr/share/man/man1/cal.1.gz /usr/share/man/man1p/cal.1p.gz
 ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz

the -M also resets the search mask, so for 'ls' it returns also
binaries. That's bug. Expected result is:

 # ./whereis -m cal -M /usr/share/man/man1/ -f ls
 cal: /usr/share/man/man1/cal.1.gz /usr/share/man/man1p/cal.1p.gz
 ls: /usr/share/man/man1/ls.1.gz

the search mask has to be sensitive only to -b -m -s options,
otherwise the semantic is pretty messy.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-23 14:29:45 +02:00
Karel Zak 3635f53ca2 whereis: cleanup debug stuff, fix argv[] usage
* use debug stuff from include/debug.h and make whereis(1) sensitive
  to WHEREIS_DEBUG=0xffff mask

* fix problem with argv[] usage

  # whereis -b -m -M /usr/share/man/man1 -B /usr/bin -f gcc
  bin: /usr/local/bin
  gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz

the code ignores "-B" and /usr/bin is interpreted as search pattern,
expected result is:

  # whereis -b -m -M /usr/share/man/man1 -B /usr/bin -f gcc
  gcc: /usr/share/man/man1/gcc.1.gz /usr/bin/gcc

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765306
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-23 13:44:00 +02:00
Karel Zak fd211531e8 fdisk: add section about sizes to the man page
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594005
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-23 12:11:50 +02:00
Karel Zak 2ceaf42a2d docs: remove obsolete READMEs for (s)fdisk 2014-10-23 11:35:18 +02:00
Karel Zak b73cc3902b terminal-colors.d: add debug stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-22 17:25:19 +02:00
Karel Zak eb728f96aa terminal-colors.d: fix filter by name
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766077
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-22 16:36:55 +02:00
Karel Zak 65c3359633 docs: update TODO file
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-22 10:34:09 +02:00
Karel Zak 04c107ebeb docs: update TODO file
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-21 14:24:00 +02: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 f0f2be20ed sfdisk: fix compiler warnings about uninitialized variables
warning: 'str' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-20 14:07:21 +02:00
Sami Kerola d07b223788 ul: fix filter() indentation
Content of the while() loop missed one indentation step.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-20 14:07:20 +02:00
Sami Kerola d8c1fc7ac4 setterm: fix dubious one-bit signed bitfield [smatch scan]
term-utils/setterm.c:165:24: error: dubious one-bit signed bitfield

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-20 14:07:19 +02: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
Karel Zak 7190b9b2ce libfdisk: add more comments
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-16 13:15:06 +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