Commit Graph

2911 Commits

Author SHA1 Message Date
Jeff Layton c3ea860b9f mount.8.adoc: note that mandatory locking is fully deprecated in Linux 5.15
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
2021-10-04 12:17:51 +02:00
Karel Zak 1e01704bbc fstrim: fix typo
Addresses: https://github.com/karelzak/util-linux/issues/1463
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-10-04 11:22:32 +02:00
Karel Zak 67f974d41d fstrim: don't trigger autofs
- ignore read-only entries
- ignore autofs entries (for example from /proc/self/mountinfo)
- ignore autofs mountpoints where automounter has not been triggered yet

Fixes: https://github.com/karelzak/util-linux/issues/1463
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-10-04 11:14:01 +02:00
Karel Zak 3d6a3d6d2a prlimit: improve --help output
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-10-01 14:47:04 +02:00
Karel Zak 0f246b73e2 fallocate: add verbose messages
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2003927
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-09-27 15:40:11 +02:00
Karel Zak 5be4d46706 Merge branch 'master' of https://github.com/mariobl/util-linux
* 'master' of https://github.com/mariobl/util-linux:
  Man pages: Fix end extend formatting
2021-09-23 11:12:10 +02:00
Karel Zak 79534c0d7e mount: add hint about dmesg(8) to error messages
Fixes: https://github.com/karelzak/util-linux/pull/1444
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-09-23 11:07:55 +02:00
Mario Blättermann e674323904 Man pages: Fix end extend formatting 2021-09-21 20:48:11 +02:00
Mario Blättermann 256e524f57 mount.8.adoc: fix misformatting
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-09-21 10:48:37 +02:00
Michael Kerrisk dd14f95b9b unshare.1.adoc: Improve wording re creation of bind mounts
Use consistent wording for the options that create
bind mounts, and improve the wording.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-09-21 10:46:09 +02:00
Michael Kerrisk 841fc3a26c unshare.1.adoc: Improve wording re namespace creation
The terminonoly "unshare the namespace" is not very helpful.
Instead, use wording that explains what these options actually
fo: "create a new namespace".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-09-21 10:45:54 +02:00
Karel Zak f45c818004 dmesg: translate ctime strings
Let's make the date-time strings accessible for translators.

Fixes: https://github.com/karelzak/util-linux/issues/1451
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-09-16 12:50:01 +02:00
Alex Xu (Hello71) d53346ed08 losetup: directly set dio instead of afterwards
This avoids an extra syscall, and allows the kernel to automatically set
block size [0], avoiding unnecessary failure with 4096-byte devices.

This changes the observable behavior of losetup --direct-io in the case
where DIO is not supported to fully fail, instead of creating a
non-direct-io device. If the user explicitly specifies --direct-io, then
they should get either a DIO loopdev or no loopdev, not a non-DIO
loopdev and a misleading error.

Additionally, loopcxt_setup_device now uses O_CLOEXEC in the read-only
fallback.

[0] 85560117d0
2021-09-09 09:55:03 -04:00
Karel Zak 78001b7af3 Merge branch 'master' of https://github.com/yugart/util-linux
* 'master' of https://github.com/yugart/util-linux:
  Fix memory leaks in the chcpu
2021-09-07 12:30:15 +02:00
Karel Zak bcfa32d714 eject: fix typo in docs
Fixes: https://github.com/karelzak/util-linux/issues/1436
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-09-07 12:27:54 +02:00
jiazhenyuan a283ad4ed2 Fix memory leaks in the chcpu 2021-09-06 16:50:27 +08:00
Rafael Fontenelle 0e85613e3a Fix misspellings 2021-09-04 11:11:04 -03:00
Karel Zak d736904206 Merge branch 'rfkill-event-abort' of https://github.com/lightmare/util-linux
* 'rfkill-event-abort' of https://github.com/lightmare/util-linux:
  rfkill: quit when read end of stdout is closed
2021-08-19 11:12:31 +02:00
Mickey Rose 91724a713c rfkill: quit when read end of stdout is closed 2021-08-18 17:37:22 +02:00
Hans de Goede b1b0259fe4 wdctl: Workaround reported boot-status bits not being present in wd->ident.options
Some watchdog drivers are capable of reporting WDIOF_CARDRESET in their
bootstatus, but they do not advertise this in the options field
returned by the WDIOC_GETSUPPORT ioctl.

This causes wdctl to not print the CARDRESET flag on these devices,
even when the reset was caused by the watchdog and this is being
reported in the WDIOC_GETBOOTSTATUS return.

Add a workaround by or-ing any bits which are set in the status and
bstatus returns into wd->ident.options so that reported flags will
get printend independent of them being advertised as supported in
wd->ident.options.

This will make wdctl print a CARDRESET line when the system was
actually reset by the watchdog while omitting it when it was not
reset by the watchdog.  At least on drivers which have the
CARDRESET is missing from info.options problem.  On other drivers
the CARDRESET line will always be printend, but the actual reported
value will change.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-08-18 11:45:22 +02:00
Karel Zak 463e96d0bf ipcmk: fix strtoul use, remove deadcode [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-18 10:38:52 +02:00
Karel Zak 6e7a4ab0ec lscpu: fix cppcheck warning [Uninitialized variable]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-18 10:19:23 +02:00
Karel Zak f5c68982f5 mount: (adoc) ext_N_ → ext__N__ [manpage-l10n]
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-17 15:28:28 +02:00
Karel Zak 6ccd33fbb5 mount: (adoc) mount → mount(2), of → or [manpage-l10n]
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-17 15:22:29 +02:00
Karel Zak c71a3c4904 mount: (adoc) fix missing period [manpage-l10n]
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-17 15:07:59 +02:00
Karel Zak 1d6fdf751b Merge branch 'master' of https://github.com/panchenbo/util-linux 2021-08-17 13:55:02 +02:00
Karel Zak 93f1c0fa1d zramctl: improve usage() output
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-17 13:32:10 +02:00
panchenbo fd06bb22b0 fix error ft_part 0x662 2021-08-17 11:29:12 +08:00
Jan Samek ee16b9ff45 zramctl: add zstd compression algorithm option
Add information about the possible value 'zstd' for the 'zramctl --algorithm'
option to 'zramctl --help' and zramctl (8) manpage. The kernel supports zram
with zstd compression starting with 4.15 (see
https://lore.kernel.org/lkml/20170912050005.3247-1-sergey.senozhatsky@gmail.com/#r).

Signed-off-by: Jan Samek <samekh@email.cz>
2021-08-16 21:22:15 +02:00
Karel Zak 5a72054bd0 mount: add -m,--mkdir as shortcut for X-mount.mkdir
Suggested-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-12 13:51:57 +02:00
Karel Zak 926cb4d039 Merge branch 'master' of https://github.com/panchenbo/util-linux
* 'master' of https://github.com/panchenbo/util-linux:
  lscpu:Add Phytium FT-2000+ & S2500 support
2021-08-11 16:22:39 +02:00
Karel Zak 6e68b84144 mount.8: don't consider additional mounts as experimental
This is bug, we have "EXPERIMENTAL" flag in the man page since v2.23.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-11 16:18:29 +02:00
Karel Zak e311e731be libmount: add X-mount.subdir=
Like btrfs subvol=, but more generic and for all filesystems. This
feature is marked as EXPERIMENTAL (may be removed).

 # mount /dev/sdc /mnt/test -o X-mount.subdir=AAA

 # findmnt /dev/sdc
 TARGET    SOURCE         FSTYPE OPTIONS
 /mnt/test /dev/sdc[/AAA] ext4   rw,relatime,stripe=512

Implemented as:

 * open current namespace from /proc/self/ns/mnt
 * mkdir /tmp/mount/mount.<pid>
 * unshare mount namespace
 * create mount node from /tmp/mount/mount.<pid> by mount(MS_BIND)
 * mark /tmp/mount/mount.<pid> private by mount(MS_PRIVATE|MS_REC)
 * bind mount /tmp/mount/mount.<pid>/subdir to <target>
 * umount /tmp/mount/mount.<pid>
 * rmdir /tmp/mount/mount.<pid>
 * setns() to the original namespace

Note that /tmp/mount/mount.<pid> conversion to mount node and call for
MS_PRIVATE are visible (propagated to the system) if /tmp is a shared
filesystem, the rest (all operations with the desired filesystem) is
atomic for a parental namespace.

Maybe one day it will be possible to reimplement it in more
elegant way with new mount kernel APIs (open_tree(), etc.).

Fixes: https://github.com/karelzak/util-linux/issues/1103
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-11 16:14:38 +02:00
panchenbo 3b511f71a4 lscpu:Add Phytium FT-2000+ & S2500 support 2021-08-11 19:33:31 +08:00
panchenbo 642a1a00a5 lscpu:Add Phytium aarch64 cpupart 2021-08-11 13:00:08 +08:00
Karel Zak 27ffec8369 lscpu: fix compilation against librtas
Fixes: https://github.com/karelzak/util-linux/issues/1406
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-09 09:52:46 +02:00
Karel Zak 87559313df prlimit: fix compiler warning [-Wmaybe-uninitialized]
sys-utils/prlimit.c:467:16: warning: 'hard' may be used uninitialized in this function [-Wmaybe-uninitialized]
  lim->rlim_max = hard;
  ~~~~~~~~~~~~~~^~~~~~
sys-utils/prlimit.c:456:15: note: 'hard' was declared here
  rlim_t soft, hard;
               ^~~~
sys-utils/prlimit.c:466:16: warning: 'soft' may be used uninitialized in this function [-Wmaybe-uninitialized]
  lim->rlim_cur = soft;
  ~~~~~~~~~~~~~~^~~~~~
sys-utils/prlimit.c:456:9: note: 'soft' was declared here
  rlim_t soft, hard;
         ^~~~

References: https://github.com/karelzak/util-linux/issues/1406
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-09 09:45:21 +02:00
Karel Zak 0d7cef3ddb lscpu: fix NULL dereference
Fixes: https://github.com/karelzak/util-linux/issues/1401
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-30 14:35:25 +02:00
Karel Zak 760587e130 Merge branch 'procmnt-fix' of https://github.com/benaryorg/util-linux
* 'procmnt-fix' of https://github.com/benaryorg/util-linux:
  fix #648 by ignoring EINVAL on-remount of proc
2021-07-28 11:17:59 +02:00
Karel Zak 914966e925 readprofile: use snprintf() rather than sprintf() 2021-07-27 13:31:57 +02:00
Karel Zak 34cf0aa56d ipcs: use snprintf() rather than sprintf() 2021-07-27 13:31:47 +02:00
Karel Zak 1c9143d0c1 sys-utils/ipcutils: be careful when call calloc() for uint64 nmembs
Fix: https://github.com/karelzak/util-linux/issues/1395
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-27 11:58:31 +02:00
Luca Boccassi d9567bdead verity: remove experimental tag from mount manpage
It has been around for a year and a half, and 3 releases.
2021-07-16 11:52:44 +01:00
Karel Zak a8c4f2f9a9 Merge branch 'verity_sig_extension' of https://github.com/bluca/util-linux
* 'verity_sig_extension' of https://github.com/bluca/util-linux:
  mount: fix roothash signature extension in manpage
2021-07-14 12:20:30 +02:00
Luca Boccassi ce02babfa6 verity: add support for corruption action flag
Add verity.oncorruption= to let users override the default kernel
behaviour, using libcrypsetup's relevant flags.

Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
2021-07-11 18:12:06 +01:00
Luca Boccassi c9c5933a38 mount: fix roothash signature extension in manpage
The PKCS7 RFC recommends to use .p7s for detached signatures file extensions,
so use that in the example.

https://datatracker.ietf.org/doc/html/rfc5751#section-3.2.1
2021-07-03 12:16:34 +01:00
Karel Zak c2ca2837a2 lscpu: don't use DMI if executed with --sysroot
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-02 13:13:01 +02:00
benaryorg ef7eccad5b
fix #648 by ignoring EINVAL on-remount of proc
When using --mount-proc=/some/path then unshare fails if the path provided is not already mounted due to the mount(2) call to change the propagation of the mount.
In such a case mount(2) returns EINVAL, which however is used for a variety of other errors.
If this error is ignored mistakenly the effects however should be negligible since:

1. the mount of proc afterwards happens regardless, errors of which are not ignored
2. the propagation change of root uses MS_REC, which should already change the propagation of all mounts recursively

Furthermore /proc is not touched if --mount-proc specifies a different mount point.
This should not cause too much unexpected behaviour due to point 2 from above in any case.
Specifying --mount-proc with a different path also means that unshare(3) is not instructed to touch /proc, thus /proc not being touched should not be unexpected.
As a side note, if unshare is called with /proc as an (implicit) parameter to --mount-proc then /proc is a stacked mount, meaning if /proc is unmounted within the namespace the host /proc will be visible again, thus not touching /proc with a different parameter does not constitute more information leakage than the alternative, quite contrary it may even be the desired behaviour.

Signed-off-by: benaryorg <binary@benary.org>
2021-07-02 10:51:51 +00:00
Karel Zak 8678085900 fstrim: clean return code on --quiet-unsupported
This feature is already supported for -a and -A. Let's support it also
when FS specified on command line.

Addresses: https://github.com/systemd/mkosi/pull/721
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-01 17:23:43 +02:00
Huang Shijie 81d6de9166 lscpu: remove the old code
The file "/sys/firmware/dmi/tables/DMI" always exists.

The dmi_decode_cputype() can provide more information then arm_smbios_decode().
So remove it to tidy the code.

Before this patch, we can get the output from Centos 7.9 who has
"/sys/firmware/dmi/entries/4-0/raw" and "/sys/firmware/dmi/tables/DMI":
  ----------------------------------------------------
  BIOS Vendor ID:                  Ampere(TM)
  Model name:                     Neoverse-N1
    BIOS Model name:               Ampere(TM) Altra(TM) Processor
  ----------------------------------------------------

 After this patch which uses "/sys/firmware/dmi/tables/DMI", in Centos 7.9, we get:
  ----------------------------------------------------
  BIOS Vendor ID:                  Ampere(TM)
  Model name:                     Neoverse-N1
    BIOS Model name:               Ampere(TM) Altra(TM) Processor Q00-00 CPU @ 2.8GHz
    BIOS CPU family:               257
  ----------------------------------------------------

Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
2021-06-30 11:27:26 +02:00