Karel Zak [Mon, 1 Sep 2025 10:31:47 +0000 (12:31 +0200)]
Merge branch 'master' of https://github.com/mariobl/util-linux
* 'master' of https://github.com/mariobl/util-linux:
Fix markup in pam_lastlog2.8.adoc
Fix markup in ll2_import_lastlog.3.adoc
Fix markup in more.1.adoc
Fix markup in column.1.adoc
Fix markup in mesg.1.adoc
Fix markup in unshare.1.adoc
Fix markup in swapon.8.adoc
Fix typos and markup in setpriv.1.adoc
Fix markup in lsirq.1.adoc
Fix markup in flock.1.adoc
Fix markup in chmem.8.adoc
Fix markup in lastlog2.8.adoc
Fix markup in findmnt.8.adoc
Fix markup in su.1.adoc
Fix markup in login.1.adoc
Fix markup in scols-filter.5.adoc
Karel Zak [Mon, 1 Sep 2025 09:00:19 +0000 (11:00 +0200)]
Merge branch 'fix/findmnt_output_regression' of https://github.com/cgoesche/util-linux-fork
* 'fix/findmnt_output_regression' of https://github.com/cgoesche/util-linux-fork:
findmnt: add missing newline in --raw, --pair and --list output formats
Masatake YAMATO [Sat, 30 Aug 2025 18:18:32 +0000 (03:18 +0900)]
lsfd: revise the code disabling hyperlinks
In the original code, the code was at file.c. This change lifts up
the code to upper layer. As a result the fill_column method of struct
file becomes simple.
As a side effect. this change disables hyperlinks for the entries of
UNKN type (e.g. eventpool, or pidfd). This is a bug fix.
Jiang XueQian [Sat, 30 Aug 2025 09:02:59 +0000 (17:02 +0800)]
zramctl: ignore ENOENT when setting max_comp_streams
The `max_comp_streams` attribute of zram devices has been deprecated and
all writes were silently ignored by the kernel since 2016. It was
finally removed in 6.15, causing zramctl to fail on ENOENT, when it
should just ignore the error.
Chester Gregg [Thu, 28 Aug 2025 02:22:30 +0000 (02:22 +0000)]
Add reflink support for ZFS.
OpenZFS has added the block cloning feature, which implements reflinks for its copy-on-write filesystem. It is now stable and enabled by default on OpenZFS 2.3.0.
This feature addition will add the '-U' and '--unknown' options
It'll allow getopt to ignore unknown options and leave them untouched.
Additionally, it will surpress any error messages generated by getopt(3).
Addresses: #701 Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Karel Zak [Tue, 26 Aug 2025 09:25:18 +0000 (11:25 +0200)]
Merge branch 'fix/clarify_long_flag_in_getopt_script_examples' of https://github.com/cgoesche/util-linux-fork
* 'fix/clarify_long_flag_in_getopt_script_examples' of https://github.com/cgoesche/util-linux-fork:
getopt: clarify the use of '--long' instead of '--longoptions' in shell examples
Karel Zak [Tue, 26 Aug 2025 09:22:41 +0000 (11:22 +0200)]
Merge branch 'feat/support_lsblk_columns_env' of https://github.com/cgoesche/util-linux-fork
* 'feat/support_lsblk_columns_env' of https://github.com/cgoesche/util-linux-fork:
lsblk: add support for LSBLK_COLUMNS environmental variable as an alternative to --output
Karel Zak [Tue, 26 Aug 2025 09:20:16 +0000 (11:20 +0200)]
Merge branch 'fix/document_special_chars_in_getopt' of https://github.com/cgoesche/util-linux-fork
* 'fix/document_special_chars_in_getopt' of https://github.com/cgoesche/util-linux-fork:
getopt: document special symbols that should not be used as option characters
Karel Zak [Tue, 26 Aug 2025 09:16:41 +0000 (11:16 +0200)]
Merge branch 'PR/mount-api-includes' of https://github.com/karelzak/util-linux-work
* 'PR/mount-api-includes' of https://github.com/karelzak/util-linux-work:
include/mount-api-utils: update to recent kernel
include/mount-api-utils: avoid using sys/mount.h
Sumanth Korikkar [Fri, 22 Aug 2025 15:13:53 +0000 (17:13 +0200)]
chmem: Remove commit - chmem print warnings about failures always
Users do not care which blocks are set offline, when using size option
Consistently printing warnings/errors in this case may confuse them and
create the false impression that the enable/disable operation itself has
failed.
If size option succeeds, chmem should not print errors/warnings.
Hence, revert commit 48675a744 ("chmem: print warnings about failures always (not only with --verbose)")
cgoesche [Sun, 24 Aug 2025 00:25:36 +0000 (20:25 -0400)]
lscpu: add 'microcode' information to the CPU summary
The procfs provides microcode revision information on
supported platforms (probably only x86 for now).
It can be useful to show this in the output of lscpu
for various use cases, e.g. applications that wish to
make sure that a specific microcode version has been
loaded.
Addresses: #3050 Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
cgoesche [Fri, 22 Aug 2025 21:31:24 +0000 (17:31 -0400)]
getopt: document special symbols that should not be used as option characters
getopt(3) routines return `?` or `:` when an unknown option character is encountered
or an option is missing its required argument, respectively. It also disallows
`;` as an option character. Documenting this makes users aware that they may not use
these reserved symbols as option characters, e.g. `-?` which is used in some older programs.
Addresses: #2995 Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Jérôme Poulin [Fri, 22 Aug 2025 03:54:17 +0000 (23:54 -0400)]
zramctl: fix MEM-USED column description
The MEM-USED column was incorrectly documented as showing current
memory consumption. This is due to confusing naming in the kernel's
zram implementation:
- Kernel field "mem_used_total" (3rd in mm_stat) = current memory usage
- Kernel field "mem_used_max" (5th in mm_stat) = peak memory usage
zramctl maps these as:
- TOTAL column <= mem_used_total (current usage)
- MEM-USED column <= mem_used_max (peak usage)
The misleading "MEM-USED" name suggests current usage, but it actually
shows the peak memory usage (high water mark) since device creation
or last reset. This is tracked by the kernel's max_used_pages which
only increases when current usage exceeds the stored maximum.
Fixed description from:
"memory zram have been consumed to store compressed data" to
"peak memory usage to store compressed data".
Karel Zak [Thu, 21 Aug 2025 09:35:17 +0000 (11:35 +0200)]
lscpu: use maximum CPU speed from DMI, avoid duplicate version string
* Read maximum CPU speed from DMI
* Don't use max speed if nonsensical
* Avoid appending "CPU @ speed" to the version string if it's already included.
(This is a code robustness improvement as DMI is currently read for ARMs only,
and the issue was detected on Intel.)
Fixes: https://github.com/util-linux/util-linux/commit/a772d7c493afcec32f0123fc947013f74db6e45d Signed-off-by: Karel Zak <kzak@redhat.com>
Naoki Wake [Tue, 19 Aug 2025 01:46:08 +0000 (18:46 -0700)]
kill: usage: fix wrapped indent in -l/--list description
Increase the indentation of the continuation line from one to two
spaces to match the common util-linux help style (see
Documentation/howto-usage-function.txt). This touches a translatable
string. Whitespace-only change; no functional impact.
Signed-off-by: Naoki Wake <wakeke.rainbowearth@gmail.com>
Masatake YAMATO [Fri, 3 Jan 2025 18:50:01 +0000 (03:50 +0900)]
lsfd: decode protocol numbers of RAW and RAW6 sockets
NOTE: this chage breaks compatibility of existing -Q expression used
in a shell script; the data type of RAW.PROTOCOL has changed from
<number> to <string>.
With this change, lsfd decodes RAW.PROTOCOL with a built-in table
based on linux/in.h and getprotobynumber(3) that may refer to
/etc/protocols internally.
In addition, this change adds RAW.PROTOCOL.RAW column that holds
the original protocol numbers.
Thomas Weißschuh [Tue, 19 Aug 2025 16:13:02 +0000 (18:13 +0200)]
lsclocks: stop using MAX_CLOCKS
MAX_CLOCKS is only available in the kernel UAPI headers and not libc
headers. Switch back to a hardcoded value. This value is a stable ABI
anyways and matches the other fallback definitions.
Fixes: d3c49ee062f7 ("lsclocks: use MAX_CLOCKS, improve indention") Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
logger: fix incorrect warning message when both --file and a message are specified
Logger warns that when both --file and a message are given, the message is ignored.
It does the opposite. Fix the warning message to conform to the observed behavior.
Example:
echo "You will not see this file in the log" > file.txt
logger -f file.txt "You will see this message in the log"
Signed-off-by: Alexander Kappner <agk@godking.net>
Zhang Yi [Wed, 13 Aug 2025 02:40:15 +0000 (10:40 +0800)]
fallocate: add FALLOC_FL_WRITE_ZEROES support
The Linux kernel (since version 6.17) supports FALLOC_FL_WRITE_ZEROES in
fallocate(2). Add support for FALLOC_FL_WRITE_ZEROES to the fallocate
utility by introducing a new option -w|--write-zeroes.
Karel Zak [Tue, 12 Aug 2025 12:47:49 +0000 (14:47 +0200)]
swapon: (man page) add details about fstab configuration
The fstab(5) man page already describes some basic aspects of "swap,"
but it makes sense to be more specific in the swapon man page and
describe everything in one place, serving as a normative reference for
what is expected on Linux in fstab for swap.
Fixes: https://github.com/util-linux/util-linux/issues/3667 Signed-off-by: Karel Zak <kzak@redhat.com>
Add support for the auxiliary posix clocks introduced in Linux 6.17.
When auxiliary clocks are not supported, no output line is generated.
When an auxiliary clock is not enabled an output line without TIME
columns is generated.
chrt: (man,usage) put --pid first in synopses and examples, for clarity
When --pid is among the options, it is clearest when it is given as the
first option, because then it doesn't sit between the policy option and
the somewhat related priority value. It creates some kind of symmetry:
the --pid option first, then other things, and the actual PID last.
Let's use these simple functions to report what the last operation or
status detected by the library means to the filesystem. It will be
used by the fanotify monitor as well.
Karel Zak [Tue, 10 Jun 2025 11:51:23 +0000 (13:51 +0200)]
libmount: (monitor) optimize inotify utab watch
Don't repeat no-op inotify_add_watch() calls. This happens when we
monitor the /run[/mount] directory before the utab.event file exists.
The old version just tries to create a watch and ignores ENOENT
errors. It seems better to remember the path of the last created watch
and not repeat it.