Daan De Meyer [Sat, 11 May 2024 14:42:24 +0000 (16:42 +0200)]
debug-generator: Allow specifying name of unit-dropin credential
A fixed name is too rigid, let's give users the ability to define
custom drop-in names which at the same time also allows defining
multiple dropins per unit.
We use ~ as the separator because:
- ':' is not allowed in credential names
- '=' is used to separate credential from value in mkosi's --credential
argument.
- '-' is commonly used in filenames
- '@' already has meaning as the unit template specifier which might be
confusing when adding dropins for template units
Yu Watanabe [Fri, 10 May 2024 11:38:06 +0000 (20:38 +0900)]
test-network: check existence of kernel bug
This adds checks for the kernel bug caused by
https://github.com/torvalds/linux/commit/3ddc2231c8108302a8229d3c5849ee792a63230d,
it will be fixed by
https://patchwork.kernel.org/project/netdevbpf/patch/20240510072932.2678952-1-edumazet@google.com/
Yu Watanabe [Fri, 10 May 2024 05:21:10 +0000 (14:21 +0900)]
test: wait for network interface reconfigured after updating config
Otherwise, at this stage, the interface may be in e.g. initialized or
pending state, and the drop-in file introduced by the previous command
may not be registered to the state file for the interface.
Yu Watanabe [Fri, 10 May 2024 03:49:50 +0000 (12:49 +0900)]
network/dhcp4: do not set gateway if DNS server or friends is in the acquired prefix
Previously, even if a DNS server is in the acquired prefix, the route to the
server might have gateway address.
This makes the prefix route, which is always configured, is also handled
as same as static routes, and do not use any gateway if the prefix route
is the most suitable route to access the destination.
The same change is also applied to route to NTP servers and semi-static
routes.
logs-show: flush matches before and after finding boots
Otherwise, if several matches already set, then the first seek to head
or tail may move the cursor to an invalid place, hence they provide
wrong ID(s). Also, reading journal after calling these function may
provide unexpected data.
Currently, the caller does not install any matches before calling the
functions, and does not read any journal entry after journal_get_boots()
succeeds or journal_find_boot_by_offset() succeeds with 0. Hence, this
should not change any behavior. Just for safety.
journalctl: several cleanups for parse_boot_descriptor()
- rename to parse_id_descriptor(), to make it usable for other kind of
ID later.
- add missing assertions,
- prefix arguments for storing results with 'ret_',
- drop unnecessary 'else'.
shell-completion: on zsh, systemd-cat is a precommand
_precommand lets zsh complete other commands and their arguments
e.g. it can complete grep with "systemd-cat gr" and complete grep options
with "systemd-cat grep -"
This cleans up the code a bit. Also, before this commit,
if MemoryAvailable is set but show_memory_available
is false, and we have nothing else to output, empty
parenthesis is shown. This can be easily reproduced
on -.slice:
Colin Watson [Wed, 8 May 2024 14:01:01 +0000 (15:01 +0100)]
docs,man: Avoid some ambiguous uses of "may not"
Like much English text, the systemd documentation uses "may not" in the
sense of both "will possibly not" and "is forbidden to". In many cases
this is OK because the context makes it clear, but in others I felt it
was possible to read the "is forbidden to" sense by mistake: in
particular, I tripped over "the target file may not exist" in
systemd.unit(5) before realizing the correct interpretation.
Use "might not" or "may choose not to" in these cases to make it clear
which sense we mean.
hwdb: Add a Logitech MX Master 3S (connected via Bolt Receiver)
The mouse technically has settable DPI between 200 and 8000, with a step of
50, but 1000 DPI is the default setting.
And if someone customizes the mouse DPI setting they can make a custom hwdb
rule too.
Daan De Meyer [Wed, 8 May 2024 09:44:28 +0000 (11:44 +0200)]
TEST-04-JOURNAL: Sleep more in delegated cgroup filtering script
We already changed logs-filtering.service to sleep 2 seconds before
exiting to combat flakyness, let's do the same for the delegated
cgroup filtering payload.
tree-wide: add dlopen ELF notes to all dlopen() deps of ours
Use 'recommended' priority for the default compression library, to
indicate that it should be prioritized over the other ones, as it
will be used to compress journals/core files.
Also use 'recommended' for kmod, as systems will likely fail to boot
if it's missing from the initrd.
Use 'suggested' for everything else.
There is one dlopen'ed TPM library that has the name generated
at runtime (depending on the driver), so that cannot be added, as it
needs to be known at build time.
Also when we support multiple ABI versions list them all, as for the
same reason we cannot know which one will be used at build time.
dlfcn: add macro for exporting dlopen() module names in ELF sections
This allows code to declare "weak" dlopen() style deps via an ELF
section following the just added specification.
The idea is that any user of dlopen() will place ELF_NOTE_DLOPEN(…)
somewhere close which will synthesize the note.
Tools such as rpm/dpkg package builders as well as initrd generators
(such as dracut) can then automatically pick up these weak deps of
suggested dependencies for their purposes.
Luca Boccassi [Sun, 5 May 2024 15:45:21 +0000 (16:45 +0100)]
docs: add specification for ELF dlopen metadata
Tool to parse it and to use it for Debian packaging available at
https://github.com/systemd/package-notes
Add 3 levels of priority like Debian does, but using terminology
from RPM as it seems more apt.
We will very likely never use 'required', as we use this functionality
for optional features, but it is worth having it in the spec nonetheless
as we want it to be generalized.
Daan De Meyer [Wed, 8 May 2024 09:35:21 +0000 (11:35 +0200)]
tmpfiles: Don't fail if file does not exist in item_do()
If the file was removed by some other program, we should just go
to the next one without failing. item_do() is only used for recursive
globs instead of fixed paths so skipping on missing files makes sense
(unlike if the path was fixed where we should probably fail).
Daan De Meyer [Wed, 8 May 2024 09:21:42 +0000 (11:21 +0200)]
TEST-74-AUX-UTILS: Make more robust
Let's run mkfs on the file we create instead of the loop device and
let's use udevadm wait --settle to wait for udev to settle before
doing anything with the loop device
Sam Leonard [Wed, 24 Apr 2024 17:08:13 +0000 (18:08 +0100)]
machined: add GetMachineSSHInfo method
Also adds three properties:
- VsockCid: the VSOCK CID of the VM
- SshAddress: the address of the VM in a format SSH can connect to
- SshPrivateKeyPath: the path to the SSH private key to use to connect
to the VM.
GetMachineSSHInfo is essentially a convenience method to query both the
SshAddress and SshPrivateKeyPath properties at once.