Commit Graph

86651 Commits

Author SHA1 Message Date
Yu Watanabe
1c867dc71a sd-device: move copy_all_tags() from udev
No functional change, preparation for the next commit.
2026-02-23 05:46:42 +09:00
Yu Watanabe
b65467b647 sd-device: shorten code a bit 2026-02-23 05:46:42 +09:00
Lennart Poettering
3a7486c9fc journalctl: add new varlink GetEntries endpoint (#40650)
journalctl: add new varlink read service to get entries

We already have some varlink support for the journal to perform
some actions like `Rotate`. It would be nice to be able to query
the journal via varlink too so this commit adds a new varlinkctl
based journal service that exposes a single GetEntries() call
to retrieve journal entries. Basic filtering is supported and
we can expand the API as needed.

This is a separate `io.systemd.JournalControl` [1] service from the
existing `io.systemd.Journald` to decouple read and write (thanks
to Lennart for suggesting this).

This also extracts some shared helper so that we do not duplicate
code when generating the json or when adding the filters.

[1] The name mirrors the bootctl->io.systemd.BootControl naming.
2026-02-22 15:14:09 +01:00
Luca Boccassi
05f5156ad1 core: validate ref_uid before checking in AttachProcesses method
ref_uid is initialized to invalid, and is only set in some
circumstances. The AttachProcesses will attempt to check it,
and assert that it is valid. Check beforehand.

Reported as YWH-PGM9780-89

Follow-up for 59857b672c
2026-02-22 15:13:02 +01:00
Michael Vogt
3660f0e7da TODO: dropped todo about journalctl varlink support 2026-02-21 13:02:39 +01:00
Michael Vogt
a109189fab journalctl: add new varlink read service to get entries
We already have some varlink support for the journal to perform
some actions like `Rotate`. It would be nice to be able to query
the journal via varlink too so this commit adds a new varlinkctl
based journal service that exposes a single GetEntries() call
to retrieve journal entries. Basic filtering is supported and
we can expand the API as needed.

This is a separate `io.systemd.JournalControl` [1] service from the
existing `io.systemd.Journald` to decouple read and write (thanks
to Lennart for suggesting this).

This also extracts some shared helper so that we do not duplicate
code when generating the json or when adding the filters.

[1] The name mirrors the bootctl->io.systemd.BootControl naming.
2026-02-21 13:02:38 +01:00
Mike Yuan
bd7ba0a645 parse-argument: make parse_tristate_argument() do something useful (#40652)
Alternative to #37751
2026-02-21 03:10:00 +01:00
Mike Yuan
f04023d35f vmspawn: clean up OVMF secure boot support check a bit
find_ovmf_config() would do filtering based on arg_secure_boot
already, hence the mismatch can only occur if we're using
user-specified firmware. So be explicit about this in log.
2026-02-20 21:21:01 +01:00
Mike Yuan
39a5b957e1 vmspawn: use parse_tristate_argument_with_auto() 2026-02-20 21:21:01 +01:00
Mike Yuan
577e5e9a5e parse-argument: make parse_tristate_argument() do something useful
I expressed the issue I have with parse_tristate_argument()
in #37751: it doesn't add any value to direct use of parse_tristate();
on the contrary, it doesn't support means to reset the arg to "auto"/-1 state.
The mere reason it existed is that we need a int type ret param.

Since the previous attempt to address this mess failed, let's
try to make the function more useful by making it accept "auto".
I figure this is useful on its own.

As requested in
https://github.com/systemd/systemd/pull/40652#discussion_r2831833996,
the function name is suffixed with _with_auto() to establish
that "auto" is handled internally.
2026-02-20 21:20:45 +01:00
Ryan Zeigler
774e805959 Add BNCF NewBook 11 ACCEL_MOUNT_MATRIX to 60-sensor.hwdb
Corrects DE autorotation

Device description: https://www.bncfai.com/product/773/
2026-02-20 19:59:47 +00:00
Yu Watanabe
e17ef43f9d man/report: fix typo
Follow-up for e83cbc9372.
2026-02-21 03:00:51 +09:00
Michael Vogt
8471eca549 machine: switch CleanPool to SD_VARLINK_REQUIRES_MORE
The CleanPool requires --more to be set and checks that in
`vl_method_clean_pool`. By switching to SD_VARLINK_REQUIRES_MORE
this will automatically be handled and is more clear to
the varlink users.

Based on the comment from Lennart in
https://github.com/systemd/systemd/pull/40650#discussion_r2832378002
and the work done by Mike in 09388a6b9e (thanks!).
2026-02-20 18:01:08 +01:00
Luca Boccassi
699007a44f repart: Report correct current disk size and error (#39813) 2026-02-20 17:00:28 +00:00
Antonio Alvarez Feijoo
16e7869cf3 mstack: parse --mkdir option
```
systemd-mstack: unrecognized option '--mkdir'
```

Follow-up for 8187cd18d6
2026-02-20 16:56:16 +01:00
Jim Spentzos
e35b3494e1 po: Translated using Weblate (Greek)
Currently translated at 36.7% (97 of 264 strings)

Co-authored-by: Jim Spentzos <jimspentzos2000@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/el/
Translation: systemd/main
2026-02-20 13:46:43 +00:00
Julian Sparber
f94d3180b0 repart-varlink: Consider only managed parititions for size errors
Report DiskTooSmall only if partitions managed by repart don't fit the
disk. Because if the disk is already full with forigin partitions we
would always report DiskTooSmall instead of InsufficentFreeSpace.
2026-02-20 11:36:35 +01:00
Julian Sparber
9ee029c8f6 repart-varlink: Calculate the size of foreign partitions
To decide whether the disk is to small or has insufficient free space we
need to know how much of the disk is filled with foreign partitions.
The calculated size is used in a future commit.
2026-02-20 11:23:09 +01:00
Julian Sparber
5036c9f596 repart: Sum partitions size to get current disk size instead of using total size
When working on disks the disk may have a total size bigger then the
actual allocated size, therefore sum up the current partitions to
calculate the current disk size instead of asuming that the entire disk
is currently allocated.
2026-02-20 11:19:10 +01:00
Yu Watanabe
c871afd311 Several fixlets for issues found by Coverity (#40765) 2026-02-20 19:13:37 +09:00
Lennart Poettering
b33669da2b systemd-report: show some love (#40735) 2026-02-20 10:21:31 +01:00
Yu Watanabe
ff3b44e780 Various improvements (#40759) 2026-02-20 16:31:38 +09:00
Lennart Poettering
91ad0225e9 update TODO 2026-02-20 08:25:12 +01:00
Lennart Poettering
9277393d7b report: install systemd-report binary to /usr/lib/systemd/ for now
The tool should not be considered stable, and those things we usually
place in /usr/lib/systemd, and not in $PATH.

We can move that to $PATH once we are confident it's gonna stay the way
it is.
2026-02-20 08:25:12 +01:00
Lennart Poettering
f3aff0c20a ci: add proper CI test for systemd-report 2026-02-20 08:25:12 +01:00
Lennart Poettering
cd961ea209 report: use JSON-SEQ when outputing a series of json objects
We do this in our other tools that output a large number of JSON objects
in a potentially streamable way, hence do so here too.
2026-02-20 08:25:12 +01:00
Lennart Poettering
fc5537635d report: fix log level of connection log messages
Let's also rename the "metric_prefix" to "name", because it's actually
the servce name, and by giving it this generic name we can use it
reasonably in log messages.
2026-02-20 08:25:12 +01:00
Lennart Poettering
bbb151da78 report: add --no-legend
Like most of our other tools, add a --no-legend switch.
2026-02-20 08:25:12 +01:00
Lennart Poettering
e83cbc9372 report: implement filtering for metrics 2026-02-20 08:25:12 +01:00
Lennart Poettering
ec2cd403f4 report: tighten rules on metrics names
Let's stay close to Varlink's naming rules and insist that metrics
prefixes must be valid varlink interface names, and suffixes are valid
varlink field names.

The former rule is clear: because a metric <x>.<y> can only be provided
by a varlink service <x>, it is obvious we should validate them the
same way. Validating the suffix via varlink field rules is not that
obvious, but I think it makes sense to stay close to Varlink naming
rules if we already started out at one place.
2026-02-20 08:25:12 +01:00
Lennart Poettering
5617ebb096 report: we don't use inline in .c files, the compiler can figure this out better on its own 2026-02-20 08:25:12 +01:00
Lennart Poettering
442040e716 report: add -j shortcut
json output is going to be used very frequently, hence provide a
shortcut for it, like many our tools do it.
2026-02-20 08:25:12 +01:00
Lennart Poettering
39225c9904 report: also dump metrics in tabular output
JSON output is great, but let's show the metrics by default in a more
human readable fashion.
2026-02-20 08:25:12 +01:00
Lennart Poettering
e1f7f33713 report: add 'list-sources' verb for enumerating metrics sources 2026-02-20 08:25:12 +01:00
Lennart Poettering
0e05a03577 report: split out service enumeration logic
We want to reuse it later to list all services, hence make it generic.

(Also, allow symlinked services too)
2026-02-20 08:23:11 +01:00
Lennart Poettering
5046a12fbc report: switch to "verbs" command line interface, and add 'describe-metrics'
Let's prepare for a future where the "systemd-report" tool can do more
than enumerate metrics: let's introduce our usual "verbs" style
interface.

Let's also add a second command right-away: "describe-metrics" shows the
description of the metrics.
2026-02-20 08:23:11 +01:00
Yu Watanabe
ecf9f81af4 mstack: coding style cleanups 2026-02-20 16:22:00 +09:00
Yu Watanabe
b78db85bca mstack: fix resource leak on failure path
This makes the mstack_load() requires 'ret', as clearing the loaded
mstack without use is meaningless. All callers already pass non-NULL for
the argument.

Follow-up for 8343032a86.
Fixes CID#1645105.
2026-02-20 16:21:48 +09:00
Lennart Poettering
5344bede1e report: adjust indentation to our usual style 2026-02-20 08:15:30 +01:00
Lennart Poettering
b01dfa2c83 report: add comment explaining that metric_startswith_prefix() does a true prefix match 2026-02-20 08:15:30 +01:00
Lennart Poettering
9841786581 metrics: show metrics 'keys' before 'values'
In a way, metrics are a key-value concept, where the key is a triplet of
metrics family name, object name, and "fields". Let's put them together
in the varlink call, and put the value last, separately from that.

Also, update docs a bit, i.e be explicit about the metrics *family* name
everyhwere.
2026-02-20 08:15:29 +01:00
Lennart Poettering
22cc1625e7 format-table: add a new JSON cell type
This formats the specified json variant as a string, and displays it in
a cell.
2026-02-20 08:15:29 +01:00
Lennart Poettering
a98fc72e29 json: add json_variant_compare() helper for comparint two json variants by order 2026-02-20 08:15:29 +01:00
Yu Watanabe
298fc56641 import: fix NULL pointer dereference
Follow-up for a9f6ba0496.
Fixes CID#1645106.
2026-02-20 16:12:36 +09:00
David Santamaría Rogado
be9dd0da40 hwdb: fix typos 2026-02-20 06:38:53 +09:00
Daan De Meyer
0dbdbed03f uid-range: Handle same userns in uid_range_load_userns_by_fd()
If we're asked to look up our own user namespace mapping, don't go
via fd as trying to setns() to our own user namespace in
userns_enter_and_pin() would fail with EPERM as the kernel doesn't
allow switching to your own userns.
2026-02-19 21:33:11 +01:00
Daan De Meyer
d28c96d85e userns-restrict: Remove unused inode argument and rename function 2026-02-19 21:33:11 +01:00
Daan De Meyer
fd99ead01d test-userns-restrict: Migrate to new assertion macros
We also inline the test functions so we get proper line information
in the failure coredumps.
2026-02-19 21:33:11 +01:00
Daan De Meyer
e6be5fb720 ssh-proxy: Support ssh machine/xxx for nspawn containers 2026-02-19 21:32:29 +01:00
David Santamaría Rogado
3b51529cbf hwdb: sensor: hp use board product name as hp-wmi
Doing it made also to include the 14t-fh000, the product name initial
units of the omnibook ultra flip 14 had, this is intended.

Order the entries by product name.

Follow up: fadb0b53f7.
2026-02-20 04:54:53 +09:00