]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 weeks agoMerge branch 'fincore/eperm' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 12 Nov 2025 11:10:03 +0000 (12:10 +0100)] 
Merge branch 'fincore/eperm' of https://github.com/t-8ch/util-linux

* 'fincore/eperm' of https://github.com/t-8ch/util-linux:
  fincore: do not fall back to mincore if cachestat fails with EPERM

2 weeks agoMerge branch 'PR/cal-header-colors' of https://github.com/karelzak/util-linux-work
Karel Zak [Wed, 12 Nov 2025 11:09:26 +0000 (12:09 +0100)] 
Merge branch 'PR/cal-header-colors' of https://github.com/karelzak/util-linux-work

* 'PR/cal-header-colors' of https://github.com/karelzak/util-linux-work:
  tests: update cal color outputs
  cal: improve header color printing

2 weeks agoMerge branch 'PR/chmem-dynamic-configuration' of https://github.com/karelzak/util...
Karel Zak [Wed, 12 Nov 2025 11:08:39 +0000 (12:08 +0100)] 
Merge branch 'PR/chmem-dynamic-configuration' of https://github.com/karelzak/util-linux-work

* 'PR/chmem-dynamic-configuration' of https://github.com/karelzak/util-linux-work:
  tests: update lsmem outputs
  lsmem: use xstrncpy()
  lsmem,chmem: add configure/deconfigure bash completion options
  lsmem: add doc for dynamic (de)configuration and memmap-on-memory support
  chmem: add chmem documentation for dynamic (de)configuration of memory
  chmem: add support for dynamic (de)configuration of hotplug memory
  lsmem: add support to display dynamic (de)configuration of memory
  lsmem: display global memmap on memory parameter

3 weeks agoMerge branch 'lsfd--netlink-lport-data-size' of https://github.com/masatake/util...
Karel Zak [Mon, 10 Nov 2025 11:46:55 +0000 (12:46 +0100)] 
Merge branch 'lsfd--netlink-lport-data-size' of https://github.com/masatake/util-linux

* 'lsfd--netlink-lport-data-size' of https://github.com/masatake/util-linux:
  lsfd: (bugfix) use PRIu32 for prining lport of netlink socket

3 weeks agoMerge branch 'hwclock-rtc-fix-typo' of https://github.com/jgilles/util-linux
Karel Zak [Mon, 10 Nov 2025 11:46:02 +0000 (12:46 +0100)] 
Merge branch 'hwclock-rtc-fix-typo' of https://github.com/jgilles/util-linux

* 'hwclock-rtc-fix-typo' of https://github.com/jgilles/util-linux:
  hwclock-rtc: fix verbose output when --param-set value is unchanged

3 weeks agoMerge branch 'fallocate' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 10 Nov 2025 11:43:57 +0000 (12:43 +0100)] 
Merge branch 'fallocate' of https://github.com/t-8ch/util-linux

* 'fallocate' of https://github.com/t-8ch/util-linux:
  tests: (swaplabel) don't create test image with truncate(1)
  fallocate: require posix_fallocate() from libc
  fallocate: drop syscall() fallback for fallocate()
  build: simplify checks for fallocate() and posix_fallocate()

3 weeks agoFix the issue of fd resource leakage
Leefancy [Mon, 10 Nov 2025 09:14:18 +0000 (17:14 +0800)] 
Fix the issue of fd resource leakage

Signed-off-by: Leefancy <lijian01@kylinos.cn>
3 weeks agotests: (swaplabel) don't create test image with truncate(1)
Thomas Weißschuh [Sat, 1 Nov 2025 15:50:49 +0000 (16:50 +0100)] 
tests: (swaplabel) don't create test image with truncate(1)

truncate(1) can create holes in the file. These will trigger a warning
in mkswap(1), failing the testsuite. Given that fallocate(1) now alway
supports posix_fallocate() which works on all filesystems, truncate(1)
is unnecessary anyways.

Reported-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agofallocate: require posix_fallocate() from libc
Thomas Weißschuh [Sat, 1 Nov 2025 15:55:49 +0000 (16:55 +0100)] 
fallocate: require posix_fallocate() from libc

Recent libcs implement posix_fallocate() properly. The fallback logic
should never be used. Furthermore unconditional support for
posix_fallocate() will enable some further cleanup and fixes.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agofallocate: drop syscall() fallback for fallocate()
Thomas Weißschuh [Sat, 1 Nov 2025 20:49:58 +0000 (21:49 +0100)] 
fallocate: drop syscall() fallback for fallocate()

The ABI of the fallocate() syscall is complicated and not properly
handled by the open-coded fallback logic.

As all recent libcs implement fallocate() properly, drop the
open-coded systemcall fallback and depend on the libc implementation.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agobuild: simplify checks for fallocate() and posix_fallocate()
Thomas Weißschuh [Fri, 7 Nov 2025 11:47:20 +0000 (12:47 +0100)] 
build: simplify checks for fallocate() and posix_fallocate()

The bespoke test logic for those two functions was only necessary for
old glibc versions which have long gone out of support.

Align the checks with all other ones.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agolsfd: (bugfix) use PRIu32 for prining lport of netlink socket
Masatake YAMATO [Sat, 8 Nov 2025 02:42:31 +0000 (11:42 +0900)] 
lsfd: (bugfix) use PRIu32 for prining lport of netlink socket

Fixes #3849

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 weeks agohwclock-rtc: fix verbose output when --param-set value is unchanged
Jesse Gilles [Fri, 7 Nov 2025 19:27:49 +0000 (13:27 -0600)] 
hwclock-rtc: fix verbose output when --param-set value is unchanged

RTC_PARAM_SET operation is skipped rather than GET

3 weeks agoMerge branch 'fix/missing_long_opts_completions' of https://github.com/cgoesche/util...
Karel Zak [Fri, 7 Nov 2025 11:33:56 +0000 (12:33 +0100)] 
Merge branch 'fix/missing_long_opts_completions' of https://github.com/cgoesche/util-linux-fork

* 'fix/missing_long_opts_completions' of https://github.com/cgoesche/util-linux-fork: (41 commits)
  bash-completion: (nsenter) add missing --follow-context
  bash-completion: (namei) add missing --context
  bash-completion: (setpriv) add missing long options
  bash-completion: (pg) add missing long options
  bash-completion: (lastlog2) add missing --active
  bash-completion: (whereis) add missing long options
  bash-completion: (wdctl) add missing long options
  bash-completion: (uuidd) add missing --cont-clock
  bash-completion: (unshare) add missing long options
  bash-completion: (swapon) add missing --options
  bash-completion: (sfdisk) add missing long options
  bash-completion: (setsid) add missing --fork
  bash-completion: (scriptlive) add missing --echo
  bash-completion: (renice) add missing --relative
  bash-completion: (more) add missing --exit-on-eof
  bash-completion: (mkswap) add missing long options
  bash-completion: (mkfs.minix) add missing --lock
  bash-completion: (mkfs.cramfs) add missing long options
  bash-completion: (mkfs.bfs) add missing --lock
  bash-completion: (lsmem) add missing --split
  ...

3 weeks agoMerge branch 'PR/benno-losetup' of https://github.com/karelzak/util-linux-work
Karel Zak [Fri, 7 Nov 2025 11:19:16 +0000 (12:19 +0100)] 
Merge branch 'PR/benno-losetup' of https://github.com/karelzak/util-linux-work

* 'PR/benno-losetup' of https://github.com/karelzak/util-linux-work:
  losetup: (man) put the synopses in a better order, the name-giver first
  losetup: remove the --verbose flag, as it doesn't actually do anything
  losetup: sort 'O' correctly for the mutual-exclusive check to work

3 weeks agoMerge branch 'PR/include-optutils-err' of https://github.com/karelzak/util-linux...
Karel Zak [Fri, 7 Nov 2025 11:18:50 +0000 (12:18 +0100)] 
Merge branch 'PR/include-optutils-err' of https://github.com/karelzak/util-linux-work

* 'PR/include-optutils-err' of https://github.com/karelzak/util-linux-work:
  include/optutils: improve err_exclusive_options() output

3 weeks agotests: update cal color outputs
Karel Zak [Fri, 7 Nov 2025 11:15:51 +0000 (12:15 +0100)] 
tests: update cal color outputs

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agologin: add line break after timeout message
Karel Zak [Fri, 7 Nov 2025 10:57:58 +0000 (11:57 +0100)] 
login: add line break after timeout message

Just to make login(1) more user-friendly for those who do crazy things.

Based on https://github.com/util-linux/util-linux/pull/3842

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agotests: update lsmem outputs
Karel Zak [Fri, 7 Nov 2025 10:41:21 +0000 (11:41 +0100)] 
tests: update lsmem outputs

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agocal: improve header color printing
Karel Zak [Fri, 7 Nov 2025 10:35:12 +0000 (11:35 +0100)] 
cal: improve header color printing

It's more robust to avoid using line breaks within the colored area.

Fixes: https://github.com/util-linux/util-linux/issues/3844
Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agoinclude/optutils: improve err_exclusive_options() output
Karel Zak [Mon, 3 Nov 2025 12:41:31 +0000 (13:41 +0100)] 
include/optutils: improve err_exclusive_options() output

OLD:
$ losetup --remove --detach loop0
losetup: mutually exclusive arguments: --detach-all --all --set-capacity --detach --find --associated --remove
NEW:
$ losetup --remove --detach loop0
losetup: options --detach and --remove cannot be combined.

Suggested-by: Benno Schulenberg <bensberg@telfort.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agolsmem: use xstrncpy()
Karel Zak [Fri, 7 Nov 2025 09:28:14 +0000 (10:28 +0100)] 
lsmem: use xstrncpy()

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agolsmem,chmem: add configure/deconfigure bash completion options
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:06 +0000 (17:38 +0200)] 
lsmem,chmem: add configure/deconfigure bash completion options

Add bash completion for configure/deconfigure options in chmem and lsmem.

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
3 weeks agolsmem: add doc for dynamic (de)configuration and memmap-on-memory support
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:05 +0000 (17:38 +0200)] 
lsmem: add doc for dynamic (de)configuration and memmap-on-memory support

lsmem --output-all now displays two new columns:

CONFIGURED : yes/no indicating if a memory block has been explicitly
configured.

MEMMAP-ON-MEMORY : yes/no indicating whether the block uses
memmap-on-memory.

lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE   BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online  0-15  yes        no
0x80000000-0xffffffff   2G     offline 16-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

Add documentation for new fields.

Reviewed-by: Maria Eisenhaendler <maria1@de.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
3 weeks agochmem: add chmem documentation for dynamic (de)configuration of memory
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:04 +0000 (17:38 +0200)] 
chmem: add chmem documentation for dynamic (de)configuration of memory

Describe chmem configure, deconfigure and memmap-on-memory options:

ff18dcb19aab ("s390/sclp: Add support for dynamic (de)configuration of
memory") s390 kernel no longer pre-adds all standby memory at boot.
Instead, users must explicitly configure a block before it can be used
for online/offline actions. At configuration time, users can dynamically
decide whether to use optional memmap-on-memory for each memory block,
where value of 1 allocates metadata (such as struct pages array) from
the hotplug memory itself, enabling hot-add operations even under memory
pressure. A value of 0 stores metadata in regular system memory, which
may require additional free memory, but enables continuous physical
memory across memory blocks.

Add documentation to reflect the following options:
* chmem --configure 128M --memmap-on-memory 1
* chmem --deconfigure 128M
* chmem --enable 128M # implicitly configure memory if supported by
  architecture and online it
* chmem --disable 128M  # offline memory and implicitly deconfigure if
  supported by the architecture.

Just like online and offline actions, memory configuration and
deconfiguration can be controlled through similar options. Also,
memmap-on-memory setting can be changed, only when the memory block is
in deconfigured state. This means, it is usable only via --configure
option.

Reviewed-by: Maria Eisenhaendler <maria1@de.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
3 weeks agochmem: add support for dynamic (de)configuration of hotplug memory
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:03 +0000 (17:38 +0200)] 
chmem: add support for dynamic (de)configuration of hotplug memory

Extend chmem to use the new s390 kernel interface for configuring and
deconfiguring hotpluggable memory blocks, with memmap-on-memory support.

Background:
On s390, memmap-on-memory was introduced to ensure that the struct page
array (metadata) for hotpluggable standby memory is allocated from the
memory block itself. This allowed hot-add operations even under memory
pressure, particularly in cases with a strong imbalance between
boot-time online memory and standby memory.

The original design, however, had few limitations:
* All hotpluggable standby memory was added at boot.
* The use of memmap-on-memory was global and static, decided at boot
  time. Either all standby blocks used it, or none of them did.
* memmap-on-memory choice could not be changed at runtime, limiting
  flexibility. For example, when continuous physical memory was required
  later across memory blocks.

The s390 kernel ff18dcb19aab ("s390/sclp: Add support for dynamic
(de)configuration of memory") no longer pre-adds all standby memory at
boot. Instead, users must explicitly configure a block before it can be
used for online/offline actions.  At configuration time, users can
dynamically decide whether to use optional memmap-on-memory for each
memory block, where value of 1 allocates metadata (such as struct pages
array) from the hotplug memory itself, enabling hot-add operations even
under memory pressure. A value of 0 stores metadata in regular system
memory and enables continuous physical memory across memory blocks.

s390 kernel sysfs interface to configure/deconfigure memory with
memmap-on-memory support looks as shown below:

1. Configure memory
echo 1 > /sys/firmware/memory/memoryX/config  

2. Deconfigure memory
echo 0 > /sys/firmware/memory/memoryX/config

3. Enable memmap-on-memory
echo 1 > /sys/firmware/memory/memoryX/memmap_on_memory

4. Disable memmap-on-memory
echo 0 > /sys/firmware/memory/memoryX/memmap_on_memory

* Initial memory layout:
lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE   BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online  0-15  yes        no
0x80000000-0xffffffff   2G     offline 16-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

* Configure memory with memmap-on-memory.
chmem -c 128M -m 1
lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE    BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online   0-15  yes        no
0x80000000-0x87ffffff   128M   offline  16    yes        yes
0x88000000-0xffffffff   1.9G   offline  17-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

* Deconfigure memory
chmem -g 128M
lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE    BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online   0-15  yes        no
0x80000000-0xffffffff   2G     offline  16-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

* Online memory.
If the memory is in deconfigured state, configure and online it.

chmem -e 128M -v
Memory Block 16 (0x0000000080000000-0x0000000087ffffff) configured
Memory Block 16 (0x0000000080000000-0x0000000087ffffff) enabled

lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE    BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff    2G    online   0-15  yes        no
0x80000000-0x87ffffff    128M  online   16    yes        yes
0x88000000-0xffffffff    1.9G  offline  17-31 no         yes

Memory block size:                128M
Total online memory:              2.1G
Total offline memory:             1.9G
Memmap on memory parameter:        yes

* Offline memory
If the memory is in online state, then offline it and deconfigure it.

chmem -d 128M -v
Memory Block 16 (0x0000000080000000-0x0000000087ffffff) disabled
Memory Block 16 (0x0000000080000000-0x0000000087ffffff) deconfigured

lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE    BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online   0-15  yes        no
0x80000000-0xffffffff   2G     offline  16-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

Just like online and offline actions, memory configuration and
deconfiguration can be controlled through similar options. Also,
memmap-on-memory setting can be changed, only when the memory block is
in deconfigured state. This means, it is usable only via --configure
option.

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
3 weeks agolsmem: add support to display dynamic (de)configuration of memory
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:02 +0000 (17:38 +0200)] 
lsmem: add support to display dynamic (de)configuration of memory

Extend lsmem to display (de)configured blocks and memmap_on_memory
state. With the new s390 kernel interface (linux-next) ff18dcb19aab
("s390/sclp: Add support for dynamic (de)configuration of memory"),
standby memory blocks are no longer pre-added at boot, but must be
explicitly configured before being eligible for online/offline
operations. At configuration time, users can also decide whether to use
memmap-on-memory per block.

Add CONFIGURED column : indicate if a memory block has been explicitly
configured.

Add MEMMAP-ON-MEMORY column : indicate if a memory block uses
memmap-on-memory.

memmap-on-memory reference:
https://docs.kernel.org/admin-guide/mm/memory-hotplug.html

Users can now inspect memory configuration state and retrieve
memmap-on-memory state per block.

lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE   BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online  0-15  yes        no
0x80000000-0xffffffff   2G     offline 16-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
3 weeks agolsmem: display global memmap on memory parameter
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:01 +0000 (17:38 +0200)] 
lsmem: display global memmap on memory parameter

Display the output of global memmap-on-memory parameter for memory
hotplug. Retrieve the details via
/sys/module/memory_hotplug/parameters/memmap_on_memory.

lsmem
RANGE                                 SIZE  STATE REMOVABLE BLOCK
0x0000000000000000-0x00000001ffffffff   8G online       yes  0-63

Memory block size:                128M
Total online memory:                8G
Total offline memory:               0B
Memmap on memory parameter:        yes

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
4 weeks agolosetup: (man) put the synopses in a better order, the name-giver first
Benno Schulenberg [Wed, 29 Oct 2025 11:03:58 +0000 (12:03 +0100)] 
losetup: (man) put the synopses in a better order, the name-giver first

Also, condense the synopsis for setting up a loop device to just the
essentials -- it had become so long that it was incomprehensible.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agolosetup: remove the --verbose flag, as it doesn't actually do anything
Benno Schulenberg [Wed, 29 Oct 2025 11:03:57 +0000 (12:03 +0100)] 
losetup: remove the --verbose flag, as it doesn't actually do anything

Fourteen years ago, commit c7e0925def rewrote the `losetup` tool,
removing all references to the 'verbose' variable.  Three years
later, commit 60cb2c3720 removed the line 'verbose = 1' because
the compiler complained that the variable was set but never used.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agolosetup: sort 'O' correctly for the mutual-exclusive check to work
Benno Schulenberg [Wed, 29 Oct 2025 11:03:56 +0000 (12:03 +0100)] 
losetup: sort 'O' correctly for the mutual-exclusive check to work

The options need to be in strict ascending order.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agowdctl: remove -d option leftover
Munehisa Kamata [Tue, 28 Oct 2025 19:54:17 +0000 (12:54 -0700)] 
wdctl: remove -d option leftover

-d option was removed in commit f56338b43973 ("wdctl: allow to specify more
than one device"), but the optstring wasn't updated at that time and wdctl
can still accept the option halfway as below:

 $ wdctl -d
 wdctl: option requires an argument -- 'd'

whereas it should say:

 wdctl: invalid option -- 'd'

So update the optstring.

Fixes: f56338b43973 ("wdctl: allow to specify more than one device")
Signed-off-by: Munehisa Kamata <kamatam@amazon.com>
4 weeks agoMerge branch 'fix/login_manpage_grammar' of https://github.com/cgoesche/util-linux...
Karel Zak [Mon, 3 Nov 2025 11:16:23 +0000 (12:16 +0100)] 
Merge branch 'fix/login_manpage_grammar' of https://github.com/cgoesche/util-linux-fork

* 'fix/login_manpage_grammar' of https://github.com/cgoesche/util-linux-fork:
  login: fix minor grammar mistake in the manpage

4 weeks agoMerge branch 'meson' of https://github.com/neheb/util-linux
Karel Zak [Mon, 3 Nov 2025 11:16:08 +0000 (12:16 +0100)] 
Merge branch 'meson' of https://github.com/neheb/util-linux

* 'meson' of https://github.com/neheb/util-linux:
  meson: fix non threaded toolchains

4 weeks agoMerge branch 'bst/hwclock-cmp-set' of https://github.com/Bastian-Krause/util-linux
Karel Zak [Mon, 3 Nov 2025 11:13:26 +0000 (12:13 +0100)] 
Merge branch 'bst/hwclock-cmp-set' of https://github.com/Bastian-Krause/util-linux

* 'bst/hwclock-cmp-set' of https://github.com/Bastian-Krause/util-linux:
  hwclock: skip RTC_PARAM_SET for --param-set with unchanged value

4 weeks agologin: fix minor grammar mistake in the manpage
cgoesche [Mon, 3 Nov 2025 03:31:40 +0000 (22:31 -0500)] 
login: fix minor grammar mistake in the manpage

Signed-off-by: cgoesche <cgoesc2@wgu.edu>
4 weeks agomeson: fix non threaded toolchains
Rosen Penev [Sun, 2 Nov 2025 20:25:26 +0000 (12:25 -0800)] 
meson: fix non threaded toolchains

threads needs to be set as not required.

Cleaned up meson build slightly to use one dependency call.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 weeks agobash-completion: (nsenter) add missing --follow-context
cgoesche [Sat, 1 Nov 2025 23:50:17 +0000 (19:50 -0400)] 
bash-completion: (nsenter) add missing --follow-context

Signed-off-by: cgoesche <cgoesc2@wgu.edu>
4 weeks agobash-completion: (namei) add missing --context
cgoesche [Sat, 1 Nov 2025 23:49:33 +0000 (19:49 -0400)] 
bash-completion: (namei) add missing --context

Signed-off-by: cgoesche <cgoesc2@wgu.edu>
4 weeks agobash-completion: (setpriv) add missing long options
cgoesche [Sat, 1 Nov 2025 23:47:03 +0000 (19:47 -0400)] 
bash-completion: (setpriv) add missing long options

Signed-off-by: cgoesche <cgoesc2@wgu.edu>
4 weeks agobash-completion: (pg) add missing long options
cgoesche [Sat, 1 Nov 2025 23:46:27 +0000 (19:46 -0400)] 
bash-completion: (pg) add missing long options

Signed-off-by: cgoesche <cgoesc2@wgu.edu>
4 weeks agobash-completion: (lastlog2) add missing --active
cgoesche [Sat, 1 Nov 2025 23:45:32 +0000 (19:45 -0400)] 
bash-completion: (lastlog2) add missing --active

Signed-off-by: cgoesche <cgoesc2@wgu.edu>
4 weeks agofincore: do not fall back to mincore if cachestat fails with EPERM
Thomas Weißschuh [Sat, 1 Nov 2025 13:58:34 +0000 (14:58 +0100)] 
fincore: do not fall back to mincore if cachestat fails with EPERM

cachestat() and mincore() both require that the tested file is
(potentially) writable by the current user. If this permission check
fails, cachestat() will return EPERM while mincore() will simply mark
all pages as resident in core, as a proper EPERM would violate its API
contract. But when cachestat() fails with EPERM we know that mincore()
will not return real data, so instead show an error message.

Reported-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 weeks agobash-completion: (whereis) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:25:29 +0000 (13:25 -0400)] 
bash-completion: (whereis) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (wdctl) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:24:54 +0000 (13:24 -0400)] 
bash-completion: (wdctl) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (uuidd) add missing --cont-clock
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:24:12 +0000 (13:24 -0400)] 
bash-completion: (uuidd) add missing --cont-clock

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (unshare) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:22:46 +0000 (13:22 -0400)] 
bash-completion: (unshare) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (swapon) add missing --options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:21:14 +0000 (13:21 -0400)] 
bash-completion: (swapon) add missing --options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (sfdisk) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:20:24 +0000 (13:20 -0400)] 
bash-completion: (sfdisk) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (setsid) add missing --fork
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:18:58 +0000 (13:18 -0400)] 
bash-completion: (setsid) add missing --fork

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (scriptlive) add missing --echo
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:18:32 +0000 (13:18 -0400)] 
bash-completion: (scriptlive) add missing --echo

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (renice) add missing --relative
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:17:05 +0000 (13:17 -0400)] 
bash-completion: (renice) add missing --relative

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (more) add missing --exit-on-eof
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:16:21 +0000 (13:16 -0400)] 
bash-completion: (more) add missing --exit-on-eof

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (mkswap) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:15:58 +0000 (13:15 -0400)] 
bash-completion: (mkswap) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (mkfs.minix) add missing --lock
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:14:53 +0000 (13:14 -0400)] 
bash-completion: (mkfs.minix) add missing --lock

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (mkfs.cramfs) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:14:24 +0000 (13:14 -0400)] 
bash-completion: (mkfs.cramfs) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (mkfs.bfs) add missing --lock
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:13:50 +0000 (13:13 -0400)] 
bash-completion: (mkfs.bfs) add missing --lock

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (lsmem) add missing --split
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:12:56 +0000 (13:12 -0400)] 
bash-completion: (lsmem) add missing --split

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (lslogins) add missing --shell
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:12:32 +0000 (13:12 -0400)] 
bash-completion: (lslogins) add missing --shell

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (lscpu) add missing --hierarchic
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:11:59 +0000 (13:11 -0400)] 
bash-completion: (lscpu) add missing --hierarchic

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (lsclocks) add missing --no-discover-dynamic
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:11:29 +0000 (13:11 -0400)] 
bash-completion: (lsclocks) add missing --no-discover-dynamic

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (lsblk) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:10:58 +0000 (13:10 -0400)] 
bash-completion: (lsblk) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (losetup) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:10:19 +0000 (13:10 -0400)] 
bash-completion: (losetup) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (hwclock) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 17:09:51 +0000 (13:09 -0400)] 
bash-completion: (hwclock) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (hardlink) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:48:04 +0000 (12:48 -0400)] 
bash-completion: (hardlink) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (getopt) add missing --unknown
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:44:30 +0000 (12:44 -0400)] 
bash-completion: (getopt) add missing --unknown

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (fsck) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:43:29 +0000 (12:43 -0400)] 
bash-completion: (fsck) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (flock) add missing --verbose
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:41:25 +0000 (12:41 -0400)] 
bash-completion: (flock) add missing --verbose

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (findmnt) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:40:58 +0000 (12:40 -0400)] 
bash-completion: (findmnt) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (fincore) add missing --total
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:38:26 +0000 (12:38 -0400)] 
bash-completion: (fincore) add missing --total

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (fallocate) add missing --write-zeroes
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:35:05 +0000 (12:35 -0400)] 
bash-completion: (fallocate) add missing --write-zeroes

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (fadvise) add missing --fd
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:33:57 +0000 (12:33 -0400)] 
bash-completion: (fadvise) add missing --fd

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agofadvise: add --fd to the help output
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:32:59 +0000 (12:32 -0400)] 
fadvise: add --fd to the help output

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (column) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:27:27 +0000 (12:27 -0400)] 
bash-completion: (column) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (cfdisk) add missing --sector-size
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:26:04 +0000 (12:26 -0400)] 
bash-completion: (cfdisk) add missing --sector-size

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (cal) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:24:20 +0000 (12:24 -0400)] 
bash-completion: (cal) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (blockdev) add missing long options
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:17:31 +0000 (12:17 -0400)] 
bash-completion: (blockdev) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (blkid) add missing --hint
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:16:22 +0000 (12:16 -0400)] 
bash-completion: (blkid) add missing --hint

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agobash-completion: (bits) add missing --binary
Christian Goeschel Ndjomouo [Fri, 31 Oct 2025 16:14:38 +0000 (12:14 -0400)] 
bash-completion: (bits) add missing --binary

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
4 weeks agolibfdisk: (dos) fix off-by-one in maximum last sector calculation
Karel Zak [Thu, 30 Oct 2025 11:11:43 +0000 (12:11 +0100)] 
libfdisk: (dos) fix off-by-one in maximum last sector calculation

The get_disk_ranges() function incorrectly capped the last usable
sector at UINT_MAX, which could cause an overflow when calculating
partition size for MBR partition tables.

MBR stores partition size as a 32-bit value with maximum UINT_MAX.
The partition size is calculated as: size = stop - start + 1

For a partition starting at sector 0:
- If stop = UINT_MAX: size = UINT_MAX + 1 (overflow!)
- If stop = UINT_MAX - 1: size = UINT_MAX (correct maximum)

This fixes the inconsistency where dos_init() correctly warns about
disks larger than UINT_MAX sectors (2TiB - 512 bytes for 512-byte
sectors), but get_disk_ranges() allowed creating partitions that
would overflow the 32-bit size field.

Addresses: https://issues.redhat.com/browse/RHEL-122367
Signed-off-by: Karel Zak <kzak@redhat.com>
4 weeks agohwclock: skip RTC_PARAM_SET for --param-set with unchanged value
Bastian Krause [Fri, 24 Oct 2025 15:32:20 +0000 (17:32 +0200)] 
hwclock: skip RTC_PARAM_SET for --param-set with unchanged value

Parameters set with `hwclock --param-set` tend to be persisted in the
RTC's EEPROM. Writing the same value over and over again can wear out
the EEPROM (e.g. on each boot).
So read the current value first. Only if the parameter is changed,
actually write the new value.

This allows for easier integrations, especially since there is no
machine-readable way of retrieving the current value via hwclock.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
4 weeks agoMerge branch 'issuerunfix' of https://github.com/Vogtinator/util-linux
Karel Zak [Wed, 29 Oct 2025 10:57:33 +0000 (11:57 +0100)] 
Merge branch 'issuerunfix' of https://github.com/Vogtinator/util-linux

* 'issuerunfix' of https://github.com/Vogtinator/util-linux:
  agetty: Fix reading /run/issue.d/ again

4 weeks agoMerge branch 'my-master-2' of https://github.com/Leefancy/util-linux
Karel Zak [Wed, 29 Oct 2025 10:57:05 +0000 (11:57 +0100)] 
Merge branch 'my-master-2' of https://github.com/Leefancy/util-linux

* 'my-master-2' of https://github.com/Leefancy/util-linux:
  Fix memory leak issue in read_Subid_range()

4 weeks agoMerge branch 'swapon-fstab-defaults' of https://github.com/zeha/util-linux
Karel Zak [Wed, 29 Oct 2025 10:56:42 +0000 (11:56 +0100)] 
Merge branch 'swapon-fstab-defaults' of https://github.com/zeha/util-linux

* 'swapon-fstab-defaults' of https://github.com/zeha/util-linux:
  swapon: (man page) use "defaults" (plural)

5 weeks agoagetty: Fix reading /run/issue.d/ again
Fabian Vogt [Tue, 28 Oct 2025 10:19:17 +0000 (11:19 +0100)] 
agetty: Fix reading /run/issue.d/ again

Commit 63f7dcb5b072 ("lib/config: Make /run path configurable") added
a second _PATH_SYSCONFDIR instead of _PATH_RUNSTATEDIR. Fix that.

5 weeks agolib/loopdev: avoid null pointer dereferences [coverity]
Karel Zak [Thu, 23 Oct 2025 10:34:08 +0000 (12:34 +0200)] 
lib/loopdev: avoid null pointer dereferences [coverity]

Signed-off-by: Karel Zak <kzak@redhat.com>
5 weeks agoFix memory leak issue in read_Subid_range()
fortunate-lee [Thu, 23 Oct 2025 07:01:31 +0000 (15:01 +0800)] 
Fix memory leak issue in read_Subid_range()

5 weeks agoswapon: (man page) use "defaults" (plural)
Chris Hofstaedtler [Wed, 22 Oct 2025 15:55:33 +0000 (17:55 +0200)] 
swapon: (man page) use "defaults" (plural)

A lot of documentation on the Internet seems to assume "defaults" is the
/correct/ default value when no other options are intended.
Documentation/example.files/fstab does not have an entry for swap, but
it shows "defaults" for other file systems.

It seems prudent to align on a single variant, at least in the
documentation, even if both are accepted by swapon.

Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
5 weeks agoMerge branch 'optstr-test' of https://github.com/crobinso/util-linux
Karel Zak [Wed, 22 Oct 2025 09:25:01 +0000 (11:25 +0200)] 
Merge branch 'optstr-test' of https://github.com/crobinso/util-linux

* 'optstr-test' of https://github.com/crobinso/util-linux:
  tests: optstr: test redundant commas

5 weeks agoMerge branch 'PR/losetup-remove' of https://github.com/karelzak/util-linux-work
Karel Zak [Wed, 22 Oct 2025 09:24:14 +0000 (11:24 +0200)] 
Merge branch 'PR/losetup-remove' of https://github.com/karelzak/util-linux-work

* 'PR/losetup-remove' of https://github.com/karelzak/util-linux-work:
  losetup: improve command line option processing
  lostup: report EACCES on loop-control
  losetup: improve --remove documentation
  losetup: make --remove a long-only option with mutual exclusivity
  lib/loopdev: introduce loopcxt_get_device_nr() helper
  losetup: add error feedback for --remove command

5 weeks agomount: add note about systemd and --all historical context
Karel Zak [Wed, 22 Oct 2025 08:42:36 +0000 (10:42 +0200)] 
mount: add note about systemd and --all historical context

Add information that mount -a was originally designed for init scripts
but many modern systemd-based distributions use systemd units instead
for mounting filesystems on boot in a more sophisticated way.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 weeks agomount: improve --all documentation regarding swap areas
Karel Zak [Wed, 22 Oct 2025 08:36:32 +0000 (10:36 +0200)] 
mount: improve --all documentation regarding swap areas

The --all option description did not mention that swap entries in
fstab are silently ignored. Add a note clarifying this behavior and
pointing users to swapon --all for enabling swap devices and files.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agolosetup: improve command line option processing
Karel Zak [Tue, 21 Oct 2025 09:45:54 +0000 (11:45 +0200)] 
losetup: improve command line option processing

The options --detach, --remove, and --set-capacity are mutually
exclusive. We can assume the device name follows the options, which is
better than assuming the device name is specified as an option's
argument. This also allows the use of the existing mutually-exclusive
check.

 # losetup --remove --detach loop0
 losetup: /dev/--detach: remove failed: Success
 losetup: /dev/loop0: remove failed: Device or resource busy

is ugly.

Reported-by: Benno Schulenberg <bensberg@telfort.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agolostup: report EACCES on loop-control
Karel Zak [Tue, 21 Oct 2025 08:58:36 +0000 (10:58 +0200)] 
lostup: report EACCES on loop-control

Don't start scanning /dev/loop* after a failed access to
/dev/loop-control. It's a waste of time, and the user does not receive
a relevant error message.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agolosetup: improve --remove documentation
Karel Zak [Thu, 16 Oct 2025 10:16:27 +0000 (12:16 +0200)] 
losetup: improve --remove documentation

Rewrite the --remove option description to clearly explain the
difference between --detach and --remove. Add a new LOOP DEVICE
LIFECYCLE section that describes the three stages: creation,
detachment, and removal, with corresponding ioctl names.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agolosetup: make --remove a long-only option with mutual exclusivity
Karel Zak [Thu, 16 Oct 2025 09:56:08 +0000 (11:56 +0200)] 
losetup: make --remove a long-only option with mutual exclusivity

Change --remove from '-R, --remove' to a long-only option '--remove'.
This makes it consistent with other administrative options and adds
mutual exclusivity with other major actions like -d, -D, -a, -c, -f,
-j, -l, and -O.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agolib/loopdev: introduce loopcxt_get_device_nr() helper
Karel Zak [Thu, 16 Oct 2025 09:42:03 +0000 (11:42 +0200)] 
lib/loopdev: introduce loopcxt_get_device_nr() helper

Add a new static helper function loopcxt_get_device_nr() to extract
the loop device number from the device path. This eliminates code
duplication in loopcxt_remove_device() and loopcxt_add_device().

The helper function supports both /dev/loop<N> and /dev/loop/<N>
formats and provides consistent error handling with debug logging.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agolosetup: add error feedback for --remove command
Karel Zak [Thu, 16 Oct 2025 09:22:47 +0000 (11:22 +0200)] 
losetup: add error feedback for --remove command

The remove_loop() function was silently failing without providing
any feedback to the user. This also fixes incorrect indentation
(spaces instead of tabs).

Signed-off-by: Karel Zak <kzak@redhat.com>
Reported-by: Benno Schulenberg <bensberg@telfort.nl>
6 weeks agotests: optstr: test redundant commas
Cole Robinson [Fri, 17 Oct 2025 15:11:38 +0000 (11:11 -0400)] 
tests: optstr: test redundant commas

optstr, used for parsing mount option lists, eats leading,
trailing, and duplicated commas, but I can't find any test coverage
for that behavior.

Amend the existing optstr test to hit all the cases I can think of

Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 weeks agotreewide: use is_dotdir_dirent() helper
Karel Zak [Wed, 15 Oct 2025 13:46:06 +0000 (15:46 +0200)] 
treewide: use is_dotdir_dirent() helper

This simplifies the code by using the is_dotdir_dirent() helper
function instead of manual strcmp() checks for "." and ".." directory
entries across multiple utilities.

Signed-off-by: Karel Zak <kzak@redhat.com>