Karel Zak [Thu, 30 May 2024 12:11:38 +0000 (14:11 +0200)]
tests: update lscpu vmware_fpe output
The cpuinfo for vmware_fpe defines two types of CPUs, which differ in
their flags. However, this difference is ignored by lscpu. The latest
version now uses the flags that were defined later.
Karel Zak [Thu, 30 May 2024 11:59:16 +0000 (13:59 +0200)]
lscpu: use CPU types de-duplication
The new CPU type was always allocated when a new relevant value for
the type was found in the cpuinfo file. However, this solution is
fragile because it can result in the parser creating a cputype struct
with incomplete information.
For instance, on ARM systems with multiple CPU types, a new CPU type
would be triggered by a different "CPU part ID". In cases where the
vendor remained the same, a new type would be created later but the
vendor would not be initialized.
The new implementation creates a new CPU type for each CPU (almost)
and then later de-duplicates the array based on vendor, model, etc.
Addresses: https://github.com/util-linux/util-linux/issues/3062 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 28 May 2024 10:32:49 +0000 (12:32 +0200)]
Merge branch 'scriptreplay/add-interactive-playback/2999' of https://github.com/jNullj/util-linux
* 'scriptreplay/add-interactive-playback/2999' of https://github.com/jNullj/util-linux:
format: fix switch case indent
fix clang compile
replace fgetwc with fgetc
format: fix comments and if braces format
format: CamelCase to SnakeCase
Refactor convoluted switch case into if else
fix formatting and add mising break
Add missing author
Add interactive playback docs
Add right arrow key to step forward in playback
Remove uneeded veriable
Add support for adjusting replay speed with arrow keys
Refactor to handle responsive input
Add pause functionality to replay
Refactor delay_for function signature to use const struct timeval
Set stdin to nonblock
Karel Zak [Mon, 27 May 2024 09:51:46 +0000 (11:51 +0200)]
Merge branch 'fix-unnecessary-remake' of https://github.com/ChenQi1989/util-linux
* 'fix-unnecessary-remake' of https://github.com/ChenQi1989/util-linux:
libsmartcols/src/Makemodule.am: ensure filter-scanner/paser.c file is newer than the .h file
Karel Zak [Mon, 27 May 2024 09:48:49 +0000 (11:48 +0200)]
Merge branch 'PR/cal-fix-weeknumber-colors' of github.com:karelzak/util-linux-work
* 'PR/cal-fix-weeknumber-colors' of github.com:karelzak/util-linux-work:
tests: add color schema to cal(1) tests
cal: colorize --vertical output.
cal: properly colorize the week number in vertical output.
cal: fix --week use and colors
Karel Zak [Mon, 27 May 2024 09:48:13 +0000 (11:48 +0200)]
Merge branch 'PR/libmount-errmsg' of github.com:karelzak/util-linux-work
* 'PR/libmount-errmsg' of github.com:karelzak/util-linux-work:
libmount: (loop) detect and report lost loop nodes
libmount: add mnt_context_sprintf_errmsg()
libmount: add functions to use error buffer
libmount: use regular function to save/reset syscalls status
Chen Qi [Sat, 25 May 2024 03:41:35 +0000 (11:41 +0800)]
libsmartcols/src/Makemodule.am: ensure filter-scanner/paser.c file is newer than the .h file
In released tarball, for filter-scanner/parser, the .h and the .c
file has the same mtime. The 'make' tool thinks .h is newer than
the .c file, thus deciding to remake it. This will not only cause
unnecessary rebuild, but also parallel make error. For example,
after 'make', when running 'make install', the libmount.la and findmnt
are both rebuilt and findmnt building will somethings error out complaining
'libmount.so: no such file or directory' or 'libmount.so: file format
not recognized'.
Touch the generated .c file to ensure it's newer than the .h file.
In this way, in new released tarballs in the future, there will
be no unnecessary remake.
jNullj [Fri, 24 May 2024 19:23:48 +0000 (22:23 +0300)]
replace fgetwc with fgetc
there is no real reason to use fgetwc here as arrow key press is not read as a multi-byte by fgetwc and the logic implemented here also reads the keypress byte by bytes.
Karel Zak [Wed, 22 May 2024 10:14:43 +0000 (12:14 +0200)]
Merge branch 'libuuid/coverity' of https://github.com/t-8ch/util-linux
* 'libuuid/coverity' of https://github.com/t-8ch/util-linux:
libuuid: construct UUIDv7 without "struct uuid"
libuuid: construct UUIDv6 without "struct uuid"
libuuid: add helper to set version and variant in uuid_t
Karel Zak [Wed, 22 May 2024 10:12:34 +0000 (12:12 +0200)]
Merge branch 'libuuid/fork' of https://github.com/t-8ch/util-linux
* 'libuuid/fork' of https://github.com/t-8ch/util-linux:
libuuid: clear uuidd cache on fork()
libuuid: split uuidd cache into dedicated struct
libuuid: drop check for HAVE_TLS
Karel Zak [Wed, 22 May 2024 08:52:04 +0000 (10:52 +0200)]
libmount: add functions to use error buffer
* Add mnt_context_set_errmsg() and mnt_context_append_errmsg() functions.
* Replace custom code with mnt_context_syscall_save_status() function.
* Optionally use syscall name when generating error message.
Karel Zak [Mon, 20 May 2024 13:07:24 +0000 (15:07 +0200)]
cal: fix --week use and colors
* don't overwrite --week=<number> by the current date, default only
to the current year, if the year is not specified
* introduce "weeks" color sequence to colorize all week numbers.
Note that the man page suggests using "weeknumber" to colorize all
week numbers, but the code only uses this sequence for the week
requested by the --week option. This commit maintains backward
compatibility, although it would be better to use "weeknumber" for all
week numbers and "weekwanted" for the desired week.
Nicholas Vinson [Wed, 15 May 2024 15:14:54 +0000 (11:14 -0400)]
Conditionally add uuid_time64 to sym. version map
The symbol uuid_time64 is conditionally defined. It only exists on
32-bit platforms that use the glibc library and enable support for
the 64-bit time_t type.
For all other platforms, the symbol is undefined. As a result, when
ld.lld version 17 or newer is used with default flags, ld.lld will
reject the symbol map with the error:
version script assignment of 'UUID_2.40' to symbol 'uuid_time64'
failed: symbol not defined
To fix this issue, the reference to uuid_time64 is changed to
uuid_time64*. The change to a glob pattern satisifies ld.lld and allows
the library to link.
sys-utils/setarch.c:106:7: error: 'PER_LINUX32_3GB' undeclared here (not in a function); did you mean 'PER_LINUX32'?
106 | X(PER_LINUX32_3GB) \
| ^~~~~~~~~~~~~~~
After fork() the memory of the calling thread is preserved into the new
process. This also includes TLS.
Make sure to reset the cache after a fork to avoid reuse of cached
values.
Only the TLS of the thread calling fork() is relevant as that is the
only thread that gets forked.
New threads will received newly initialized TLS.
Fixes https://github.com/util-linux/util-linux/issues/3009 Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
Karel Zak [Tue, 14 May 2024 09:58:20 +0000 (11:58 +0200)]
libmount: Fix atime remount for new API
All atime settings are mutually exclusive, and the attr_set mask for
the mount_setattr() syscall cannot contain multiple MOUNT_ATTR_ atime
related options.
Unfortunately, during a remount, the list of options is composed of
both old and new options. In this case, libmount sets more atime
options to the mask. The correct behavior is to use the last atime
related option from the list.
Fixes: https://github.com/util-linux/util-linux/issues/3032 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 14 May 2024 08:01:47 +0000 (10:01 +0200)]
Merge branch 'uuidv7' of https://github.com/t-8ch/util-linux
* 'uuidv7' of https://github.com/t-8ch/util-linux:
uuidgen: add support for RFC9562 UUIDs
uuidparse: add support for RFC9562 UUIDs
libuuid: add support for RFC9562 UUIDs
Based on https://github.com/util-linux/util-linux/pull/3018
The syscall numbers should not be hardcoded in the header file. If we
really need them, there is UL_CHECK_SYSCALL() to define the numbers
for different architectures. I doubt it's really necessary. Just
update your kernel header files to get the latest kernel updates ...
Karel Zak [Mon, 13 May 2024 07:58:21 +0000 (09:58 +0200)]
Merge branch 'meson-fix-Python.h-check' of https://github.com/jwillikers/util-linux
* 'meson-fix-Python.h-check' of https://github.com/jwillikers/util-linux:
meson: Correctly require the Python.h header for the python dependency
meson: Only require Python module when building pylibmount
meson: Fix build-python option
Karel Zak [Mon, 13 May 2024 06:42:06 +0000 (08:42 +0200)]
Merge branch 'lsns--refactor-related-to-2987' of https://github.com/masatake/util-linux
* 'lsns--refactor-related-to-2987' of https://github.com/masatake/util-linux:
lsns: (refactor) use ls_path_{openf|statf} to make the code simple
lib/path: add ul_path_statf() and ul_path_vstatf()
lsns: verify the uniqueness of a namespace in ls->namespaces list
lsns: (refactor) make the function names for reading namespaces consistent
lsns: (refactor) rename read_related_namespaces to connect_namespaces
lsns: (refactor) rename get_ns_ino() to get_ns_inos()
lsns: (refactor) use get_{parent|owner}_ns_ino() in add_namespace_for_nsfd
lsns: (refactor) add get_{parent|owner}_ns_ino() implementing some parts of get_ns_ino()
lsns: (refactor) give a enumeration name 'lsns_type' to LSNS_TYPE_ enumerators
lsns: (refactor) rename LSNS_ID_.* to LSNS_TYPE_.*
Jordan Williams [Tue, 7 May 2024 14:40:44 +0000 (09:40 -0500)]
meson: Correctly require the Python.h header for the python dependency
The current solution to require the Python.h header works around a bug
in Meson that has been fixed for version 1.4.1 of Meson.
Refer to https://github.com/mesonbuild/meson/issues/12862.
This change uses an explicit check for the Python.h include.
This verifies the required header exists.
This check is only necessary prior to version 1.4.1 of Meson.
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
Jordan Williams [Thu, 9 May 2024 21:46:58 +0000 (16:46 -0500)]
meson: Only require Python module when building pylibmount
Only the python executable is required for tests.
Version 1.4.1 of Meson will require the Python.h for find_installation.
This will result in the tests requiring Python.h unnecessarily.
Use find_program to find the Python program for the tests instead.
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
Jordan Williams [Thu, 9 May 2024 20:57:12 +0000 (15:57 -0500)]
meson: Fix build-python option
The build-python option is for controlling whether or not pylibmount is
built.
Unfortunately, commit b6799cc rendered the option unused.
This change uses the build-python option again.
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
All the existing tests are also done with --fcntl in effect, and then
we add one more test, namely that a flock(2) lock can be be obtained
even while a fcntl(2) lock is held - not that anyone should ever need
that, but it does show that the lock types are completely independent.