Commit Graph

1773 Commits

Author SHA1 Message Date
Sami Kerola ea9416925c
uuidd: reorder bulk time and random generation code
Write the data and response length values in same close to order they appear
in protocol.  This should make code a little easier to read.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-11-23 22:47:13 +00:00
Sami Kerola 2049075a79
uuidd: document uuidd protocol
Seeing what can be expected should make it easier to understand what the
code does.

Notice that simply writing down the resposes one can start wondering deeper
questions, such as, why does the time bulk response reply only one uuid
followed by number how many were requested?  Was that a some type of TODO
note?

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-11-23 22:33:33 +00:00
Sami Kerola 77a54655bb
uuidd: override operation type when performing bulk request
Relying to single vs bulk requests to be exactly two steps away from each
other was an unnecessary dirty trick.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-11-23 21:34:40 +00:00
Sami Kerola 084efcee43
uuidd: move option parsing to separate function
Moving the option parsing to a separate function will allow moving some
variables from main() heap to be in scope that free them later.  That should
make the uuidd to have a little bit smaller runtime memory allocation.

The static long options is changed to be local variable.  That should make
it to be part of heap for a bit, until removed.  Earlier the variable was in
data segment and permanently in runtime memory.  Whether this makes any
impact either way is not entirely clear, but hope is the runtime memory
allocation is tiny bit smaller.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-11-23 21:34:40 +00:00
Sami Kerola b03ffec18c
uuidd: add command-line option values struct
The struct will help seeing where the variable values are coming from.  This
will also help upcoming refactoring.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-11-23 21:34:40 +00:00
Sami Kerola c14e0f6239
uuidd: use pid_t type when referring to process id
Earlier use of a variable that holds switch enabling boolean to hold process
id was a little bit strange, and not exactly correct.  An int should be good
enough to hold any pid, but it is better to be precise and use the type that
is meant for the job.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-11-23 21:34:39 +00:00
Sami Kerola 3ea54b843c
man: make tilde and caret characters to render correctly
As mentioned in 'Generating optimal glyphs' title in the manual page
mentioned in reference:

    Where a proper caret (^) that renders well in both a terminal and PDF is
    required, use "\(ha".

    Using a naked "~" character results in a poor rendering in PDF.  Instead
    use "\(ti".

Reference: https://man7.org/linux/man-pages/man7/man-pages.7.html#STYLE_GUIDE
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-11-14 15:22:34 +00:00
Karel Zak e577bea10e wipefs: (man) add hint to erase on partitions and disk
Addresses: https://github.com/karelzak/util-linux/issues/1177
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-09 12:54:18 +01:00
Karel Zak de9cbcdcef Merge branch 'whereis' of https://github.com/ferivoz/util-linux
* 'whereis' of https://github.com/ferivoz/util-linux:
  whereis: extend test case
  whereis: filter bin, man and src differently
  whereis: do not strip suffixes
  whereis: do not ignore trailing numbers
  whereis: add --disable-whereis to configure
  whereis: add lib32 directories
  whereis: support zst compressed man pages
  whereis: fix out of boundary read
2020-11-06 09:44:52 +01:00
Samanta Navarro 653f672ab6 whereis: filter bin, man and src differently
Consider "s." prefixes for source code files only (even though I do not
know which VCS does that), compression suffixes for manual pages and
strict matching for executables.

Calling "whereis python3" is kind of okay to return python3.8 next to
python3, but python3.8-config is not the same tool as python3.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:43:09 +00:00
Samanta Navarro 117ddbeedc whereis: do not strip suffixes
The whereis implementations of FreeBSD, macOS, NetBSD, and OpenBSD do
not strip suffixes. Although whereis is not a POSIX tool and has no
shared standard, even its manual page indicates that the supplied names
are command names.

Commands do not have a suffix on Linux systems.

Stripping suffixes actually leads to issues with tools like fsck.ext4,
since fsck.ext4 is not the same tool as fsck and definitely not the same
tool as fsck.minix.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:43:09 +00:00
Samanta Navarro d95ee9fd75 whereis: do not ignore trailing numbers
The commands diff and diff3 are so distinct that their manual pages
should not be mixed in whereis output.

Theoretically this works for commands and binaries with links to each
other, e.g. gpg and gpg2, but if gpg is version 1 and gpg2 is version 2
then manual pages do not match either.

Also the while loop does not decrement "i" while incrementing "dp". The
effect of this is that the output of whereis depends on manual pages
being compressed or not.

The easiest solution is to not ignore trailing numbers.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:43:09 +00:00
Samanta Navarro 74b7c01fa6 whereis: add lib32 directories
These directories are sometimes used by Linux distributions.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:43:09 +00:00
Samanta Navarro 6065250a4d whereis: support zst compressed man pages
Add zst as extension for manual pages. Current version of man-db
supports zst extension out of the box.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:43:09 +00:00
Samanta Navarro cd4142f7c3 whereis: fix out of boundary read
If whereis encounters a short file name then an out of boundary
read can occur.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:43:09 +00:00
Samanta Navarro bd0f347f86 misc: fix typos
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:42:28 +00:00
Karel Zak ac3a0fd92e blkid: add --hint <name>=value
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-03 17:15:34 +01:00
Karel Zak 1ab5f9b705 docs: rename to getopt-example
Addresses: 27114b2974 (commitcomment-43591002)
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-03 15:23:03 +01:00
Sami Kerola 364de8f4f5 lib/randutils: rename random_get_bytes()
Rename random_get_bytes() to avoid colliding a Solaris library function that
has the same name.

Reported-by: Sad Clouds <cryintothebluesky@gmail.com>
Reference: https://lore.kernel.org/util-linux/20201101141608.ba365cf67d92ee3973226de9@gmail.com/
Reference: https://blogs.oracle.com/solaris/solaris-random-number-generation-v2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-11-03 12:38:45 +01:00
Karel Zak 07c8462fb7 cal: do not use putp(), directly use stdio functions
It seems our putp() based output is not portable as some ncurses
implementations strictly follow POSIX where putp() accepts only
terminfo capability strings and nothing else.

We already use standard stdio.h functions to output terminfo strings
(e.g.  for colors). It seems we can do the same for cal(1) to
highlight the current day.

Note that mix putp() and fputs() is bad idea due to different
buffering ways in some cases (see cal.c git log for more details).

This patch also reduces complexity of the code as we can directly
output to stdout without snprintf to string.

Addresses: https://github.com/karelzak/util-linux/pull/1167
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-21 10:19:26 +02:00
Sami Kerola dab057ebd2 hardlink: fix hardlink pcre leak
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-10-16 11:25:11 +02:00
Karel Zak a83bea2d3d bash-completion: (lsblk) update columns
and fix lsblk --help output

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-12 13:19:35 +02:00
Karel Zak 7636d906ef lsblk: add --width option
Addresses: https://github.com/karelzak/util-linux/issues/1160
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-12 12:19:48 +02:00
Karel Zak 27114b2974 build-sys: use _DATA to install getopt examples
* rename the files to getopt-example.*
* use automake _DATA rather than _SCRIPT

Addresses: https://github.com/karelzak/util-linux/issues/1149
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-06 15:47:02 +02:00
Karel Zak eee886ba1d build-sys: exclude GPL from libcommon
The library is not distributed and almost all code in this ar(1)
archive is Public Domain or LGPL ... but let's avoid any doubts and do
not mix non-GPL and GPL code there.

Addresses: https://github.com/karelzak/util-linux/issues/1157
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-06 13:26:36 +02:00
Karel Zak b95752ad20 lsblk: fix SCSI_IDENT_SERIAL
It seems sg3_utils does not use ID_ prefix like other udev stuff.

Addresses: https://github.com/karelzak/util-linux/issues/1143
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-24 09:56:03 +02:00
Karel Zak de6c2a4aec lsblk: read ID_SCSI_IDENT_SERIAL if available
This SERIAL comes from sg3_utils.

Addresses: https://github.com/karelzak/util-linux/issues/1143
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-23 15:41:05 +02:00
Karel Zak c90a8f1a3c lsblk: show all empty, except loopdevs
This patch improves the previous commit to accept also another empty devices.

Addresses: https://github.com/karelzak/util-linux/issues/1118
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-09 14:50:02 +02:00
Karel Zak 14bb8e3ca6 lsblk: ignore only loopdevs without backing file
* do not ignore all empty devices, we need more smart solution

* ignore only loop devices without backing file, for example:
 # touch img
 # losetup -f img
 losetup: img: Warning: file is smaller than 512 bytes; the loop device may be useless or invisible for system tools.

 - old version display nothing
 - new version:

 # lsblk /dev/loop0
 NAME  MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
 loop0   7:0    0   0B  0 loop

Addresses: https://github.com/karelzak/util-linux/issues/1118
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-09 12:23:33 +02:00
Karel Zak bb6c51a650 lsblk: print zero rather than empty SIZE
Addresses: https://github.com/karelzak/util-linux/issues/1118
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-09 12:00:10 +02:00
Karel Zak 6932a11035 lsblk: fix -T optional argument
Addresses: https://github.com/karelzak/util-linux/issues/1132
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-02 11:10:18 +02:00
Michael Kerrisk (man-pages) 359b522c39 Manual pages: wipefs.8: Formatting fixes
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-24 14:41:49 +02:00
Michael Kerrisk (man-pages) 4aabe42985 Manual pages: lsblk.8: Minor formatting and typo fixes
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-24 14:41:49 +02:00
Michael Kerrisk (man-pages) cbb38bfbdf Manual pages: logger.1: minor formatting and typo fixes
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-24 14:41:49 +02:00
Chris Hofstaedtler 7259f318b9 manpages: fix "The example command" in AVAILABILITY section
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
2020-07-24 09:09:43 +02:00
Karel Zak 7cdec9dff8 libuuid: (test) cleanup unused memory [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-14 11:56:15 +02:00
Milan Broz e19e522df0 lsblk: Add SERIAL column to the SCSI output mode.
If there are several identical disks, disk serial number can help
to distinguish exact drive.

This could be helpful in debugging RAID failures and similar problems.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
2020-07-14 10:37:56 +02:00
Bjarni Ingi Gislason ed554da252 docs: misc-utils: change "allows to <verb>" to "allows <verb>ing"
The web site "lintian.debian.org" shows some examples of "allows to",
which are changed to "allows one to".

  I chose here to use gerund.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-07-14 10:37:54 +02:00
Bjarni Ingi Gislason b11861d7a0 Subject: docs: change from nofill to fill mode
Change request nofill mode to fill mode.

  Warning from "mandoc -Tlint":

mandoc: ./misc-utils/uuidd.8.in:81:2: STYLE: fill mode already disabled, skipping: nf

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-07-14 10:37:47 +02:00
Bjarni Ingi Gislason 0d0d6f1a69 docs: remove trailing space in strings
Trim trailing space in strings.

  There is no change in the output of "nroff" and "groff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-07-14 10:37:45 +02:00
Mauricio Faria de Oliveira 477239ce0d rename: fix regression for symlink with non-existing target
Since commit 5454df9c31 ("rename: check source file access early")
rename fails early for symlinks with non-existing target (regression),
because access() dereferences the link.

From access(2):

  "access() checks whether the calling process can access the file pathname.
   If pathname is a symbolic link, it is dereferenced."

Thus replace access() with faccessat() and lstat() as fallback,
(as in do_symlink()), that is equivalent for symlink and files.

From fsaccess(2) and stat(2):

  "The faccessat() system call operates in exactly the same way as access(),
   except for the differences described here.
   [...]
   If pathname is relative and dirfd is the special value AT_FDCWD, then pathname
   is interpreted relative to the current working directory of the calling process
   (like access()).
   [...]
   AT_SYMLINK_NOFOLLOW
     If pathname is a symbolic link, do not dereference it:
     instead return information about the link itself."

  "lstat() is identical to stat(), except that if pathname is a symbolic link, then
   it returns information about  the  link  itself, not the file that it refers to."

Testing
-------

  1) symlink with existing target
  2) symlink with non-existing target
  3) non-existing symlink
  4) existing file
  5) non-existing file

Before:

  $ touch file-found
  $ ln -s file-found symlink-1
  $ ./rename sym symbolic- symlink-1	# XPASS.
  $ echo $?
  0

  $ ln -s file-not-found symlink-2
  $ ./rename sym symbolic- symlink-2	# FAIL! REGRESSION.
  rename: symlink-2: not accessible: No such file or directory
  $ echo $?
  1

  $ ./rename sym symbolic- symlink-3	# XFAIL.
  rename: symlink-3: not accessible: No such file or directory
  $ echo $?
  1

  $ touch file-found
  $ ./rename found existing file-found	# XPASS.
  $ echo $?
  0

  $ ./rename found existing file-not-found # XFAIL.
  rename: file-not-found: not accessible: No such file or directory
  $ echo $?
  1

After:

  $ touch file-found
  $ ln -s file-found symlink-1
  $ ./rename sym symbolic- symlink-1	# XPASS.
  $ echo $?
  0

  $ ln -s file-not-found symlink-2
  $ ./rename sym symbolic- symlink-2	# PASS! REGRESSION FIXED.
  $ echo $?
  0

  $ ./rename sym symbolic- symlink-3	# XFAIL.
  rename: symlink-3: not accessible: No such file or directory
  $ echo $?
  1

  $ touch file-found
  $ ./rename found existing file-found	# XPASS.
  $ echo $?
  0

  $ ./rename found existing file-not-found # XFAIL.
  rename: file-not-found: not accessible: No such file or directory
  $ echo $?
  1

And to test/simulate faccessat()'s EINVAL for AT_SYMLINK_NOFOLLOW
for Mac OS X, per commit 826538bf64 ("rename: skip faccessat()
failure if AT_SYMLINK_NOFOLLOW is not a valid flag"), forced 'if'
to evaluate to false so that lstat() is taken.

It still fails early; the error messages are slightly different
('not accessible' vs. 'stat of ... failed') but still tell same
'No such file or directory'; exit code is the same as well.

  $ ./rename sym symbolic- symlink-3	# XFAIL. DIFF MSG/SAME RC.
  rename: stat of symlink-3 failed: No such file or directory
  $ echo $?
  1

  $ ./rename found existing file-not-found # XFAIL. DIFF MSG/SAME RC.
  rename: stat of file-not-found failed: No such file or directory
  $ echo $?
  1

Tested on commit 2b41c409e ("Merge branch 'blkd-err' of ...")

Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
2020-07-07 16:19:15 -03:00
Karel Zak 7586e9d1aa cal: use size_t to calculate width [lgtm scan]
We use size_t for width. This patch makes it consistent for
years_width too.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-03 13:17:51 +02:00
Bjarni Ingi Gislason 8292383df7 doc: misc-utils/*: Fix some warnings from "mandoc -T lint"
mandoc: ./misc-utils/cal.1:214:2: WARNING: skipping paragraph macro: br after sp
mandoc: ./misc-utils/cal.1:216:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/cal.1:225:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./misc-utils/findfs.8:36:2: WARNING: skipping paragraph macro: br after sp
mandoc: ./misc-utils/findfs.8:38:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/findfs.8:41:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/findfs.8:44:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/findfs.8:48:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./misc-utils/logger.1:118:15: STYLE: unterminated quoted argument
mandoc: ./misc-utils/logger.1:231:2: WARNING: skipping paragraph macro: IP empty

mandoc: ./misc-utils/look.1:116:2: STYLE: fill mode already disabled, skipping: nf

mandoc: ./misc-utils/hardlink.1:1:5: STYLE: lower case character in document title: TH hardlink
mandoc: ./misc-utils/hardlink.1:1:2: WARNING: missing date, using today's date: TH
mandoc: ./misc-utils/hardlink.1:9:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./misc-utils/hardlink.1:52:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./misc-utils/hardlink.1:65:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./misc-utils/rename.1:65:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:65:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:97:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:107:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:116:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./misc-utils/whereis.1:82:2: WARNING: line scope broken: IP breaks TP
mandoc: ./misc-utils/whereis.1:152:2: WARNING: skipping paragraph macro: PP empty

####

  There is no change in the ouput of "nroff" or "groff", except for

1) a very long line in "logger.1".

2) '-' changed to '\-' for a option in "logger.1".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-06-15 11:28:01 +02:00
Bjarni Ingi Gislason a0859be5c7 doc: Fix some warnings from "test-groff" for manuals
Source is current git content.

Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ././disk-utils/sfdisk.8

troff: backtrace: file '<./disk-utils/sfdisk.8>':67
troff: <./disk-utils/sfdisk.8>:67: warning: trailing space

Input file is ././misc-utils/kill.1

troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':133: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: macro 'mF' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: number register 'mE' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: bad font number
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':135: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: number register 'sP' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':170
troff: <./misc-utils/kill.1>:170: warning: bad font number

Input file is ././sys-utils/ipcs.1

<./sys-utils/ipcs.1>:103 (macro BR): only 1 argument, but more are expected

Input file is ././sys-utils/mount.8

<./sys-utils/mount.8>:68 (macro RB): only 1 argument, but more are expected
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-old.tmac':467: macro 'RB'
troff: backtrace: file '<./sys-utils/mount.8>':68
troff: <./sys-utils/mount.8>:68: warning [p 1, 3.5i]: can't break line
an-old.tmac: <./sys-utils/mount.8>:201 (.RE): warning: extra .RE or .RS is missing before it; "an-RS-open" is 0.
<./sys-utils/mount.8>:453 (macro BR): only 1 argument, but more are expected
<./sys-utils/mount.8>:500 (macro BR): only 1 argument, but more are expected
<./sys-utils/mount.8>:1050 (macro BR): only 1 argument, but more are expected

Input file is ././sys-utils/setpriv.1

<./sys-utils/setpriv.1>:17 (macro BR): only 1 argument, but more are expected
<./sys-utils/setpriv.1>:154 (macro BR): only 1 argument, but more are expected
<./sys-utils/setpriv.1>:166 (macro BR): only 1 argument, but more are expected

Input file is ././sys-utils/umount.8

<./sys-utils/umount.8>:145 (macro IR): only 1 argument, but more are expected

Input file is ././sys-utils/unshare.1

<./sys-utils/unshare.1>:266 (macro BR): only 1 argument, but more are expected

[kzak@redhat.com: - add .RS to fix extra .RE in mount.8]

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-10 10:22:58 +02:00
Michael Kerrisk (man-pages) 1538f6f636 Manual pages: wording fix: "another" ==> "other"
In several pages, there is a consistent wording problem: "another"
where "other" should be used. This wording problem can be
surprisingly confusing for native speakers, especially those
unaware that in some other languages, "another" and "other" can be
expressed with the same word.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 14:31:47 +02:00
Michael Kerrisk (man-pages) 3bc92f313a Manual pages: rename EXAMPLE section to EXAMPLES
Earlier, I patched various pages to consistently use EXAMPLE as a
section heading, rather than EXAMPLES.  (At that time, both headings
occurred in util-linux, with roughly equal frequency.)

Since then, I've observed that EXAMPLES is the more common usage
across a large corpus of manual pages. So, in Linux the man-pages
project, I switched to using EXAMPLES also. This patch makes the same
change for util-linux.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-28 14:51:54 +02:00
Michael Kerrisk (man-pages) a374630f76 Manual pages: kill.1: improve the description of the --timout option
The text describing this option is a little hard to understand.
Improve it.

Cc: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-28 14:51:52 +02:00
Michael Kerrisk (man-pages) 226c38d447 Manual pages: kill.1: various language, spelling, and formatting fixes
These seem all "obviously correct", so I'm rolling them up into
one patch.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-28 14:51:51 +02:00
Karel Zak 921ceaca31 wipefs: add --lock and LOCK_BLOCK_DEVICE
Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-27 17:00:08 +02:00
Michael Kerrisk (man-pages) 67e63c1263 Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the NOTES, HISTORY, BUGS, and EXAMPLE
sections are always placed near the end of the page, just above
AUTHORS, COPYRIGHT, SEE ALSO, and AVAILABILITY.

One page is not fixed by this patch: term-utils/agetty.8. This page
is a mess of unusual section names, and probably requires an individual
edit.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-22 10:25:50 +02:00
Michael Kerrisk (man-pages) ade04bb89c Manual pages: order AUTHORS / COPYRIGHT / SEE ALSO / AVAILABILITY consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the AUTHORS, COPYRIGHT, SEE ALSO, and
AVAILABILITY sections are always placed at the end of the page.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-22 10:25:49 +02:00
Michael Kerrisk (man-pages) a87f49f662 Manual pages: use the term "exit status"
The manual pages currently use a multitude of terms--"exit code",
"error code", "return code", "exit code", and so on--when what
is always meant is "exit status" (the POSIX term). This patch fixes
as many of these erroneous terms as I could find.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:52 +02:00
Michael Kerrisk (man-pages) 7e765c93dc Manual pages: Standardize on EXIT STATUS as section title
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have EXIT STATUS (18), EXIT CODES (3), RETURN CODE (7),
RETURN CODES (1), or RETURN VALUE (4 instances in pages that document
commands, rather than functions).

Let's standardize on the EXIT STATUS (which is also what is
suggested in man-pages(7), and is the POSIX terminology).

A subsequent patch will clean up corresponding miswordings in
manual page text.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:12 +02:00
Michael Kerrisk (man-pages) ef293e185e Manual pages: Standardize on CONFORMING TO as section title
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have STANDARDS (3) or CONFORMING TO (6).
Let's standardize on the latter (which is also what is
suggested in man-pages(7)).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:12 +02:00
Michael Kerrisk (man-pages) bc281b0991 Manual pages: Standardize on EXAMPLE as section title
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have EXAMPLE (10) or EXAMPLES (23).
Let's standardize on the EXAMPLE (which is also what is
suggested in man-pages(7)) and used consistently across
a large number of pages in the Linux man-pages project.

(I realize the choice to go EXAMPLE, rather than EXAMPLES,
may be debatable. If necessary, I'd write a patch that instead
goes the other way, but I'd prefer to follow man-pages(7).)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:12 +02:00
Michael Kerrisk (man-pages) a8d0d330cf Manual pages: Standardize on AUTHORS as section title
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

In the Linux man-pages project, I long ago did away with the
AUTHOR(S) section, but I realize some projects like to keep this.

But, let's make sure that the section is consistently titled
across pages. Currently we have AUTHOR (47) or AUTHORS (41).
Let's standardize on the latter (which is also what is
suggested in man-pages(7)).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:12 +02:00
Michael Kerrisk (man-pages) 5a82980632 docs: (man) remove double quotes (") in .SH lines
Using double quotes in .SH lines containing multiple words is unneeded,
and in any case is not consistently done in the util-linux manual pages,
where double quotes are used in only around half of the cases.
(This usage was long ago elminated in the man-pages project, with
no ill effects reported to date.)

Remove these quotes, so that .SH lines are more uniform, in preparation
for some (more easily) scripted doiscovery of consistency problems in
(and possibly global fixes to) the manual pages.

Other than stripping the double quotes, this patch makes no changes to
the content of the manual pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 12:15:34 +02:00
Karel Zak 9cdd10e82a Merge branch 'cal_column' of https://github.com/utix/util-linux
* 'cal_column' of https://github.com/utix/util-linux:
  cal: Remove todo
  cal: Add test, all are checked against ncal
  cal: Update man page
  cal: Add column mode
  cal: Add helper functions for left align
  cal: Add weekdays into cal_control
2020-05-18 11:21:22 +02:00
Bjarni Ingi Gislason c5178f2796 docs: Some minor fixes in some manuals
Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ././misc-utils/kill.1

<./misc-utils/kill.1>:173 (macro BR): only 1 argument, but more are expected

Input file is ././misc-utils/lsblk.8

troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-old.tmac':478: macro 'BR'
troff: backtrace: file '<./misc-utils/lsblk.8>':122
troff: <./misc-utils/lsblk.8>:122: warning: trailing space

Input file is ././sys-utils/mount.8

an-old.tmac: <./sys-utils/mount.8>:2427 (.RE): warning: extra .RE or .RS is missing before it; "an-RS-open" is 0.

Input file is ././sys-utils/unshare.1

<./sys-utils/unshare.1>:176 (macro BR): only 1 argument, but more are expected
<./sys-utils/unshare.1>:181 (macro BR): only 1 argument, but more are expected
<./sys-utils/unshare.1>:240 (macro BR): only 1 argument, but more are expected
<./sys-utils/unshare.1>:246 (macro BR): only 1 argument, but more are expected

Input file is ././term-utils/agetty.8

troff: backtrace: file '<./term-utils/agetty.8>':130
troff: <./term-utils/agetty.8>:130: warning: trailing space

Input file is ././text-utils/more.1

troff: backtrace: file '<./text-utils/more.1>':91
troff: <./text-utils/more.1>:91: warning: macro 'b' not defined

  The output from nroff and troff is unchanged, except for the word
"number" in text-utils/more.1, that was missing.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-05-18 10:35:25 +02:00
Ritika Srivastava c8487d854b lsblk: Ignore hidden devices
Lsblk throws the following error for nvmeNcXnY devices.

lsblk: nvme1c1n1: unknown device name

This is because nvmeNcXnY devices are hidden and do not have
the file /sys/block/<nvmeNcXnY>/dev.

Following patch was added
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=d51f05bfecb299a830897106460bf395be440c0a
Which made lsblk read from /sys/block/<nvmeNcXnY>/device/dev
which do exist for nvmeNcXnY devices.

After the above patch, the unknown error goes away.
However, another error is encountered in the very next step.

nvme1c1n1: failed to initialize sysfs handler

This is because lsblk looks for /sys/dev/block/242:1
(nvmeNcXnY major:minor) pathname which usually exists for other
block devices but not for the nvmeNcXnY devices as they are hidden.

Below patch does not even print this error for hidden devices
and exits silently.

[kzak@redhat.com: - add prefix to make sysfs_devname_is_hidden()
                    usable for  /sys dumps
                  - use the function in initialize_device() more early]

Signed-off-by: Ritika Srivastava <ritika.srivastava@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-14 15:48:26 +02:00
Aurelien LAJOIE 29d3a8f346 cal: Update man page 2020-05-11 17:41:33 +02:00
Aurelien LAJOIE 27fafcf8a8 cal: Add column mode
Add`-v` `--vertical` option to get a vertical output
Add it into relative bash-completion

For example `cal -yv`

                             2020

    January            February           March
Su     5 12 19 26         2  9 16 23      1  8 15 22 29
Mo     6 13 20 27         3 10 17 24      2  9 16 23 30
Tu     7 14 21 28         4 11 18 25      3 10 17 24 31
We  1  8 15 22 29         5 12 19 26      4 11 18 25
Th  2  9 16 23 30         6 13 20 27      5 12 19 26
Fr  3 10 17 24 31         7 14 21 28      6 13 20 27
Sa  4 11 18 25         1  8 15 22 29      7 14 21 28

    April              May                June
Su     5 12 19 26         3 10 17 24 31      7 14 21 28
Mo     6 13 20 27         4 11 18 25      1  8 15 22 29
Tu     7 14 21 28         5 12 19 26      2  9 16 23 30
We  1  8 15 22 29         6 13 20 27      3 10 17 24
Th  2  9 16 23 30         7 14 21 28      4 11 18 25
Fr  3 10 17 24         1  8 15 22 29      5 12 19 26
Sa  4 11 18 25         2  9 16 23 30      6 13 20 27

    July               August             September
Su     5 12 19 26         2  9 16 23 30      6 13 20 27
Mo     6 13 20 27         3 10 17 24 31      7 14 21 28
Tu     7 14 21 28         4 11 18 25      1  8 15 22 29
We  1  8 15 22 29         5 12 19 26      2  9 16 23 30
Th  2  9 16 23 30         6 13 20 27      3 10 17 24
Fr  3 10 17 24 31         7 14 21 28      4 11 18 25
Sa  4 11 18 25         1  8 15 22 29      5 12 19 26

    October            November           December
Su     4 11 18 25      1  8 15 22 29         6 13 20 27
Mo     5 12 19 26      2  9 16 23 30         7 14 21 28
Tu     6 13 20 27      3 10 17 24         1  8 15 22 29
We     7 14 21 28      4 11 18 25         2  9 16 23 30
Th  1  8 15 22 29      5 12 19 26         3 10 17 24 31
Fr  2  9 16 23 30      6 13 20 27         4 11 18 25
Sa  3 10 17 24 31      7 14 21 28         5 12 19 26
2020-05-11 17:27:06 +02:00
Aurelien LAJOIE 4de7efb505 cal: Add helper functions for left align 2020-05-11 17:25:34 +02:00
Aurelien LAJOIE 0c440bd7a2 cal: Add weekdays into cal_control 2020-05-11 17:23:37 +02:00
Karel Zak 885336d9dc wipefs: fix man page --no-headings short option
Addresses: https://github.com/karelzak/util-linux/issues/1029
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-06 15:18:52 +02:00
Anthony Iliopoulos b239651bba lsblk: add dax (direct access) capability column
Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
2020-05-06 15:09:39 +02:00
Sven Wiltink e81d0f8006 lsblk: Fall back to ID_SERIAL
In some cases ID_SERIAL_SHORT isn't provided by libudev, but ID_SERIAL
is. An example of this are virtio devices. See the output of udevadm
info:
P: /devices/pci0000:00/0000:00:06.0/virtio2/block/vdb
N: vdb
S: disk/by-id/virtio-08491434ee711d3420e9
S: disk/by-path/pci-0000:00:06.0
S: disk/by-path/virtio-pci-0000:00:06.0
E: DEVLINKS=/dev/disk/by-id/virtio-08491434ee711d3420e9 /dev/disk/by-path/pci-0000:00:06.0 /dev/disk/by-path/virtio-pci-0000:00:06.0
E: DEVNAME=/dev/vdb
E: DEVPATH=/devices/pci0000:00/0000:00:06.0/virtio2/block/vdb
E: DEVTYPE=disk
E: ID_PATH=pci-0000:00:06.0
E: ID_PATH_TAG=pci-0000_00_06_0
E: ID_SERIAL=08491434ee711d3420e9
E: MAJOR=252
E: MINOR=16
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=1403804

[kzak@redhat.com: - add ID_SERIAL also to get_properties_by_file()]

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-04 11:21:01 +02:00
Rosen Penev ad296391f9
[clang-tidy] fix wrong *cmp usage
Found with bugprone-suspicious-string-compare

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-20 13:21:00 -07:00
Rosen Penev 042f62dfc5
[clang-tidy] do not use else after return
Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-20 13:20:59 -07:00
Rosen Penev bd89499e07
[clang-tidy] do not return in void functions
Found with readability-redundant-control-flow

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-19 14:03:21 -07:00
Aurelien LAJOIE a5e322f4f4 cal: correctly set the week width
There is seven values but only 6 spaces between them, that why the -1
The value is always used with a minus one, just set it correctly instead
of always fix when used

Signed-off-by: Aurelien LAJOIE <orel@melix.net>
2020-03-31 15:32:01 +02:00
Aurelien LAJOIE b908299188 cal: Correctly center the year
Signed-off-by: Aurelien LAJOIE <orel@melix.net>
2020-03-31 15:31:54 +02:00
Aurelien LAJOIE c1f1439316 cal: use a const char*
A put string function should not modify the char*

Signed-off-by: Aurelien LAJOIE <orel@melix.net>
2020-03-31 15:31:52 +02:00
Sami Kerola 735fd5ed2b
docs: kill.1 add note about shell-internal kill implementations
Requested-by: Ilia Baryshnikov <qwelias@gmail.com>
Reference: https://github.com/karelzak/util-linux/issues/991#issuecomment-602108648
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-03-22 09:37:41 +00:00
Karel Zak c6d8486aad findmnt: make xalloc use mroe robust
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1807003
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-02-27 10:02:39 +01:00
Karel Zak 91b636b565 lsblk: fix -P regression from v2.34
Since v2.34 --list prints devices only once to make the output
user-readable. Unfortunately, it's regression for scripts/applications
where we need to parse lsblk output. So, let's make --pairs and --raw
backwardly compatible with versions before 2.34 and print all hierarchy.

Addresses: https://github.com/ibm-s390-tools/s390-tools/issues/80
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-02-25 15:31:23 +01:00
Sami Kerola f6b6beaf6a
various: fix more lgtm scan warnings
The logger and rtwake time function changes continue the same fixes as
previous commit - use thread safe functions.  The libsmartcols condition
removal is possible because width must be greater than tb->termwidth that is
size_t and cannot be smaller than zero.  And remove couple FIXME's that are
old and unlikely ever to get fixed.

Reference: 3160589d86
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-02-20 20:18:46 +00:00
Sami Kerola 44702f12f7
getopt: use examples installation directory in man page
Addresses: https://bugs.debian.org/913049
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-02-15 15:24:01 +00:00
Sami Kerola 3160589d86
various: use threadsafe versions of time functions [lgtm scan]
Deprecating calls to not-thread safe asctime(), ctime(), and localtime()
calls is pretty close to pointless change.  Lets do it to reduce lgtm scan
warnings with justification it's nicer to use static analysis tools when
they have very few positives.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-02-15 15:23:44 +00:00
Karel Zak f1970cc557 docs: improve size arguments description in --help output
Let's add "Arguments:" section to the --help output and describe
{K,M,G...}iB suffixes there.

Addresses: https://github.com/karelzak/util-linux/pull/917
Co-Author: ed <ed@s5h.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-02-05 11:01:36 +01:00
Karel Zak dc30fd4383 libblkid: check for medium on CDMROMs probing
The commit 39f5af2598 introduces
O_NONBLOCK to avoid the tray close on open(). The side effect is that
open() is successful when there is no medium.

This is usually no problem for standard tools because the next read()
will fail. Unfortunately, libblkid ignores I/O errors for (and only
for) CDROMs to support some crazy hybrid data+audio disks. The final
result is many I/O errors in system log when O_NONBLOCK is enabled.

This patch add CDROM_DRIVE_STATUS to stop probing when there is no
disk or when the tray is open.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1787973
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-07 16:48:34 +01:00
Karel Zak 261cf85627 cal: (man) make -w, -m and --iso relation more obvious
Reported-by: Leah Neukirchen <leah@vuxu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-03 12:04:00 +01:00
Bjarni Ingi Gislason 1c4c602427 man pages: Change a HYPHEN-MINUS (-) to a minus (\-) for options and numbers
Change a HYPHEN-MINUS (code 0x55, 2D) to a minus (\-), if in front of

1) a name of an option

2) a negative number to be printed.

  See man-pages(7) [Debian package "manpages"].

  The output from "nroff" is unchanged.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2019-12-17 12:32:43 +01:00
Bjarni Ingi Gislason eb02489380 man pages: Add a comma after "e.g." and "i.e."
Add a comma (,) after "e.g." and "i.e.", or use English words
(man-pages(7) [package "manpages"]).

  Abbreviation points should be protected (usually with the
non-printing, zero width character '\&') from being interpreted as an
end of sentence, if they are not, and that independent of their current
place on the line.

  This is important when typing, as one does not usually know in
advance when the editor jumps to a new line.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2019-12-17 12:32:43 +01:00
Karel Zak bba1a60198 kill: add another ifdef
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-10 11:07:30 +01:00
Karel Zak 8aab38783a kill: add missing ifdefs
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 16:20:06 +01:00
Karel Zak ded3735ef4 kill: deallocate follow_ups [assan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 13:20:04 +01:00
Karel Zak 1395236acd kill: make man page more informative about --timeout
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 13:11:16 +01:00
Karel Zak 26c2ad6c38 kill: report features on -V, add lish_header initialization
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-09 12:40:53 +01:00
Karel Zak e601521259 Merge branch 'kill-pidfd' of https://github.com/kerolasa/util-linux
* 'kill-pidfd' of https://github.com/kerolasa/util-linux:
  kill: use pidfd system calls to implement --timeout option
  build-sys: add missing NR underscore to UL_CHECK_SYSCALL()
2019-12-09 12:20:22 +01:00
Karel Zak 107e955946 lsblk: add PARTTYPENAME column
Print also partition type in human-readable way.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1777261
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-04 12:38:57 +01:00
Sami Kerola 6e6b9a1d24
kill: use pidfd system calls to implement --timeout option
At times there is need in scripts to send multiple signals to a process.
Often these cases require some amount of waiting before follow-up signal
should be sent.

One common case is process termination, where first script tries to kill
process gracefully but if that does not work SIGKILL is sent.  Functionality
like that is commonly done by periodically checking if signalled pid exist
or not, and if it does another signal is sent possibly to an unrelated
process that reused pid number.  That means polling a pid is prone to a data
race.  Also if the first signal immediately kills the process one polling
interval is lost in sleep.

Another example when multiple signal need to be sent is various daemon
process control situations, such as Upgrading Executable on the Fly (see
reference).  This happens to be the case that inspired change author to make
sequential signaling a little bit easier.

Reference: http://nginx.org/en/docs/control.html#upgrade
Pull-request: https://github.com/karelzak/util-linux/pull/902
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2019-11-25 21:25:50 +00:00
Karel Zak 4631edaee2 lsblk: add FSVER to --fs
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-15 11:23:44 +01:00
Karel Zak 9cca1ef2d5 lsblk: add FSVER (filesystem version) column
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1764523
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-12 13:55:55 +01:00
Michal Suchanek 39f5af2598 libblkid: open device in nonblock mode.
When autoclose is set (kernel default but many distributions reverse the
setting) opening a CD-rom device causes the tray to close.

The function of blkid is to report the current state of the device and
not to change it. Hence it should use O_NONBLOCK when opening the
device to avoid closing a CD-rom tray.

blkid is used liberally in scripts so it can potentially interfere with
the user operating the CD-rom hardware.

[kzak@redhat.com: add O_NONBLOCK also to:
                  - wipefs
                  - blkid_new_probe_from_filename()
                  - blkid_evaluate_tag()]

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-06 09:55:49 +01:00
Karel Zak eea06b92dc lsblk: never fallback to udev/blkid on --sysroot
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-29 13:12:18 +01:00
Vladimir Slavik 2bbc962288 lsblk: update man description of -f / --fs for current columns
see lsblk.c line 1930
2019-10-17 13:51:02 +02:00
Karel Zak 6f74ede50a lsblk: read also GROUP,OWNER and MODE from dumps
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-15 13:08:09 +02:00
Karel Zak 7408a5d9c2 lsblk: on --sysroot read attributes from /dev/<devname> text file
The option --sysroot is used to read information from dumps rather
than from the current system. This patch allows to read also udev
attributes from text file in location /sysroot/dev/<devname>. The file
is text file in format NAME=value\n.

Suggested-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-15 12:36:16 +02:00
Elliott Mitchell 2bb3aa36b2 cleanup: Remove some spurious spaces
Sorry detail-oriented people tend to wipe these out if they notice them.
Add in automated tools and lots of excess end-of-line spaces get wiped
out.

Addresses: https://github.com/karelzak/util-linux/pull/849
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-01 13:01:43 +02:00