Commit Graph

2572 Commits

Author SHA1 Message Date
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 558880dd35 Merge branch 'frkaya/loopconfig' of https://github.com/franksinankaya/util-linux
* 'frkaya/loopconfig' of https://github.com/franksinankaya/util-linux:
  loopdev: use LOOP_CONFIG ioctl
2020-10-05 14:51:45 +02:00
Karel Zak 3cb827ad36 hwclock: make tz use more robust [coverity scan]
It's probably unnecessary, but let's make it more robust and keep
static analyzers happy.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-01 13:44:44 +02:00
Sinan Kaya d5fd456c88 loopdev: use LOOP_CONFIG ioctl
Prefer to use the new LOOP_CONFIG ioctl.
https://lwn.net/Articles/820408/

Signed-off-by: Sinan Kaya <sinan.kaya@microsoft.com>
2020-09-30 20:04:21 -04:00
Karel Zak b76b4788be lscpu: don't use smbios when read snapshots
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-30 14:57:08 +02:00
Jeffrey Bastian 367c85c472 lscpu: use SMBIOS tables on ARM for lscpu
ARM SBBR (Sever Base Boot Requirements) require SMBIOS tables, and
SMBIOS Type 4 describes the CPU manufacturer and model name (among other
details).  If SMBIOS Type 4 is present, use it to extract these strings.

Example output (before and after the patch) on an HP m400, Lenovo HR330A,
and HPE Apollo 70:

[root@hp-m400 ~]# /usr/bin/lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:           APM
Model:               1
Model name:          X-Gene
Stepping:            0x0
[root@hp-m400 ~]# ./lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:                       AppliedMicro
Model:                           1
Model name:                      X-Gene
Stepping:                        0x0

[root@lenovo-hr330a ~]# /usr/bin/lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:           APM
Model:               2
Model name:          X-Gene
Stepping:            0x3
[root@lenovo-hr330a ~]# ./lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:                       Ampere(TM)
Model:                           2
Model name:                      eMAG
Stepping:                        0x3

[root@hpe-apollo-70 ~]# /usr/bin/lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:           Cavium
Model:               1
Model name:          ThunderX2 99xx
Stepping:            0x1
[root@hpe-apollo-70 ~]# ./lscpu | grep -i -e vendor -e model -e stepping
Vendor ID:                       Cavium Inc.
Model:                           1
Model name:                      Cavium ThunderX2(R) CPU CN9980 v2.1 @ 2.20GHz
Stepping:                        0x1

[kzak@redhat.com: - move dmi_header to lscpu.h
                  - make arm_cpu_smbios() more robust for failed
		    open() and read()
                  - use original arm_cpu_decode() also on failed
		    arm_cpu_smbios()]

Signed-off-by: Jeffrey Bastian <jbastian@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-29 13:28:16 +02:00
Shunsuke Nakamura a625b32e2c lscpu: Add FUJITSU aarch64 A64FX cpupart
Add an entry for FUJITSU aarch64 part A64FX.
I tested it on the FX1000.

Signed-off-by: Shunsuke Nakamura <nakamura.shun@fujitsu.com>
2020-09-29 12:42:44 +02:00
Thomas Abraham cbe3304bc4 lscpu: avoid segfault on PowerPC systems with valid hardware configurations
ntypes greater than 1 is valid in some hardware configurations, and an assert()
on the value isn't necessary or very future proof
2020-09-24 14:52:33 -04:00
Gero Treuner 23fcac0457 fallocate: fix --dig-holes at end of files
I discovered that making a file sparse with "fallocate -d filename"
fails on the last block of a file, because - usually being partial -
the system call only zeroes that part instead of deallocating the
block. See man fallocate(2) - section "Deallocating file space".

The expected call is punching the whole block beyond eof, which
doesn't change the file length because of flag FALLOC_FL_KEEP_SIZE.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-14 12:03:50 +02:00
Karel Zak 93b23ce420 Merge branch 'addCarmelLscpu' of https://github.com/tomoaki0705/util-linux
* 'addCarmelLscpu' of https://github.com/tomoaki0705/util-linux:
  add Carmel from NVIDIA
2020-09-14 10:49:28 +02:00
Tomoaki Teshima 793378dfc9 add Carmel from NVIDIA 2020-09-11 22:45:54 +09:00
Hans Holmberg 049859a6df blkzone: add report capacity command
Add a command that answers the the question:
"How much data can I store on this device/in this range of zones?"

Implement this by summing up zone capacities over the given range.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
2020-09-11 12:28:19 +02:00
Mattias Nissler 73b193f8da mount: Add support for "nosymfollow" mount option.
This adds support for the "nosymfollow" mount option, which indicates
that symlinks should not be traversed on the mount this option is
applied to.  Also update the mount(8) man page with information about
this option.

Signed-off-by: Mattias Nissler <mnissler@chromium.org>
Signed-off-by: Ross Zwisler <zwisler@google.com>
2020-09-03 10:52:33 -06:00
Karel Zak a3a0cc42af Merge branch 'master' of https://github.com/itsthem/util-linux
* 'master' of https://github.com/itsthem/util-linux:
  her -> their
  her -> their
  him -> them
  him -> them
  his -> their
  he -> they
  he -> they
  he -> they
2020-09-01 09:45:32 +02:00
Rosen Penev fdac67ae14
hwclock: fix SYS_settimeofday fallback
turns out this is subtly broken. musl 1.2.x for 64-bit architectures defines __NR_settimeofday but not
for 32-bit ones. For 32-bit, it defines a _time32 variant.
2020-08-29 21:55:58 -07:00
leeceeksdee 087203733d
him -> them 2020-08-28 19:17:00 +02:00
leeceeksdee 3a03903011
him -> them 2020-08-28 19:16:33 +02:00
leeceeksdee d15a6c22cf
he -> they 2020-08-28 19:12:44 +02:00
Karel Zak f1f48270c9 mount, umount: restore environ[] after suid drop
The commands mount and umount sanitize environment variables as it
works with suid permissions by default. Since v2.36 it's possible
that the commands drop the permissions and continue as regular user.
It seems we also need to restore the original environ to keep things
consistent for users (e.g. HOME=).

The implementation is pretty simple -- it keeps in memory removed
variables and use it after switch to non-suid mode.

Addresses: https://github.com/karelzak/util-linux/issues/880
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-08-25 10:48:29 +02:00
Karel Zak 69e4fbfbfd hwclock: add fallback if SYS_settimeofday does not exist
It seems Musl-C removes SYS_settimeofday macro at all.

Addresses: 9c6139a720 (commitcomment-41290951)
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-08-11 11:02:31 +02:00
Michael Kerrisk (man-pages) 04be4affb7 Manual pages: wdctl.8: typo fix 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
zhenwei pi 635ac7dad8 irqtop/lsirq: add softirq for man page
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2020-07-23 12:23:56 +02:00
zhenwei pi b2a49bc243 irqtop/lsirq: add additional desc for softirq
Suggested by Karel, add additional description to make softirq more
friendly to end-user. Discuss about this:
    https://github.com/karelzak/util-linux/pull/1079

Note that, we should keep softirqs table align to kernel source code.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2020-07-23 12:23:56 +02:00
zhenwei pi b6ce063b04 irqtop/lsirq: support softirq
Add '-S' or '--softirq' for irqtop/lsirq, instead of interrupts, show
softirqs infomation. Because there is no more description of softirq,
do not show 'NAME' column by default.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2020-07-23 12:23:56 +02:00
Shin'ichiro Kawasaki e5ad3a6ad0 blkzone: add capacity field to zone report
NVMe ZNS specification defines zone capacity. The report zone interface
of Linux kernel supports it. Expose it in report zone by blkzone command.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
2020-07-23 12:23:56 +02:00
Karel Zak 29e204d117 docs: reword others "allow to"
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-14 14:31:29 +02:00
Michael Kerrisk (man-pages) 4f68c8b179 Manual pages: various: reword "allow(s) to"
The wording "allow(s) to" is not grammatical English. Reword various
pages to use a more correct form such "can be use to" or "allows
the [noun] of".

Aklong the way, fix a few nearby wording errors in some pages.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-14 14:08:54 +02:00
Michael Kerrisk (man-pages) c0de507ae5 manual pages: adjtime_config.5: format pathname with .I
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-14 13:58:59 +02:00
Bjarni Ingi Gislason db850f3c19 Subject: docs: remove unnecessary paragraph macros
Remove a second paragraph macro (.TP, .PP) as it does not change the
output (.SS/.PP) or it adds an extra empty line (.TP/.TP)

  Warning from "mandoc -Tlint":

mandoc: ./sys-utils/hwclock.8.in:299:2: WARNING: line scope broken: TP breaks TP
mandoc: ./sys-utils/hwclock.8.in:459:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:543:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:574:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:673:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:721:2: WARNING: skipping paragraph macro: PP after SS

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-07-14 10:37:49 +02:00
Yuri Chornoivan aa1c7a7686 More typo fixes by fossies 2020-07-13 15:33:42 +03:00
Yuri Chornoivan 311e33afef Fix minor typos 2020-07-09 20:14:32 +03:00
Karel Zak c9cad81a0c Merge branch 'cryptsetup_dlopen' of https://github.com/bluca/util-linux
* 'cryptsetup_dlopen' of https://github.com/bluca/util-linux:
  cryptsetup: add option to use via dlopen in libmount
2020-07-08 09:55:12 +02:00
Karel Zak c02980d6f2 lsmem: report inaccessible /sys/devices/system/memory
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1794160
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-08 08:51:45 +02:00
Karel Zak bf1d0a4ea0 lsmem: make it without leaks for non-error output
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-08 08:48:45 +02:00
Luca Boccassi 488fd4c3df cryptsetup: add option to use via dlopen in libmount
Enabling libcrypsetup in libmount had several unintended side
effects.
First of all, it increases the Debian minimal image size by
~2.5% (5.6MB worth of new libraries).
Then, due to libcryptsetup linkage to OpenSSL and libjson-c,
it causes incompatibilities with external programs linking
against both libmount and a private, static, old version of
OpenSSL, or external programs linking against libjansson or
json-glib, which have one symbol in common with libjson-c.

If ./configure is ran with --with-crypsetup=dlopen,
instead of linking to libcrypsetup, use dlopen to resolve
the symbols at runtime only when the verity feature is
used, thus avoiding clashes and keeping images size down.

Fixes #1081

Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
2020-07-07 16:43:55 +01:00
Karel Zak 2e5819df6c unshare: (man) add note about signals on --fork
Addresses: https://github.com/karelzak/util-linux/pull/1087
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-03 13:03:58 +02:00
Karel Zak 9120e39f92 Merge branch 'unshare-signals' of https://github.com/DaanDeMeyer/util-linux 2020-07-03 12:56:54 +02:00
Daan De Meyer 3ba6736f3a unshare --fork: Ignore SIGINT and SIGTERM in parent 2020-07-02 16:35:21 +02:00
Evgeny Vereshchagin ad6aef0ea8 revert a680b2abe7
It's not clear what that commit was supposed to fix. Looks like
772420322d should have helped there.
2020-07-02 10:23:47 +00:00
Evgeny Vereshchagin 7b81644f10 travis: turn on -Werror 2020-07-02 09:49:12 +00:00
Bjarni Ingi Gislason 67fcb85739 sys-utils: mount.8: split a long line into two
Split two long lines, adding '\e' at the end of the first part,
as otherwise the last part of them disappears at the right margin in
the printed output (pdf).

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-06-24 15:42:43 +02:00
Karel Zak 965334990e Merge branch 'some/small/fixes' of https://github.com/lnslbrty/util-linux
* 'some/small/fixes' of https://github.com/lnslbrty/util-linux:
  login: fixed invalid sizeof usage
  libfdisk, unshare: fix gcc-4.9.4 warnings
2020-06-24 15:32:54 +02:00
Alexey Gladkov 9fd01b10d0 setarch: add arm and aarch64 architectures to transition rules
Since aarch64 kernel can be configured with compat 32-bit support
enabled, extend translation rules in a way similar to x86/x86_64.

Suggested-by: "Dmitry V. Levin" <ldv@altlinux.org>
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
2020-06-24 15:05:53 +02:00
Alexey Gladkov 7f48cfb0e4 setarch: make verify_arch_domain extendable
When other compatible architectures are introduced, they will also have
to be added to the verifier.

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
2020-06-24 15:05:53 +02:00
Toni Uhlig 9eba847689
libfdisk, unshare: fix gcc-4.9.4 warnings
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2020-06-19 20:37:33 +02:00
Karel Zak 883d1d6564 build-sys: fix blkdiscard blkid.h use
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-19 19:04:10 +02:00
Rupesh Girase 4bee67e2d1 Manual pages: losetup.8: Fix "--direct-io" defaults
"--direct-io" option is "off" by default while configuring
loop device but it's mentioned "on" in man page.

Signed-off-by: Rupesh Girase <rgirase@redhat.com>
2020-06-19 10:03:00 +02:00
Lukas Czerner 0f23e4c13e blkdiscard: Refuse to proceed if signatures are found
Currently the blkdiscard has the ability to wipe out entere device in a
matter of seconds. This is fine as long as it's intentional, it is
potentially catastrophic if it's not.

With this commit blkdiscard will check for existing signatures on the
device and refuse to continue if any are found unless the operation is
forced with the -f option.

In an attempt to avoid breaking existing automation scripts the force is
only required when stdin refers to a terminal.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
2020-06-19 10:03:00 +02:00
Jakub Wilk 8f3ce436b8 unshare: fix man page formatting
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2020-06-16 20:11:38 +02:00