Commit Graph

15300 Commits

Author SHA1 Message Date
Mario Blättermann aad107b6d7 Asciidoc: Import textutils man pages 2021-03-12 14:16:26 +01:00
Mario Blättermann 1b73028b89 libblikid.3.adoc: Add missing SYNOPSIS section 2021-03-12 13:34:59 +01:00
Karel Zak b09ed927d7 tests: update mountpoint return code chack
This is necessary due to e0ecd19641.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-12 11:39:23 +01:00
Karel Zak 4e9be5a439 findmnt: (man) add more info about --target
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-12 11:00:56 +01:00
Mario Blättermann da67bcf938 Remove no longer valid part of man/common/README 2021-03-11 18:48:13 +01:00
Mario Blättermann e2db4d9410 Add asciidoc man pages and some include files 2021-03-11 18:38:46 +01:00
Karel Zak 70a7b61a84 tests: update mountpoint tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-11 10:52:11 +01:00
Karel Zak e0ecd19641 mountpoint: different exit status for errors and non-mountpoint situation
Fixes: https://github.com/karelzak/util-linux/issues/1260
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-11 10:48:36 +01:00
Karel Zak 6b6dbcbae6 docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-10 16:15:30 +01:00
Karel Zak c173ba11ec libsmartcols: add comments to private header file
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-10 11:30:53 +01:00
Karel Zak 2b1322f478 docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-10 10:21:57 +01:00
Karel Zak b4f6006209 lscpu: use size_t for ncolumns
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-09 15:55:33 +01:00
Karel Zak 1242c3fde7 lscpu: support +list for -e, -p and -C
For example "lscpu -e=+MHZ" to list the default columns and MHZ. We
use the same in other tools.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-09 10:37:36 +01:00
Karel Zak 0b83e26373 lscpu: add info that caches sizes are sum
Addresses: https://github.com/karelzak/util-linux/issues/1258
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-08 11:25:15 +01:00
Karel Zak 347332796f fdisk: (man) add info about order for -l
Reported-by: Dan Jacobson <jidanni@jidanni.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-08 10:56:47 +01:00
Karel Zak 81329c8d1c hwclock: use pointer to adjtime data
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-04 11:27:47 +01:00
Andrew Shapiro f3a7b057ac utmpdup: Ensure flushing when using follow flag
The following usages of utmpdump result in no output being flushed to the specified file because the default output buffering is fully buffered:

$ utmpdump --follow --output myOutputFile /var/log/utmp
$ utmpdump --follow /var/log/utmp > myOutputFile

This change configures line buffering for these scenarios so that output will be flushed after each log event.

Signed-off-by: Andrew Shapiro <anshapiro@gmail.com>
2021-03-02 10:49:53 +01:00
Karel Zak 50cc633257 dmesg: fix and cleanup --read-clear
The function read_buffer() implements read and clear functionally, but
we do not differentiate between these actions in main() for error
messages, and one generic "dmesg: read kernel buffer failed" is used
in all cases. That's a bug.

This patch removes the "clear" action from read_buffer() and keeps it
for buffer reading only.  The "clear" action is implemented in main()
by separate klogctl(SYSLOG_ACTION_CLEAR) for cases. It means also for
"dmesg --read-clear"; we do not use SYSLOG_ACTION_READ_CLEAR anymore.

Now "clear+read" is:

 * syslog: SYSLOG_ACTION_READ_ALL + SYSLOG_ACTION_CLEAR
 * kmsg:   /dev/kmsg read()       + SYSLOG_ACTION_CLEAR

In old versions "dmesg --syslog --read-clear" (syalog backed) was
implemented by      logctl(SYSLOG_ACTION_READ_CLEAR) and it returns no
data for non-root  users (due to EPERM), "dmesg --read-clear" (kmsg)
returns data and EPERM for the "clear" action.

Now the command "dmesg --syslog --read-clear" and "dmesg --read-clear"
behaves in the same way -- returns data and EPERM for the "clear"
action.

Fixes: https://github.com/karelzak/util-linux/issues/1255
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-01 16:50:20 +01:00
Karel Zak 66134b5c2b lsblk: update man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-01 14:51:28 +01:00
Karel Zak 7de3b2ce59 Merge branch 'master' of https://github.com/adigitoleo/util-linux 2021-03-01 14:46:50 +01:00
Leon 679686b27c
Update lsblk.8 2021-03-01 22:47:27 +11:00
Karel Zak 55d2dfa12c irqtop: check scols_line_set_data() return code
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-25 14:37:17 +01:00
Karel Zak 61074478fa irqtop: small cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-25 09:57:49 +01:00
Štěpán Němec 3d0620a9a8 su: fix man page typos
Signed-off-by: Štěpán Němec <snemec@redhat.com>
2021-02-25 09:34:30 +01:00
Karel Zak a23aecc1bf irqtop: add per-cpu stats
irqtop | total: 1245107402 delta: 7394 | ws.net.home | 2021-02-24 20:11:09+01:00

        cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 cpu6 cpu7
  %irq: 12.9 13.0 12.8 11.9 12.4 13.4 11.6 12.0
%delta: 13.7  9.7 22.6  7.9  9.5 17.5  8.3 10.8

       IRQ      TOTAL      DELTA NAME
       LOC  989162414       6111 Local timer interrupts
       TLB  100492740         67 TLB shootdowns
       CAL   95058001        321 Function call interrupts
        42   23893801        241 IR-PCI-MSI 1048576-edge nvidia
        30   20209392        494 IR-PCI-MSI 327680-edge xhci_hcd
       RES   12996335         86 Rescheduling interrupts
        29    1354219          4 IR-PCI-MSI 512000-edge ahci[0000:00:1f.2]
        41     682653         31 IR-PCI-MSI 409600-edge eno1
   ...

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-24 20:11:05 +01:00
Karel Zak 1b889dcc07 irqtop: print header in reverse mode
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-24 14:29:20 +01:00
Karel Zak 244fc4d57d docs: update TODO (scols borders)
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1931776
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-24 13:06:40 +01:00
Karel Zak 17d5b26436 su: (pty) change owner and mode for pty
The current situation:

 # su --pty - kzak
 $ ll $(tty)
 crw--w---- 1 root tty 136, 9 Feb 23 11:53 /dev/pts/9
 $ mesg
 mesg: cannot open /dev/pts/9: Permission denied

the pseudo-terminal is still owned by the original user.

New version:

 # su --pty - kzak
 # ll $(tty)
 crw--w---- 1 kzak tty 136, 9 Feb 23 11:56 /dev/pts/9
 # mesg
 is y

The patch follows login(1) to change the pty owner and group. It
follows "TTYPERM" and "TTYGROUP" from login.defs (or econf lib).

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-23 11:52:45 +01:00
Karel Zak 726ffb4a26 login: move generic setting to ttyutils.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-23 11:46:10 +01:00
Karel Zak 497c61f7b0 su: explicitly enable echo for --pty
Since 75ccd75a2f we need to explicitly
set echo flag by ul_pty_slave_echo(pty, 1).

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-23 11:37:15 +01:00
Karel Zak 8d720dbed6 fdisk: support partition type name in dialogs
Command (m for help): t

Selected partition 1
Partition type or alias (type L to list all): linux root x86
Changed type of partition 'Linux /usr (x86)' to 'Linux root (x86)'.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-23 09:25:57 +01:00
Karel Zak 45c2daa612 sfdisk: support for type="partition type name"
For example:

 # echo 'size=10MiB, type="linux usr x86"' | sfdisk /dev/sdc
 ...
 New situation:

 Device     Start   End Sectors Size Type
 /dev/sdc1   2048 22527   20480  10M Linux /usr (x86)

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-23 09:25:36 +01:00
Karel Zak 5353ba3f0d libfdisk: support partition type name parsing
Add to fdisk_label_advparse_parttype() support for
FDISK_PARTTYPE_PARSE_NAME to parse partition type name.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-23 09:19:51 +01:00
Karel Zak 27e6b3a92e lib/strutils: add ul_stralnumcmp()
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-23 09:19:48 +01:00
Karel Zak 3d28996517 build-sys: set localstatedir and sysconfdir default
Let's follow our policy for default directories and explicitly default
to localstatedir=/var and sysconfdir=/etc when the default $prefix is
used.

Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-19 12:04:39 +01:00
Karel Zak 4f62b0b1dd readprofile: fix static analyzer warning [coverity scan]
Make sure we do not use step=0 and zero "fn_add - add0" as divisor.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-18 11:24:12 +01:00
Karel Zak 061e26d06d rfkill: fix static analyzer warning [coverity scan]
>>>     CID 365738:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "ret". Field "ret" is uninitialized.
326             return ret;

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-18 11:09:31 +01:00
Karel Zak 36c67e033e hardlink: fix typo in man page
Addresses: 3292501316 (commitcomment-47222034)
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-18 10:48:47 +01:00
Karel Zak 296b58a79e libmount: (python) fix compiler warning
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 12:25:49 +01:00
Karel Zak 71ba2792ab lib: use procutils.c on Linux only
Fixes: https://github.com/karelzak/util-linux/issues/1251
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 12:24:13 +01:00
Karel Zak 5c7cac85c9 hardlink: fix indention
The original Julian's hardlink.c code is pretty readable, but for
util-linux we use a little different indention (aka Linux kernel
coding style).

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00
Karel Zak 4bf9ebca2b tests: update hardlink tests
The important is result, not summary or verbose output.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00
Karel Zak 4c467ebc5c hardlink: add --quiet option
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00
Karel Zak 3292501316 hardlink: cleanup man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00
Karel Zak 5034cd9f2b hardlink: s/DEBUG/VERBOSE/
We usually use "debug" for very detailed information. For end-user
information is better to talk about "verbose" output.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00
Karel Zak 82e32c0659 hardlink: translate verbose messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00
Karel Zak 053ef448a6 hardlink: cleanup summary
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00
Karel Zak 423e80c1e9 hardlink: use size_to_human_string()
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00
Karel Zak 3c52b1c83c hardlink: use only err.h to print errors and warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00
Karel Zak 06d8fe8909 hardlink: use monotonic time like other utils
- use out gettime_monotonic()
- use timeval for calculation rather than double

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00