libmount: use MS_SILENT for /{proc,etc}/filesystems

mount(8) needs to be doing silent mounts when doing this brute
forcing or when the filesystem is not explicitly specified.

Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: do not use va_list in the Ask API

  # fdisk /dev/sda
  Welcome to fdisk (util-linux 2.23).

  [...]

  Command (m for help): a
  Segmentation fault (core dumped)

It's too fragile, the va_list implementation is architecture specific
and it seems we need such thing in libfdisk at all.

Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk: don't re-allocate range string in Ask API

Signed-off-by: Karel Zak <kzak@redhat.com>
lib/loopdev: fix loopcxt_check_size() to work with blkdevs

The loopcxt_check_size() is workaround for kernels < v3.9, kernel has
been fixed by commit 541c742a7559eb65f0e36d3e2338c2ca532a3e61.

The function sets loopdev size according to backing file size. The
problem is that the backing file could be a block device where
stat.st_size is zero, so we have to use blkdev_get_size() for block
devices.

Addresses: https://bugs.archlinux.org/task/35193
Reported-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
losetup: use warn_size() for regular files only

Signed-off-by: Karel Zak <kzak@redhat.com>
losetup: add --raw and --noheadings

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: add losetup tests

Signed-off-by: Karel Zak <kzak@redhat.com>
lsblk: add SERIAL column

 ... to return short serial number of the disk (from udev db)

Addresses: https://github.com/karelzak/util-linux/issues/33
Signed-off-by: Karel Zak <kzak@redhat.com>
standard SEE ALSO section of man pages

The standard format is to seperate each entry with a comma, and
for each one to be on a line by itself.  Most util-linux pages
follow this, but a few do not.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
lib/tty: don't hardcode terminal fd in get_terminal_name()

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: don't ignore root fs on umount -a

The release v2.22 (the new umount) introduces a regression when root
fs is excluded from umount --all. There is not reason for this
exception. The libmount should be smart enough to disable mtab update
after rootfs umount.

Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
blkid: fix typo in ID_FS_AMBIVALEN=

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: add ReFS magic string

Reported-by: "Richard W.M. Jones" <rjones@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
sulogin: clean up error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
chcpu: clean up error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: use err.h in test

Signed-off-by: Karel Zak <kzak@redhat.com>
hwclock: use warn() to print cmos errors

Signed-off-by: Karel Zak <kzak@redhat.com>
mkfs.cramfs: use standard error message

Signed-off-by: Karel Zak <kzak@redhat.com>
uuidd: clean up error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
sfdisk: don't call BLKRRPART for non-block devices

Reported-by: Bertrand Jacquin <beber@meleeweb.net>
Signed-off-by: Karel Zak <kzak@redhat.com>