Karel Zak [Tue, 24 Jun 2025 09:08:36 +0000 (11:08 +0200)]
Merge branch 'PR/chrt-optional-prio' of https://github.com/karelzak/util-linux-work
* 'PR/chrt-optional-prio' of https://github.com/karelzak/util-linux-work:
chrt: Make priority optional for policies that don't use it
chrt: Only display current settings when no policy is specified
chrt: Make minor cleanups in chrt
chrt: Make priority optional for policies that don't use it
Currently, chrt requires a priority argument even for scheduling
policies like SCHED_OTHER and SCHED_BATCH, which ignore it.
This change relaxes that requirement. Now, priority is only expected
for SCHED_FIFO and SCHED_RR. For other policies, a default value of 0
is set internally and no argument is required on the command line.
This simplifies usage when modifying runtime parameters like
--sched-runtime for non-realtime tasks.
For example, to change the EEVDF tunable base_slice, one currently
needs to run:
chrt -o -T 1000000 --pid 0 $PID
Passing '0' after --pid is not intutive and not required as priority
is not applicable to SCHED_OTHER tasks. Now with this patch, one can do:
chrt -o -T 1000000 --pid $PID
Passing '0' still works ensuring ABI doesn't break.
chrt: Only display current settings when no policy is specified
Previously, running "chrt --pid <pid>" with no policy options
would display the process’s current scheduling attributes, but
specifying a policy without a priority (e.g. chrt --rr --pid <pid>)
would silently fallback to displaying the same info. This was
confusing, since a policy option normally implies an intent to
change something.
This patch changes the behavior so that
chrt --pid <pid> continues to show the current settings:
chrt --pid 10862
pid 10862's current scheduling policy: SCHED_OTHER
pid 10862's current scheduling priority: 0
pid 10862's current runtime parameter: 2800000
If a policy is specified but no priority follows, chrt now
errors out:
Minor changes such as fixing an incorrect comment and aligning
the closing brace of an if condition in main() were made, along
with making the usage of --pid consistent across files instead
of -p, although -p still works, for better readability.
Karel Zak [Thu, 19 Jun 2025 08:45:14 +0000 (10:45 +0200)]
Merge branch 'ntfs3-type-detection' of https://github.com/js731ca/util-linux
* 'ntfs3-type-detection' of https://github.com/js731ca/util-linux:
bash-completion: update autocompletion list to 'ntfs3'
docs: update mount type to 'ntfs3'
tests: update expected type to 'ntfs3'
libblkid/libmount: ntfs: return filesystem type 'ntfs3'
libblkid/libmount: ntfs: return filesystem type 'ntfs3'
Change the returned filesystem type from 'ntfs' to 'ntfs3', to match
what the kernel/fs/ntfs3 driver calls register_filesystem on [1][2].
This same driver also registers itself as 'ntfs', but then runs in a
"legacy" mode [3] which forces the mount to stay RO.
Karel Zak [Mon, 9 Jun 2025 12:42:46 +0000 (14:42 +0200)]
Merge branch 'PR/Benno-2Jun' of https://github.com/karelzak/util-linux-work
* 'PR/Benno-2Jun' of https://github.com/karelzak/util-linux-work:
treewide: replace postal address in license specifier with a terse URL
docs: stop the copyright verbiage from getting included in the POT file
docs: make the "po4a:" line the first line, like in all other .adoc files
correct the full name of the GPL in various files
remove "Copyright (C) ...." notes from files that claim no copyright
remove two leftover license lines from colors.{c,h}
The documentation comment for scols_column_set_data_func was missing the
second asterisk in its opening marker, causing the contents to be
omitted from the rendered documentation.
Chen Qi [Wed, 4 Jun 2025 08:27:19 +0000 (16:27 +0800)]
ts/kill/decode: use RTMIN from 'kill -L' instead of hardcoding 34
glibc uses 34 as the value of SIGRTMIN:
https://sourceware.org/git/?p=glibc.git;a=blob;f=signal/allocrtsig.c;h=8ed8e37dd6c41f94be6eef042ce9db1af1153228;hb=HEAD#l27 """
static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT; """
musl uses 35 as the value of SIGRTMIN:
https://git.musl-libc.org/cgit/musl/tree/src/signal/sigrtmin.c
With the hardcoded 34, test case fails with the following difference:
Karel Zak [Fri, 6 Jun 2025 09:36:14 +0000 (11:36 +0200)]
Merge branch 'bash-completion-command-lsblk' of https://github.com/akinomyoga/util-linux
* 'bash-completion-command-lsblk' of https://github.com/akinomyoga/util-linux:
bash-completion: use "command ls" instead of "\ls"
bash-completion: prefix "command" to other external commands
bash-completion: prefer "builtin cd" to "cd" to avoid aliases
bash-completion: prefer "command lsblk" to "lsblk" to avoid aliases
docs: stop the copyright verbiage from getting included in the POT file
For some reason the asciidoc parser from `po4a` includes *all* comments
from an adoc file into the util-linux-man.pot file. Xgettext had a way
to include only certain comments, but `po4a` does not appear to have a
dedicated mechanism for this.
So... use some bricolage: insert a fruitless 'ifdef' as a barrier
between the copyright/license comment and the title line. This
prevents `po4a` from seeing the two things as belonging together.
This shrinks the util-linux-man.pot file by 1267 lines (2.5%),
equivalent to nearly 67kB (4.8%).
remove two leftover license lines from colors.{c,h}
Last March, commit 549a517857 replaced the SPDX line in three files
with a "No copyright is claimed" phrase, but forgot to remove from
two of those files the text lines that correspond to the SPDX.
Koichi Murase [Tue, 3 Jun 2025 13:08:04 +0000 (22:08 +0900)]
bash-completion: use "command ls" instead of "\ls"
The backslash quoting can be used to bypass aliases, but it cannot be
used to bypass shell functions for interactive uses defined by the
users. We can use "command ls" instead to bypass both aliases and
shell functions.
Karel Zak [Mon, 2 Jun 2025 12:03:32 +0000 (14:03 +0200)]
Merge branch 'PR/Benno-28May' of https://github.com/karelzak/util-linux-work
* 'PR/Benno-28May' of https://github.com/karelzak/util-linux-work:
textual: harmonize the wording of the error message for an invalid PID
colrm: make two error messages actually say that something is wrong
lib/strutils: call gettext() only when argument of --hyperlink is invalid
lib/colors: call gettext() only when the argument of --color is invalid
Koichi Murase [Sun, 1 Jun 2025 20:14:52 +0000 (05:14 +0900)]
bash-completion: prefer "command lsblk" to "lsblk" to avoid aliases
The user may define an alias lsblk to specify the default formatting,
such as -T, which would conflict with lsblk -r used in the Bash
completion settings. In the Bash completion settings, to prevent the
calls of lsblk -r ... from being replaced with lsblk -T -r ... and
failing, lsblk should be called using command lsblk.
Auke Kok [Tue, 27 May 2025 19:34:43 +0000 (12:34 -0700)]
libblkid: Add scoutfs filesystem.
The scoutfs filesystem is maintained out-of-tree, but current enough
that we want to submit it for inclusion in libblkid - there's a few
users out there that would benefit from being able to have lsblk aid in
diagnosing and identifying.
For more information about scoutfs, visit the github page here:
https://github.com/versity/scoutfs
Test images are provided for both data and meta devices. These were
taken from validation samples.
The wiper is set to only wipe a minute part of the filesystem -
basically only the superblock. This is adequately destructive.
Matteo Croce [Fri, 23 May 2025 01:59:36 +0000 (03:59 +0200)]
add option to force cachestat() usage
When cachestat() is not available, mmap() and fincore() are used to get
cache statistics.
This fallback returns less data than cachestat, and potentially hides
read errors by reporting that the file is all mapped in memory:
$ fincore /usr/bin/java
fincore: failed to do cachestat: /usr/bin/java: Operation not permitted
RES PAGES SIZE FILE
208K 13 198,1K /usr/bin/java
$ echo $?
0
$ sudo fincore /usr/bin/java
RES PAGES SIZE FILE
0B 0 198,1K /usr/bin/java
Add a --cachestat argument which forces cachestat usage and fails if
it's not available:
$ fincore -C /usr/bin/java
fincore: failed to do cachestat: /usr/bin/java: Operation not permitted
$ echo $?
1
Also, on huge files the fallback is very slow and memory consuming,
so this flag can be user to avoid doing it by mistake.
lib/colors: call gettext() only when the argument of --color is invalid
Instead of calling gettext() before starting to interpret the argument
of option -L/--color, call it only when it's needed: when the argument
is not recognized.
Karel Zak [Thu, 29 May 2025 10:02:53 +0000 (12:02 +0200)]
Merge branch 'PR/Benno-23May' of https://github.com/karelzak/util-linux-work
* 'PR/Benno-23May' of https://github.com/karelzak/util-linux-work:
hardlink: (man,usage) sort the options mostly alphabetically
hardlink: (usage) improve the descriptions of three options
hardlink: (usage) remove mistaken period from two option descriptions
hexdump: (man) put a list item on a single line, to avoid a warning
Karel Zak [Thu, 29 May 2025 10:02:29 +0000 (12:02 +0200)]
Merge branch 'PR/libmount-verity-deinit' of https://github.com/karelzak/util-linux-work
* 'PR/libmount-verity-deinit' of https://github.com/karelzak/util-linux-work:
libmount: (verity) use messages API for important errors
libmount: (verity) use messages API for dlopen errors
libmount: (verity) fix compiler warning
libmount: (verity) fix deinitialization
hardlink: (usage) improve the descriptions of three options
The first description was too wordy for a --help text, the second
was vague and seemed to imply that it should be combined with the
preceding option, and the third failed to mention that it doesn't
actually link anything.
(Note: the choice for -m for --maximize and -M for --minimize is
unfortunate, as most people would guess the opposite, especially
since -s is used for --minimum-size and -S for --maximum-size.)
hexdump: (man) put a list item on a single line, to avoid a warning
Asciidoctor annoyingly warned for every translation that
unindented content was added to a list item. Avoid this
by not breaking the list item into two lines.
Karel Zak [Mon, 26 May 2025 15:58:48 +0000 (17:58 +0200)]
libmount: (verity) fix compiler warning
libmount/src/hook_veritydev.c: In function 'setup_veritydev':
libmount/src/hook_veritydev.c:457:13: warning: '%s' directive argument is null [-Wformat-overflow=]
Karel Zak [Mon, 26 May 2025 09:32:25 +0000 (11:32 +0200)]
Merge branch 'PR/AT_SECURE' of https://github.com/karelzak/util-linux-work
* 'PR/AT_SECURE' of https://github.com/karelzak/util-linux-work:
treewide: improve getauxval(AT_SECURE) usage
lib/env, ...: use getauxval(AT_SECURE) for SUID check
Karel Zak [Thu, 22 May 2025 08:01:03 +0000 (10:01 +0200)]
lsblk: use ID_PART_ENTRY_SCHEME as fallback for PTTYPE
The udev database typically inherits the ID_PART_TABLE_TYPE property
from the entire disk device to its partitions. However, in some cases,
this property may be missing. Fortunately, blkid/udev also provides
ID_PART_ENTRY_SCHEME for all partitions.
Fixes: https://github.com/util-linux/util-linux/issues/3570 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 21 May 2025 09:05:38 +0000 (11:05 +0200)]
Merge branch 'login_fix' of https://github.com/echoechoin/util-linux
* 'login_fix' of https://github.com/echoechoin/util-linux:
login: (adoc) add a description about LOGIN_SHELL_FALLBACK
login: using an avaiable shell while logging in.