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>
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>
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>
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>
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>
docs: spelling, wording, and grammar fixes in the man page of whereis

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
docs: fix some wording and formatting in man page of swapon

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
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>
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>
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>
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.
swapon: remove extra word from usage

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>