Commit Graph

15567 Commits

Author SHA1 Message Date
Karel Zak 868cd0dc0a fsck: use mnt_fs_is_regularfs()
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-02 12:16:14 +02:00
Karel Zak ac8697d606 libmount: add mnt_fs_is_regularfs() to public API
Fix: https://github.com/karelzak/util-linux/issues/1328
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-02 12:14:10 +02:00
Karel Zak 14ae6d5ae0 build-sys: fix {release-version} man pages
* define {release-version} as $VERSION

* do not use {docdir} in adoc; it's built-in ascidoctor variable
  https://docs.asciidoctor.org/asciidoc/latest/attributes/document-attributes-reference/#intrinsic-attributes

Addresses: https://github.com/karelzak/util-linux/issues/1327
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-02 11:55:44 +02:00
Karel Zak ab2eea4ac3 build-sys: install hardlink bash-completion
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-02 11:14:36 +02:00
Karel Zak d79a69c564 tools: allow to update specific files on kernel.org
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-01 11:45:16 +02:00
Karel Zak a057fdb13a docs: fix typo in v2.37-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-01 10:37:01 +02:00
Karel Zak 635d382146 docs: add uclampset to AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-01 10:32:35 +02:00
Karel Zak 50736e4998 build-sys: release++ (v2.37)
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-01 09:52:10 +02:00
Karel Zak 8a988dd855 docs: update v2.37-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-01 09:46:40 +02:00
Karel Zak 17559f6cc2 docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-01 09:45:03 +02:00
Karel Zak 59c19c3f3a po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-31 18:36:06 +02:00
Seong-ho Cho a97c28c0a5 po: add ko.po (from translationproject.org) 2021-05-31 18:20:33 +02:00
Yuri Chornoivan ff58cee802 po: update uk.po (from translationproject.org) 2021-05-31 18:20:33 +02:00
Pedro Albuquerque 44f836d2dd po: update pt.po (from translationproject.org) 2021-05-31 18:20:33 +02:00
Jakub Bogusz 18d7d108c0 po: update pl.po (from translationproject.org) 2021-05-31 18:20:33 +02:00
Božidar Putanec e5f43da014 po: update hr.po (from translationproject.org) 2021-05-31 18:20:33 +02:00
Frédéric Marchal 435e838ac7 po: update fr.po (from translationproject.org) 2021-05-31 18:20:33 +02:00
Mario Blättermann 7e6634024e po: update de.po (from translationproject.org) 2021-05-31 18:20:33 +02:00
Petr Písař b952c8b30f po: update cs.po (from translationproject.org) 2021-05-31 18:20:33 +02:00
Karel Zak 95fbd2db43 libblkid: fix docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-31 18:16:57 +02:00
Karel Zak d58121a22a docs: update copyright years
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-31 18:12:07 +02:00
Karel Zak 1c0d193441 build-sys: remove with-cryptsetup from tools/config-gen.d/all.conf
Unfortunately libtools is not smart enough to link libblkid
dynamically if we link in-tree static libmount.a for libmount tests.
In this case libtools always uses also libblkid.a, but it's problem
for libcryptsetup which requires versioned symbols from libblkid.so

This is no problem for normal binaries, but for libmount tests only
(where we need static library to by-pass public library API).

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-31 17:44:10 +02:00
Ville Skyttä ecec8f1f90 lscpu: fix NVIDIA ARM hw implementer spelling case
Ref respective vendor sites.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-31 12:15:48 +02:00
Ville Skyttä d44a83c1f9 lscpu: recognize more ARM implementers
Add just the implementer string, no parts yet.

Refs https://developer.arm.com/documentation/ddi0595/2021-03/AArch64-Registers/MIDR-EL1--Main-ID-Register
Refs b90e90f40b/arch/arm64/include/asm/cputype.h (L54)

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2021-05-31 12:14:34 +02:00
Thomas Weißschuh 87579a96b2 lscpu: use optional json values
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2021-05-30 23:17:23 +02:00
Thomas Weißschuh f48554d48b libsmartcols: add support for optional boolean values
These default to `null` instead of `false`.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2021-05-30 23:17:23 +02:00
Thomas Weißschuh 17353ee0cd lscpu: use json types
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2021-05-30 23:17:17 +02:00
Karel Zak b97e2145fa po: add xgettext hint for non-c-format string
Reported-by: Petr Pisar <petr.pisar@atlas.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-27 10:39:58 +02:00
Karel Zak 684f921ec2 build-sys: add script to compare config.h from meson and autotools
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-26 13:20:21 +02:00
Karel Zak 647f80e491 meson: add missing header files check
Fixes: https://github.com/karelzak/util-linux/issues/1318
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-26 13:12:31 +02:00
Karel Zak 0a0af6161b lscpu: cleanup tab vs. space
Do not mix tab and space in structs initializations.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-26 11:54:47 +02:00
Bader Zaidan f2aadc1160 lscpu: Replace space with tabs
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-26 11:47:33 +02:00
Karel Zak 05cbd5aeed docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-25 13:45:24 +02:00
Karel Zak 96476550db tests: update lscpu outputs 2021-05-25 13:30:28 +02:00
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 670b10ae36 lib/c_strtod; add locale independent strtod()
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-25 11:31:08 +02:00
Karel Zak afa7e09e4b tests: update lscpu output
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-24 13:43:02 +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 419861d5bf sulogin: fix whitespace error
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-24 13:39:53 +02:00
Werner Fink 0d092db5c4 sulogin: ignore none-existing console devices
and also none-functional console devices. Redirect the error
messages to the appropiate console device.

Signed-off-by: Werner Fink <werner@suse.de>
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
Naohiro Aota db22115875 libblkid: support zone reset for wipefs
We cannot overwrite superblock magic in a sequential required zone. So,
wipefs cannot work as it is. Instead, this commit implements the wiping by
zone resetting.

Zone resetting must be done only for a sequential write zone. This is
checked by is_conventional().

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
2021-05-24 13:39:53 +02:00