1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00
Commit Graph

65654 Commits

Author SHA1 Message Date
Lennart Poettering
0f85a0d38f update TODO 2023-06-12 23:00:47 +02:00
Lennart Poettering
6050e8b550 resolvectl: add resolvectl command for dumping cache contents
A wrapper around the new varlink call, showing the data either in its
native JSON or in a more human readable textual form.
2023-06-12 22:21:26 +02:00
Lennart Poettering
25165c1dea resolved: add DNS_RESOURCE_KEY_TO_STRING() macro helper
This does the usual compound init trick to get formatted strings of
stuff.

We should probably port various pieces of code over to using this.
2023-06-12 22:21:26 +02:00
Lennart Poettering
ce74fb0905 resolved: add dns_resource_key_from_json() helper
It reverse what dns_resource_key_to_json(), i.e. turns JSON data into a
parsed DnsResourceKey object.

Ultimately this just moves a client-side local wrapper into generic
code. Nothing truly new here.
2023-06-12 22:21:26 +02:00
Lennart Poettering
e0930aa6ff resolved: add DumpCache varlink call for acquiring a complete dump of all of resolved's RR caches
This adds a simple varlink call io.systemd.Resolve.Monitor.DumpCache to
the existing io.systemd.Resolve.Monitor service. It compiles a JSON
object containing the per-scope cache entries and returns it.

Replaces: #20053 #19104

Fixes: #14796
2023-06-12 22:21:26 +02:00
Jan Janssen
b4eb2de7e3 boot: Unify protocol opening
We are using HandleProtocol everywhere except in these few cases. This
unifies on HandleProtocol as it is simpler to use and equivalent to
OpenProtocol.

The only difference between the two is that OpenProtocol attributes the
opened protocol to a firmware-owned handle instead of our image handle.
This has no real use for regular UEFI applications as any protocols
opened via BY_HANDLE or GET_PROTOCOL is not required to be closed. In
fact, when a protocol is uninstalled it will do nothing more than reduce
the open count for these.
2023-06-12 21:12:11 +01:00
Lennart Poettering
6b9f63cb3f json: add json_dispatch_variant_noref() helper
This is identical to json_dispatch_variant() but doesn't increase the
ref counter of the variant. This is useful for taking JSON objects apart
locally without the intention to keep any component pinned for longer
than the local stack frame.
2023-06-12 18:26:08 +02:00
Lennart Poettering
2efddcb245 man: explain timesyncd epoch mtime touch files in a bit more detail
Let's mention what /usr/lib/clock-epoch precisely does, and underline we
only *advance* the time based on it.

Inspired by Darkdragon-001's #23214.

Replaces #23214
2023-06-12 14:29:25 +01:00
Lennart Poettering
2d5d4f2f3e
Merge pull request #27989 from poettering/message-append-string-set
common helpers for serializing Set of strings into bus message
2023-06-12 14:12:05 +02:00
Lennart Poettering
fefefcd573 bus-util: add bus_property_get_string_set() helper
This is a common implementation of a property getter for a Set of
strings.
2023-06-12 11:35:52 +02:00
Lennart Poettering
9298af8dd3 bus-util: add bus_message_append_string_set() helper
This new helper adds all strings from a Set object as a string array to
a message.

Various places where we have similar code are then ported over to this.
2023-06-12 11:34:26 +02:00
Zbigniew Jędrzejewski-Szmek
b09a5315f5 ukify: move verb mangling to finalize_options()
This simplifies the logic: finalize_options() is the step that does the
checks and the mangling. The checks for consistency are done in more places,
so we need to pass a verb (we only have 'build', but once we add other verbs,
any would do).
2023-06-12 11:12:02 +02:00
Zbigniew Jędrzejewski-Szmek
9a1cb2038e ukify: split out iteration over phase path groups and keys
In preparation for future changes.
2023-06-12 11:12:02 +02:00
Zbigniew Jędrzejewski-Szmek
24f4ff8a09 man,test: root or hardware is not needed for ukify 2023-06-12 11:12:02 +02:00
Zbigniew Jędrzejewski-Szmek
794385f5df ukify: fix synopsis in --help
Missed in a3b227d28a.
2023-06-12 11:12:02 +02:00
Zbigniew Jędrzejewski-Szmek
6fa7913830 ukify: use pager for --help
The output is now too long to fit on one page, let's use a pager automatically
like in other places.

The implementation is copied from mkosi, but adjusted to follow what other
systemd tools do.
2023-06-12 11:12:02 +02:00
Yu Watanabe
80dc9ad98c meson: bump required version to 0.56.0 2023-06-12 11:01:58 +02:00
Yu Watanabe
573c0dc134 meson: bump required version to 0.55.0 2023-06-12 11:01:58 +02:00
Yu Watanabe
daf4e78e48 meson: bump required version to 0.54.0 2023-06-12 11:01:58 +02:00
Zbigniew Jędrzejewski-Szmek
78103450b4 meson: define _GNU_SOURCE as '1'
This changes the generated config.h file thusly:
-#define _GNU_SOURCE
+#define _GNU_SOURCE 1

Canonically, _GNU_SOURCE is just defined, without any value, but g++ defines
_GNU_SOURCE implicitly [1]. This causes a warning about a redefinition during
complilation of C++ programs after '-include config.h'. Our config attempts to
inject this (and a bunch of other arguments) into all compliations. But before
meson 0.54, flags for dependencies were not propagated correctly (*), and the C++
compilation was done without various flags (**). Once that was fixed, we started
getting a warning.

[1] http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.predefined
(*) Actually, the changelog doesn't say anything. But it mentions various work
    related to dependency propagation, and apparently this changes as a side
    effect.
(**) -fno-strict-aliasing
    -fstrict-flex-arrays=1
    -fvisibility=hidden
    -fno-omit-frame-pointer
    -include config.h

This could be solved in various ways, but it'd require either making the
compilation command line longer, which we want to avoid for readability of the
build logs, or splitting the logic to define the args for C++ progs separately,
which would make our meson.build files more complicated. Changing the
definition to '1' also solves the issue (because apparently now we match the
implicit definition), and shouldn't have other effects. I checked compilation
with gcc and clang. Maybe on other systems this could cause problems. We can
revisit if people report issues.
2023-06-12 10:59:45 +02:00
Yu Watanabe
2824385c4e test: drop test for IFLA_NUM_RX_QUEUES
The attribute is not included in the netlink message if the kernel
built with CONFIG_RPS disabled.

Fixes #27969.
2023-06-12 09:37:11 +02:00
Luca Boccassi
d30d9bf0ac meson: add systemd.pc and udev.pc to 'devel' target/tag
Same as the other pkg-config files, it is useful to install these in a specific
target that doesn't require compiling anything
2023-06-12 14:45:42 +09:00
Frantisek Sumsal
581427bd65 test: make coverage runs happy again 2023-06-11 12:29:59 +01:00
Yu Watanabe
628d56bcf6
Merge pull request #27980 from bluca/tests
add unit tests for *DirectorySymlink= and deserialize_strv helper
2023-06-10 17:46:10 +09:00
Lennart Poettering
fcc0668282 execute: fix minor type confusion
The .gl_pathc field is size_t, hence count in size_t too, to not
accidentally drop 32 of 64bits on the floor.
2023-06-10 15:12:40 +09:00
Benjamin Raison
4fd7c712dc hwdb: fix arrow keys on HP Elite Dragonfly G3 2023-06-10 15:05:27 +09:00
Mike Yuan
13119207da battery-util: debug log when we're unsure about the battery level 2023-06-09 22:00:34 +02:00
Luca Boccassi
3397a14327 man: 'flag' parameter in portable1 spec is now used
It has been used for a while, and it is described fully a couple of
paragraphs below, but this snippet was not deleted.
2023-06-09 21:59:51 +02:00
Nick Rosbrook
c5ea147104 tree-wide: fix typos of "boottime"/"BOOTTIME" 2023-06-09 21:59:36 +02:00
Luca Boccassi
1d6f1e2fa1 serialize: add deserialize_strv helper 2023-06-09 00:49:19 +01:00
Luca Boccassi
71588cb6ad test-execute: add unit tests for *DirectorySymlink= 2023-06-08 23:11:42 +01:00
Lennart Poettering
986a514bab xdg-autostart-generator: extend start timeout
The current start + stop timeouts for xdg autostart files are *very*
short with 5s. On a busy system this might be too easy to hit even in
unintended case.

Apparently, the intention here was to cut the shutdown logic short.
(https://github.com/systemd/systemd/issues/27919#issuecomment-1580576178)
Let's hence stick to the very short timeout for that (under the
assumption that apps are written in a safe enough style to not lose data
if killed too early). But for starting XGD autostrat services, use our
regular timeouts.

See: #27919
2023-06-08 22:52:42 +01:00
Jan Janssen
7da9db535c boot: Fix memory leak 2023-06-08 20:41:16 +01:00
Luca Boccassi
4021e9e3e9
Merge pull request #26059 from DaanDeMeyer/cred-glob
creds: Add ImportCredential=
2023-06-08 20:40:37 +01:00
Luca Boccassi
d45ed5bf25
Merge pull request #26848 from yuwata/kernel-install
kernel-install: rewrite in C
2023-06-08 20:23:10 +01:00
Alfred Klomp
a2160ba061 integritysetup: support mode=(journal|bitmap|direct)
Add a parameter to the integritytab file to set the mode in which to
open the integrity volume. The mode can be journaled (the default),
bitmap without a journal, or direct mode without a journal or a bitmap.

This change removes the `no-journal' option because it is redundant,
being replaced with `mode=direct'.

Supercedes commit bcc1ee56c, from a week ago, which implemented
`no-journal'.

Resolves #27587
2023-06-08 20:21:59 +01:00
Philip Withnall
e6d712430b man/os-release: Add VENDOR_NAME= and VENDOR_URL= keys to os-release
These will be used in UIs to refer to the company or organization which
produces the OS separately from referring to the OS itself.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #27777
2023-06-08 18:54:56 +01:00
Lennart Poettering
3122f4d752 man: document that "systemctl mask" doesn't work for units whose file is in /etc
Fixes: #27965
2023-06-08 18:53:01 +01:00
Luca Boccassi
ccc14f0812
Merge pull request #27712 from ddstreet/tpm2_simplify_srk
Tpm2 simplify srk
2023-06-08 18:52:31 +01:00
Mike Yuan
2221aaff0f ac-power: fix a typo 2023-06-08 16:44:15 +02:00
Lennart Poettering
dbbf0618d0 man: reference naming of triggered services of timer unit
Fixes: #27116
2023-06-08 14:54:30 +02:00
Lennart Poettering
e6cac8b540
Merge pull request #27968 from poettering/may-gc-tweaks
pid1: some minor GC logic tweaks
2023-06-08 14:54:09 +02:00
Mike Yuan
842248b05e
Merge pull request #27961 from poettering/journalctl-user-unit-man-fix
journalctl: fix --user when invoked by system users
2023-06-08 20:19:07 +08:00
Daan De Meyer
1ab6ae1957 units: Use ImportCredential= where applicable 2023-06-08 14:09:36 +02:00
Daan De Meyer
bbfb25f4b9 creds: Add ImportCredential=
ImportCredential= takes a credential name and searches for a matching
credential in all the credential stores we know about it. It supports
globs which are expanded so that all matching credentials are loaded.
2023-06-08 14:09:18 +02:00
Dan Streetman
f4f5b3a9de tpm2: add tpm2_get_legacy_template() and tpm2_get_srk_template()
Add functions to get either the 'legacy' or standard SRK template, for RSA or
ECC. The 'legacy' templates are those used with earlier code, where a transient
key was created to use for tpm sealing; the standard SRK is the persistent
shared key as defined in TCG guidance docs.

This also replaces tpm2_get_primary_template() with the new functions; that
function's use of flags is confusing and unnecessary.
2023-06-08 06:08:04 -04:00
Dan Streetman
98d6a80942 tpm2: add tpm2_read_public() 2023-06-08 06:08:04 -04:00
Dan Streetman
c8a8524031 tpm2: add tpm2_get_capability_handle(), tpm2_esys_handle_from_tpm_handle()
Add tpm2_get_capability_handle() to query if a "TPM handle" (meaning, a
location/address in TPM storage) is populated in the TPM, and
tpm2_get_capability_handles() to query for a specific number of handles.

Add tpm2_esys_handle_from_tpm_handle() to create an "esys handle" (an opaque
reference for use with the TPM EAPI that represents a TPM handle address) for an
existing TPM handle.

Since the TPM handle already exists in the TPM, this also also requires
updating the cleanup code for Tpm2Handle objects to close the object (free its
resources only from the EAPI code, but leave the handle in the TPM) instead of
flush the object (which frees its EAPI resources and removes it from the TPM).
2023-06-08 06:08:03 -04:00
Daan De Meyer
96df2bd84b execute: Make credential_search_path() more flexible
Let's also allow looking up only the encrypted credential search
path.
2023-06-08 11:45:24 +02:00
Lennart Poettering
af05bb9717 core: do not GC units/jobs that are in the D-Bus queue
Let's make sure that D-Bus messages are always sent out when pending,
before we might GC a unit/job.

This is kinda a follow-up for 8db998981a,
and a similar logic really applies: GC should only be done if we
processed everything else, generated evertyhing else and really don't
need it anymore.
2023-06-08 11:16:26 +02:00