Karel Zak [Wed, 12 Feb 2025 09:50:05 +0000 (10:50 +0100)]
Merge branch 'PR/Benno-text-fixes-w7' of https://github.com/karelzak/util-linux-work
* 'PR/Benno-text-fixes-w7' of https://github.com/karelzak/util-linux-work:
zramctl: improve grammar in usage and don't gettextize list of algorithms
usage: mention also the missing KiB and MiB as permissible suffixes
man pages: use the same verb for --version as for --help, like in usages
renice: put text that belongs together into a single translatable message
blkzone: correct the wording of an error message, from ioctl to function
blkpr: grammarize the description of the tool and its options
textual: give seven error messages the same form as two others
unshare: don't mark "|" and ":" as part of the placeholders
mount: properly mark the arguments of the 'ro' and 'rw' extended options
textual: consistently mark "=" as literal before an optional argument
textual: remove other inconsistent uses of "=" before option argument
unshare: use single asterisks around long options, double around values
unshare: don't use "=" before a required option argument
setpriv: make message for failing PR_GET_PDEATHSIG the same as the other
Karel Zak [Wed, 12 Feb 2025 09:13:10 +0000 (10:13 +0100)]
Merge branch 'ipc' of https://github.com/PrasannaPaithankar/util-linux
* 'ipc' of https://github.com/PrasannaPaithankar/util-linux:
Defined macros for POSIX IPC compilation and removed path buffer.
Fix CodeQL warning
sys-utils: warns if mqueue fs is not mounted
bash completions for IPC tools
sys-utils: fixed build system for POSIX IPC tools
rectified long formatting error
configured for meson build system
added POSIX IPC paathnames; modified sys-utils/Makemodule.am
added POSIX IPC support to lsipc, ipcrm, ipcmk
Antonio Russo [Tue, 11 Feb 2025 12:32:58 +0000 (05:32 -0700)]
fallocate: keep-size and zero-range are compatible
Do not prevent --keep-size and --zero-range from being specified at the
same time, bringing this check into alignment with the documentation,
and completes b85feb999c505222d4815638344c8883d5e4ab58.
Signed-off-by: Antonio Enrico Russo <aerusso@aerusso.net>
usage: mention also the missing KiB and MiB as permissible suffixes
Also, slightly reword the phrase to be more grammatical,
and make it into a full sentence that ends in a period.
(By the way, commit f1970cc557 is somewhat problematic: it requires
that the relevant occurrences of "<num>" and "<size>" in the option
descriptions are now always translated in the same manner, but the
translator may be unaware of this. For Dutch, the latter was the
case for `ipcmk` and `zramctl`. :/ )
unshare: don't mark "|" and ":" as part of the placeholders
The "|" is a meta-character, and should thus be left unmarked, while
the ":" (in the argument of --map-users/--map-groups) is a literal,
and should therefore be marked in bold.
Also, add the new 'subids' literal value for the above two options.
unshare: don't use "=" before a required option argument
The "=" is not needed, is inconsistent with the presentation of the
other options that require an argument, and trying to use "=" with
the equivalent short option would lead to failure.
ci: temporarily switch the alt-arch job worker to Ubuntu 22.04
Using Ubuntu 24.04 on the worker causes random segfaults in s390x
containers using qemu-user-static. Let's switch this, temporarily, to
Ubuntu 22.04 which doesn't seem to have this issue.
Note: the coverage shouldn't change, since the "inner" alt-arch
containers still use "ubuntu-latest" (24.04 ATTOW).
Karel Zak [Thu, 6 Feb 2025 12:08:28 +0000 (13:08 +0100)]
Merge branch 'INVARIANT_RESULT-in-lscpu-virt.c' of https://github.com/AntonMoryakov/util-linux
* 'INVARIANT_RESULT-in-lscpu-virt.c' of https://github.com/AntonMoryakov/util-linux:
sys-utils: remove redundant comparison in read_hypervisor_dmi in lscpu-virt.c
Karel Zak [Tue, 4 Feb 2025 09:10:57 +0000 (10:10 +0100)]
include/debug: Relicense to Public Domain
After reaching an agreement with Ondrej Oprala, we have decided to
change the license of debug.h and debugobj.h from LGPL to Public
Domain. This change is more suitable for the files in the include/
directory of util-linux.
CC: Ondrej Oprala <ondrej.oprala@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 4 Feb 2025 09:06:22 +0000 (10:06 +0100)]
Merge branch 'PR/Benno-text-fixes' of https://github.com/karelzak/util-linux-work
* 'PR/Benno-text-fixes' of https://github.com/karelzak/util-linux-work:
setpriv: describe --groups more correctly in the usage text
setpriv: consistently use "<caps>" to indicate a list of capabilities
readprofile: put two things that belong together into a single message
lsmem: make an error message identical to one used in seven other places
logger: grammarize the description of --socket-errors in the man page
The current check relies on "*sfile" to recognize if a configuration has
been found in the current directory. However this condition is only true
for "type == UL_COLORFILE_SCHEME", breaking the .enable and .disable
configurations.
Instead reorder the logic a bit so that any valid configuration returns
rc == 0.
- Add a check to see if mqueue fs is mounted before using it, and warn
the user if it is not mounted.
- bash completion for ipcrm is fixed to make it independent of awk.
Ricardo Neri [Fri, 31 Jan 2025 03:25:32 +0000 (19:25 -0800)]
lscpu: skip frequencies of 0 MHz when getting minmhz
read_mhz() sets cpu->mhz_min_freq from /sys/devices/system/cpu/cpuN/
cpufreq/cpuinfo_min_freq. The file read fails if cpuN is offline and
cpu->mhz_min_freq is left as 0. 0 MHz is treated as invalid frequency.
lsblk_cputype_get_minmhz() iterates through all possible CPUs to find the
minimum frequency. If one or more CPUs are offline, the minimum frequency
will be 0. This is reflected in the output of lscpu:
$ ./lscpu | grep min
CPU min MHz: 0.0000
Ignore 0-MHz frequencies to find the actual minimum frequency:
setpriv: consistently use "<caps>" to indicate a list of capabilities
The existing "<caps,...>" did not indicate that each capability name
must be preceded by "+" or "-". Also, to indicate that the list needs
to be separated by commas, one would have to use "<cap>[,...]", not
"<cap,...>". So... instead of trying to cram all that info in there,
just say "<caps>", like for --bounding-set.
Karel Zak [Mon, 3 Feb 2025 12:21:51 +0000 (13:21 +0100)]
Merge branch 'PR/mkswap-nocow' of https://github.com/karelzak/util-linux-work
* 'PR/mkswap-nocow' of https://github.com/karelzak/util-linux-work:
mkswap: remove unused variable for non-nocow systems
mkswap: add features list to --version output
mkswap: fix includes
mkswap: improve --file option for use on btrfs
Karel Zak [Mon, 3 Feb 2025 10:48:23 +0000 (11:48 +0100)]
mkswap: fix includes
It is preferable to use #ifdefs in code that relies on available
features, rather than solely depending on the presence of header
files. This is especially important if the functionality of FIEMAP
relies on multiple include files. Additionally, note that we also need
linux/fs.h for S_NOCOW_FL, regardless of FIEMAP.
Karel Zak [Mon, 3 Feb 2025 10:29:44 +0000 (11:29 +0100)]
dmesg: fix --notime use
The --notime command line option disables parsing of timestamps from
kmsg. This is a bug because the timestamps can be used for operations
other than just output. For example, they can be used for filters like
--since (dmesg --since '1 day ago' --notime).
Addresses: https://github.com/util-linux/util-linux/issues/3392 Signed-off-by: Karel Zak <kzak@redhat.com>
lscpu: make three column descriptions more grammatical
Change an adverb to an adjective, use the plural "lines",
and use the plural form of the verb "have". Also, put a
clarification between parentheses, and reshuffle it a bit
for clarity.
Generating all documentation (man pages, man page translations, and
library API docs) is a very time-consuming task. It is also
architecture-independent, as it involves text conversions using
Python, Ruby, etc. It would be better to only do this once in CI and
only when all other tasks have been successfully completed.
This commit also enables verbose output for autotools to make the
compiler command line visible in logs.
* Add V=1 (verbose) for "make" command.
* Add CONFIGUREFAST phase with disabled po-man, asciidoc, and gtk-doc.
* Use full version CONFIGURE phase only for the distcheck CI job.
Karel Zak [Mon, 27 Jan 2025 13:28:36 +0000 (14:28 +0100)]
libuuid: support non-cached scenarios (when -lpthread is unavailable)
This patch makes the dependence on pthread optional for libuuid. In
certain cases, such as Buildroot Linux, uClibc-ng, and very low
resource systems, libpthread may be unavailable.
If libuuid is compiled without pthread, it will not use a local cache
and will instead request a UUID from uuidd for each call. This may
result in less efficient performance, but the UUIDs generated will
still be unique and reliable.
On minimalistic systems, it is highly likely that uuidd will not be
installed, making this change important for portability and robust
code.
Addresses: https://github.com/util-linux/util-linux/pull/3375 Signed-off-by: Karel Zak <kzak@redhat.com>
AntonMoryakov [Thu, 16 Jan 2025 16:24:20 +0000 (19:24 +0300)]
setpriv.c: fix memory leak in parse_groups function
The static analyzer flagged a memory leak in the parse_groups function.
The memory allocated for 'buf' (via xstrdup) was not freed at the end
of the function, leading to a memory leak.
Changes:
- Added free(buf) at the end of the function to release allocated memory.
Triggers found by static analyzer Svace.
Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>