Commit Graph

2867 Commits

Author SHA1 Message Date
Karel Zak f2d08d4ddc lscpu: read MHZ from /sys/.../cpufreq/scaling_cur_freq
This is more portable and provides more stable results than
/proc/cpuinfo.

Fixes: https://github.com/karelzak/util-linux/pull/1317
Co-Author: Thomas Weißschuh
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-25 13:30:13 +02:00
Karel Zak 0b538002da lscpu: use locale-independent strtod() when read from kernel
Reported-by: Thomas Weißschuh
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-25 11:32:51 +02:00
Karel Zak ff6513c74e lscpu: use MHZ as number to be locale sensitive
Fixes: https://github.com/karelzak/util-linux/issues/1316
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-24 13:39:53 +02:00
Karel Zak 9b9e4f5d06 lscpu: add SCALMHZ% and "CPU scaling MHz:"
$ lscpu
...
  Model name:           Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
    CPU family:         6
    Model:              60
    Thread(s) per core: 2
    Core(s) per socket: 4
    Socket(s):          1
    Stepping:           3
    CPU(s) scaling MHz: 61%
    CPU max MHz:        4400.0000
    CPU min MHz:        800.0000
...

$ lscpu -e=CPU,MAXMHZ,MINMHZ,MHZ,SCALMHZ%
CPU    MAXMHZ   MINMHZ      MHZ SCALMHZ%
  0 4400.0000 800.0000 2800.000      64%
  1 4400.0000 800.0000 4000.146      91%
  2 4400.0000 800.0000 2800.000      64%
  3 4400.0000 800.0000 2800.000      64%
  4 4400.0000 800.0000 2800.000      64%
  5 4400.0000 800.0000 4400.000     100%
  6 4400.0000 800.0000  800.000      18%
  7 4400.0000 800.0000 2800.000      64%

Addresses: https://github.com/karelzak/util-linux/issues/1314
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-24 13:39:53 +02:00
Karel Zak 0f344e2432 lsns: fix old error message
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-24 13:39:53 +02:00
Karel Zak be1a10bb1f lsns: fix copy & past in man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-24 13:39:53 +02:00
Masatake YAMATO f91ffe44dd lsns: fill UID and USER columns for interpolated namespaces
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-05-24 13:39:53 +02:00
Masatake YAMATO 09710a2212 fixup! lsns: interpolate missing namespaces for converting forests to a tree 2021-05-24 13:39:53 +02:00
Masatake YAMATO de72df79d7 lsns: interpolate missing namespaces for converting forests to a tree
The tree of *parent* and *owner* could be forests because *lsns*
cannot track a namespace having no process.

This change tries interpolating the missing namespaces by calling
ioctl(NS_GET_PARENT) and ioctl(NS_GET_USERNS) recursively.

The original output for -Tparent:

    # ./lsns -Tparent
    NS             TYPE   NPROCS   PID USER   COMMAND
    4026531837     user      404     1 root   /usr/lib/systemd/sy
    ├─4026532508   user        1 29376 yamato /usr/lib64/firefox/
    ...
    └─4026533513   user        1 24245 yamato /usr/lib64/firefox/
    ...
    4026533733     user        1 30839 yamato /opt/google/chrome-
    4026533734     user       15 10076 yamato /opt/google/chrome-

user namespaces 4026533733 and 4026533734 are orphans.
lsns could not find their parents.

With this change:

    # ./lsns-with-changes -Tparent
    NS               TYPE   NPROCS   PID USER   COMMAND
    4026531837       user      404     1 root   /usr/lib/systemd/
    ├─4026532508     user        1 29376 yamato /usr/lib64/firefo
    ...
    ├─4026532639     user        0
    │ ├─4026532637   user        0
    │ │ └─4026533733 user        1 30839 yamato /opt/google/chrom
    │ └─4026533734   user       14 10076 yamato /opt/google/chrom

Now user namespaces 4026533733 and 4026533734 are integrated to the
tree. lsns interpolates the missing namespace 4026532639 and
4026532637 for the integration.

The original output for -Towner:

    # ./lsns -Towner
    NS             TYPE   NPROCS   PID USER   COMMAND
    4026531837     user      405     1 root   /usr/lib/systemd/s
    ├─4026531835   cgroup    431     1 root   /usr/lib/systemd/s
    ...
    4026532638     pid         1 30839 yamato /opt/google/chrome
    4026532640     pid         2 30837 yamato /opt/google/chrome
    ...

pid namespaces 4026532638 and 4026532640 are orphans.
lsns could not find their owners.

With this change:

    # ./lsns-with-changes -Towner
    NS               TYPE   NPROCS   PID USER   COMMAND
    4026531837       user      403     1 root   /usr/lib/systemd
    ├─4026531835     cgroup    429     1 root   /usr/lib/systemd
    ...
    ├─4026532639     user        0
    ...
    │ ├─4026532637   user        0
    │ │ ├─4026532638 pid         1 30839 yamato /opt/google/chro
    │ │ ├─4026533638 net         1 30839 yamato /opt/google/chro
    │ │ └─4026533733 user        1 30839 yamato /opt/google/chro
    │ ├─4026532640   pid         2 30837 yamato /opt/google/chro

Now pid namespaces 4026532638 and 4026532640 are integrated to the
tree. lsns interpolates the missing namespace 4026532639 and
4026532637 for the integration.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-05-24 13:39:53 +02:00
Masatake YAMATO c67b83c10d lsns: reorganize members specifying other namespaces in lsns_namespace
This is a preparation change for planed "tree interpolation" patch.

parentid, ownerid, parentns, and ownerns were members of
lsns_namespace struct. When interpolating missing namespaces
for building a unified name space tree, duplicated functions
are needed; one is for parentid and parentns members, and
another is for ownerid and ownerns members. To avoid the
duplication, this change unifies the members as following:

 parentid and ownerid => related_id [2]
 parentns and ownerns => related_ns [2]

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-05-24 13:39:53 +02:00
Masatake YAMATO e749d51a9c lsns: make namespace having no process printable
This is a preparation change for planed "tree interpolation" patch.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-05-24 13:39:53 +02:00
Karel Zak 3387ad72a6 lsns: make --tree default, update man-page
* make --tree=process default for 'lsns' and 'lsns <ns>'
* remove 'list' from struct lsns
* update man page

Addresses: https://github.com/karelzak/util-linux/pull/1281
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-24 13:39:53 +02:00
Masatake YAMATO 179dd17a6a lsns: fix passing wrong process lists when showing ownerns and parentns
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-05-24 13:39:53 +02:00
Masatake YAMATO 8d27b60530 lsns: unify the code and option for printing process based tree and namespace based trees
Suggested by Karel Zak.

`--tree` option is introduced as replacement for `--nstree`.
In addition to `parent` and `owner`, `--tree` take `process` as the
option argument.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-05-24 13:39:53 +02:00
Masatake YAMATO e8c56ae2d7 lsns: print namespace tree based on the relationship (parent/child or owner/owned)
Introduce new option -T[parent|owner]|--nstree[=parent|=owner].

With this change, lsns prints parent/child relationship tree if
"-T parent" is given and owner/owned relationship tree if "-T owner is given.

Passing only "-T" is same as passing "-Towner."

Example sessions:

    # ./lsns -Tparent -ons,type,pns| head -20
    NS             TYPE          PNS
    4026531837     user            0
    ├─4026532508   user   4026531837
    ├─4026532609   user   4026531837
    ├─4026532610   user   4026531837
    ├─4026532629   user   4026531837
    ├─4026532705   user   4026531837
    ├─4026532901   user   4026531837
    ├─4026533090   user   4026531837
    ├─4026533185   user   4026531837
    ├─4026533280   user   4026531837
    └─4026533468   user   4026531837
    4026531835     cgroup          0
    4026531836     pid             0
    └─4026533038   pid    4026531836
      ├─4026532934 pid    4026533038
      ├─4026533715 pid    4026533038
      ├─4026533716 pid    4026533038
      ...

    # ./lsns -Towner -ons,type,ons| head -20
    NS             TYPE          ONS
    4026531837     user            0
    ├─4026531835   cgroup 4026531837
    ├─4026531836   pid    4026531837
    ├─4026531838   uts    4026531837
    ├─4026531839   ipc    4026531837
    ├─4026531840   mnt    4026531837
    ├─4026531861   mnt    4026531837
    ├─4026532001   net    4026531837
    ├─4026532219   mnt    4026531837
    ├─4026532357   mnt    4026531837
    ├─4026532383   net    4026531837
    ├─4026532475   mnt    4026531837
    ├─4026532476   mnt    4026531837
    ├─4026532504   mnt    4026531837
    ├─4026532508   user   4026531837
    │ ├─4026532509 ipc    4026532508
    │ └─4026532511 net    4026532508
    ├─4026532573   mnt    4026531837
    ├─4026532574   mnt    4026531837

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-05-24 13:39:52 +02:00
Karel Zak aa049eabb3 lscpu: add MHZ to the -e output
Addresses: https://github.com/karelzak/util-linux/issues/1314
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-23 23:52:00 +02:00
Zbigniew Jędrzejewski-Szmek cacd3e7685 fstrim: do not start the timer in initrd
I'm working on building initramfs images directly from normal
packages, which means that the pristine system rpms should behave
correctly as much as possible also in the initrd. There usually isn't
enough time for the timer to actually fire, but starting it gives a
line on the console and generally looks confusing and sloppy. So let's
skip the timer if it ever ends up being enabled in the initrd.

Checking for /etc/initrd-release is the standard condition that
systemd's initrd units use.
2021-05-21 10:45:35 +02:00
Karel Zak 3e8403522c fstrim: fix paths comparison
Fix: https://github.com/karelzak/util-linux/issues/1312
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-20 09:29:34 +02:00
Karel Zak e304441936 blkdiscard: do not probe for signatures on --force
The command-line option --force is defined as "disable all checks",
but the current code does not follow this idea. We need a way how to
disable read from the device (for example for dm-integrity devices).

Fixes: https://github.com/karelzak/util-linux/issues/1308
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-13 10:34:14 +02:00
Christian Hesse e08e3d587c fix whitespace issue in ducumentation
This removes trailing whitespaces and fixes minor issues.
2021-05-10 15:53:50 +02:00
Karel Zak 58739eb0a7 build-sys: fix libblkid dependence
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-10 11:24:24 +02:00
Karel Zak b6464f8dc5 blkdiscard: fix compilation without libblkid
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-07 20:38:26 +02:00
Johan Herland 9b657529cc
unshare: Fix error message when setting proc mount propagation
The mount() command associated with this error message is not about
unmounting the proc fs, but rather about changing the propagation
of mount events for the proc fs. Rewrite the error message to
reflect this.
2021-05-07 00:53:29 +02:00
Karel Zak 185bc3a832 rfkill: make RFKILL_EVENT_SIZE_V1 use more portable
The old linux/rfkill.h uses "int", new versions use sizeof() for the
macro ...

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-06 17:10:46 +02:00
Karel Zak 787af7ce7c rfkill: fix compiler warning [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-06 16:44:20 +02:00
Karel Zak f798aed128 rfkill: fix compiler warning [-Wformat=]
* `RFKILL_EVENT_SIZE_V1` is defined as sizeof(struct rfkill_event), so let's use %zu

* cast `len` to size_t to make it usable with %zu

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-06 12:25:10 +02:00
Karel Zak f6c1168925 hwclock: follow timespec and use long int for nsec
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-06 11:56:14 +02:00
Karel Zak 01b37affc1 rtcwake: fix time_t=long assumptions
References: ce3355cc54
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-06 11:07:22 +02:00
Karel Zak 4fb27d5c62 flock: fix time_t=long assumptions
This also fixes flock for archs (e.g. sparc64) where suseconds_t is not long.

Fixes: https://github.com/karelzak/util-linux/issues/1069
References: ce3355cc54
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-06 10:13:27 +02:00
Karel Zak d8d54e4bfc build-sys: keep adoc files in dist_noinst_DATA
* rename MANPAGES_EXTRA= to ADOCFILES_COMMON=

* keep track about individual adoc files by dist_noinst_DATA=
  This variable is not effected by automake conditions, so the files
  are always distributed.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-05 13:35:30 +02:00
Karel Zak 5c09ab260e lscpu: assume L1d, L1i, L2, L3 for sparc
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-03 20:28:30 +02:00
Karel Zak 57fee04c14 lscpu: read Sparc caches files
Fixes: https://github.com/karelzak/util-linux/issues/1296
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-03 16:29:55 +02:00
Karel Zak 4e56c68abe Merge branch 'master' of https://github.com/arbego/util-linux
* 'master' of https://github.com/arbego/util-linux:
  Fixed wrongful time_t=long assumptions in hwclock.c and timeutils.c
  Changed int64_t casts to long long int casts
  Fixed format strings and type casts in hwclock to work with 64-bit time_t on 32-bit linux
2021-04-30 13:12:26 +02:00
Armin Begovic ce3355cc54 Fixed wrongful time_t=long assumptions in hwclock.c and timeutils.c 2021-04-29 11:56:37 +00:00
Karel Zak 071d3135d3 lscpu: fix "caches" header
It's possible that lscpu does not print any caches if full caches size
is zero. In this case we do not need the header.

Addresses: https://github.com/karelzak/util-linux/issues/1207
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-28 10:51:07 +02:00
Armin Begovic 56702ef2ea Changed int64_t casts to long long int casts 2021-04-23 23:28:37 +02:00
Armin Begovic a937ef8318 Fixed format strings and type casts in hwclock to work with 64-bit time_t on 32-bit linux 2021-04-23 22:48:13 +02:00
Karel Zak b9081962ef zramctl: (man) fix streams default number
References: https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html#set-max-number-of-compression-streams
References: da9556a236
Fixes: https://github.com/karelzak/util-linux/issues/1283
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-23 13:01:57 +02:00
Rafael Fontenelle 993556aaa5 Fix misspellings 2021-04-22 20:31:05 -03:00
Karel Zak 2b84ac2dbd Merge branch 'topic/po4a' of https://github.com/mariobl/util-linux
* 'topic/po4a' of https://github.com/mariobl/util-linux:
  mount.a.adoc: Fix markup
  Asciidoc: Add missing macro definition in uclampset.1
  Asciidoc: Fix markup in example man page
  Asciidoc: Fix markup
  Asciidoc: Remove artifact from merge conflict
  Asciidoc: Convert man-common/README to Markdown
  po-man: Fix the example man page
  po-man: Fix typos in po-man/README.md
  po-man: Update the example man page
  po-man: Add po-man/README.md
  po-man: Add (incomplete) de.po for testing purposes
  po-man: Add (incomplete) de.po for testing purposes
  po-man: Adjust paths in po4a.cfg and update .pot file
  po-man: Move Po4a config file and translation template to po-man
2021-04-22 15:23:27 +02:00
Karel Zak e5bde19ae2 build-sys: cleanup Makefiles
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-20 14:39:32 +02:00
Karel Zak 20ac96ffe2 Merge branch 'fix-swapon-summary-heading-alignment' of https://github.com/sebras/util-linux
* 'fix-swapon-summary-heading-alignment' of https://github.com/sebras/util-linux:
  swapon: Keep headings and fields aligned in summary output.
2021-04-19 10:05:05 +02:00
Karel Zak 7c35325c49 Merge branch 'fix-typo' of https://github.com/sebras/util-linux
* 'fix-typo' of https://github.com/sebras/util-linux:
  Fix typo in help message.
2021-04-19 10:00:42 +02:00
Mario Blättermann b4c04b3dab mount.a.adoc: Fix markup 2021-04-18 12:16:37 +02:00
Sebastian Rasmussen 5fba3d7b4e swapon: Keep headings and fields aligned in summary output.
Because the headings are aligned with tabs the fields must
always be a multiple of 8 characters. Moreover if the field
values are shorter than 8 characters, extra tabs must be
inserted before the succeding field to keep alignment.

swapon parses /proc/swaps, generated by the Linux kernel in
mm/swapfile.c. Its function swap_show() and its recent fix in
commit 6f7939405f61de7d0da7f6c90182e96c4f5ff6c1 were used as
inspiration for this commit.

Additionally inform the translators about the requirements of
formatting and relationship between the heading and entry strings.
2021-04-18 03:48:57 +02:00
Sebastian Rasmussen 9b825bde80 Fix typo in help message. 2021-04-17 14:40:13 +02:00
Masatake YAMATO 64e8df5d47 man: add ioctl_ns(2) to SEE ALSO of lsns(2)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-04-17 00:23:22 +09:00
Karel Zak 91f6895fff prlimit: make code more robust
The prlimit description are always defined as static strings, but it
seems better to make the code more readable and robust for static
analyzers and readers.

Fix also missing gettext() call for description help.

Fixes: https://github.com/karelzak/util-linux/issues/1277
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-14 16:19:01 +02:00
Masatake YAMATO d652d4c666 lsns: add columns for parent namespaces and owner namespaces
See ioctl_ns(2) about parent and owner namespaces.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-04-13 06:22:51 +09:00
Karel Zak 236421a491 build-sys: make man pages optional, add --disable-asciidoc
* don't use dist_noinst_DATA= for generated man pages (use man_MANS=)

* make asciidoctor optional

* add --disable-asciidoc to explicitly disable man pages

Addresses: https://github.com/karelzak/util-linux/issues/1257
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-06 17:22:36 +02:00
Karel Zak 53b37016c3 meson: generate man pages from asciidoc
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-06 15:32:46 +02:00
Mario Blättermann 360946bb93 Asciidoc: Fix markup 2021-04-04 15:33:56 +02:00
Karel Zak 9dadd3e60c lscpu: report also number of cache instances
Caches (sum of all):
  L1d:                   128 KiB (4 instances)
  L1i:                   128 KiB (4 instances)
  L2:                    1 MiB (4 instances)
  L3:                    8 MiB (1 instance)

Suggested-by: John Henning <john.henning@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-01 12:27:05 +02:00
Karel Zak 625e9c61e8 build-sys: make man pages location independent
We need to evaluate "include::" directive relatively to project
top-level source directory rather than to the current document
location.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-31 11:50:47 +02:00
Karel Zak 25ce8fb1ed Merge remote-tracking branch 'mariobl/topic/asciidoc'
* mariobl/topic/asciidoc: (71 commits)
  Asciidoc: Update .pot template
  Asciidoc: Reorder example command sequence
  Asciidoc: Update .pot template
  Asciidoc: Better gettext message splitting in nsenter.1.adoc
  Asciidoc: Update .pot template
  Asciidoc: Fix typo and remove invisible spaces which confuse po4a
  Asciidoc: Update .pot template
  Asciidoc: Fix typo
  Asciidoc: Fix artifact from initial import, sixth attempt
  Asciidoc: Update .pot template
  Asciidoc: Fix artifacts from initial import, fifth attempt
  Asciidoc: Fix artifacts from initial import, fourth attempt
  Asciidoc: Update .pot template
  Asciidoc: Fix artifacts from initial import, third attempt
  Asciidoc: Fix artifacts from initial import, second attempt
  Asciidoc: Fix artifacts from initial import
  Asciidoc: Add po4a config file and initial translation template for man pages
  Asciidoc: Small indentation fix in mount.8.adoc
  Asciidoc: Review sys-utils man pages, part 2
  build-sys: fix out-of-tree build
  ...

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-29 15:09:27 +02:00
Mario Blättermann c8dae3d8fa Asciidoc: Reorder example command sequence 2021-03-28 14:29:45 +02:00
Mario Blättermann 86cc47aa51 Asciidoc: Better gettext message splitting in nsenter.1.adoc 2021-03-28 11:58:08 +02:00
Mario Blättermann 544e64e09e Asciidoc: Fix typo and remove invisible spaces which confuse po4a 2021-03-28 10:47:00 +02:00
Mario Blättermann f933e53c31 Asciidoc: Fix artifacts from initial import, fifth attempt 2021-03-26 21:41:03 +01:00
Mario Blättermann f67dbc88ca Asciidoc: Fix artifacts from initial import, fourth attempt 2021-03-26 21:11:25 +01:00
Mario Blättermann 9b7051d5bf Asciidoc: Fix artifacts from initial import, third attempt 2021-03-26 20:54:06 +01:00
Mario Blättermann 109525d66a Asciidoc: Fix artifacts from initial import, second attempt 2021-03-26 20:17:45 +01:00
Mario Blättermann b53360d8a8 Asciidoc: Fix artifacts from initial import 2021-03-26 20:12:42 +01:00
Mario Blättermann 9637ed960a Asciidoc: Small indentation fix in mount.8.adoc 2021-03-26 17:29:16 +01:00
Mario Blättermann 4eab78d379 Asciidoc: Review sys-utils man pages, part 2 2021-03-26 17:19:27 +01:00
Mario Blättermann fc86ec98de
Merge pull request #1 from karelzak/asciidoc-for-mario
Asciidoc for mario
2021-03-26 14:35:55 +01:00
Mario Blättermann 69dc8997dc Asciidoc: Incorporate latest changes in rfkill.8 and umount.8 2021-03-26 13:35:42 +01:00
Mario Blättermann b49072cf79 Asciidoc: Remove old man page links 2021-03-26 13:26:16 +01:00
Karel Zak 4f79d3032e build-sys: split man pages and man page links
The symlinks are generated by asciidoctor and current dist_man_MANS
depends on order (nan page before man link). This solutions is useless
when execute "make -j". The real solution is to keep man pages in
separate variable and use only this variable evaluate what we need to
generate.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-26 11:49:59 +01:00
Karel Zak c2096885af build-sys: remove man page link files
It seems asciidoctor generates all necessary files.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-26 11:26:08 +01:00
Mario Blättermann 68860732a7 Asciidoc: Review sys-utils man pages,part 1 2021-03-25 20:27:34 +01:00
Karel Zak 4397707e7a lsmem: use ul_path_readf_string() readable for analysers [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 12:23:21 +01:00
Karel Zak 01a895d840 lsirq: fix resources leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 12:14:46 +01:00
Karel Zak e37babc0ec lsirq: fix resources leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 12:13:00 +01:00
Karel Zak 645577c755 meson: add irq utils
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 12:12:11 +01:00
Karel Zak a887d587bf fstrim: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 11:53:02 +01:00
Karel Zak 20fae1bde2 rfkill: add "toggle" command
Addresses: https://github.com/karelzak/util-linux/issues/1269
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-23 15:20:44 +01:00
Karel Zak e2f6c9eaa2 umount: support over-mounts for --recursive
For example for hierarchy:

  $ findmnt -oTARGET,ID,PARENT
  TARGET                      ID PARENT
  /mnt/A                     802     62
  └─/mnt/A/B                 937    802
    ├─/mnt/A/B/C             964    937
    │ └─/mnt/A/B/C           991    964
    └─/mnt/A/B              1018    937
      └─/mnt/A/B            1045   1018

we need umount in order (id): 1045, 1018, 991, 964, 937, 802. The current
code first tries 991 in 937 branch.

Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-22 11:29:28 +01:00
Mario Blättermann f42ed8190c Asciidoc: Unify spelling of »User Commands« 2021-03-21 10:00:16 +01:00
Mario Blättermann 295b3979d9 Asciidoc: Add Po4a hint to file headers 2021-03-20 16:42:47 +01:00
Mario Blättermann b4e57a8a90 Asciidoc: Small fix in nsenter.1.adoc 2021-03-20 15:23:32 +01:00
Mario Blättermann 5723eae791 Asciidoc: Some more man page formatting improvements
Besides some formatting tweaks, I've changed »lsblk(1)« into »lsblk(8)«
in the SEE ALSO section of mount.8.adoc. At least Archlinux and Debian
ship lsblk as a system administration command.
2021-03-20 09:45:23 +01:00
Mario Blättermann d315cc4d96 Asciidoc: Re-add empty lines to man pages 2021-03-19 20:52:00 +01:00
Mario Blättermann 4d29743519 Asciidoc: Some formatting cleanup in man pages 2021-03-19 18:25:50 +01:00
Karel Zak 1ad8db5521 prlimit: fix optional arguments parsing
$ prlimit -f=100:100
 failed to parse FSIZE limit

Fixes: https://github.com/karelzak/util-linux/issues/1265
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-18 10:23:36 +01:00
Karel Zak 308a097968 meson: update sources and dependencies
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-17 15:07:27 +01:00
Zbigniew Jędrzejewski-Szmek d4c880d5a4 meson: add second build system
To build: meson build && ninja -C build
To run tests: ninja -C build check
To install for packaging: DESTDIR=/var/tmp/inst ninja -C build install
To install for realz: sudo ninja -C build install

v2:
- Optional items are now based on the 'feature' feature in meson.
  Built libraries which are disabled turn into disabler() objects
  and also poison any executables which link to them.

What is there:
- building of the binaries and libs and the python module
- installation of binaries, libs, python module, localization files,
  man pages, pkgconfig files
- running of tests
- most options to configure build equivalently to the
  ./configure settings

Partially implemented:
- disabling of stuff when things missing. In the C code, the defines
  are all used, so that should be fine. In the build system, some
  files should be skipped, but that is probably not always done properly.
  Getting this right might require some testing of various build option
  combinations to get the details right.

Not implemented:
- static builds of fdisk and other binaries
- things marked with XXX or FIXME
- ???

Differences:
- .la files are not created. They are useless and everybody hates them.
- Requires.private in pkgconfig files are not present in the
  autogenerated .pc file. Not sure if they should be there or not. If
  necessary, they can be added by hand.
- man pages and systemd units are installed by the install target. Not
  sure why 'make install' doesn't do that.
- the split between / and /usr is probably wrong. But it's all pointless
  anyway, so maybe we could simplify things but not implementing it at
  all under meson?
2021-03-17 15:07:27 +01:00
Mario Blättermann ef63c72a33 Asciidoc: Fix man pages with variables to use the same value as in previous *.in files 2021-03-16 19:41:23 +01:00
Mario Blättermann b366e6fc6b Asciidoc: Remove already imported *roff man pages 2021-03-16 19:35:37 +01:00
Mario Blättermann 34455501de Asciidoc: Adapt Makefiles to new asciidoc man pages 2021-03-16 19:34:59 +01:00
Łukasz Stelmach c8650db343 hwclock: fix indentation
Fixes: 042f62dfc ("[clang-tidy] do not use else after return")
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2021-03-16 14:23:48 +01:00
Mario Blättermann 84851dc21f Asciidoc: Import hwclock.8.in 2021-03-14 08:58:13 +01:00
Mario Blättermann fd8c150483 Asciidoc: Import rtcwake.8.in 2021-03-13 22:55:02 +01:00
Mario Blättermann b9d2ddfbb1 Asciidoc: Import sys-utils man pages, part 3 2021-03-13 22:33:34 +01:00
Mario Blättermann a09649ca89 Asciidoc: Use correct ':man manual:' for man pages from section 8 2021-03-13 12:49:26 +01:00
Mario Blättermann 1417968285 Asciidoc: Import sys-utils man pages, part 2 2021-03-13 12:22:34 +01:00
Mario Blättermann 6d5b69483a Asciidoc: Import sys-utils man pages, part 1 2021-03-12 21:10:37 +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 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