Commit graph

65025 commits

Author SHA1 Message Date
Times-Z 505c501c67 hwdb: add support for Elgato Stream Deck mini (gen 2) 2023-06-01 02:36:49 +09:00
Zbigniew Jędrzejewski-Szmek bec89355c5 units: pull in local-fs-pre.target from systemd-tmpfiles-setup-dev.service
local-fs-pre.target is a passive unit, which means that it is supposed to be
pulled in by everything that is ordered before it. We had
Before=local-fs-pre.target, so add Wants= too.

I don't expect this to change anything. Instead, just make things follow the
docs so it's easier to reason about the dependency set.
2023-05-31 15:44:44 +02:00
Lennart Poettering 38c86ce329
Merge pull request #27861 from poettering/find-esp-tweaks
minor tweaks to find-esp.c
2023-05-31 15:42:05 +02:00
Daan De Meyer edabe6fc11
Merge pull request #27806 from DaanDeMeyer/fix-mkosi-check
mkosi: Use proper check to detect whether we're in a VM
2023-05-31 15:26:05 +02:00
Daan De Meyer 2533fdd0fb
Merge pull request #27766 from rphibel/cleanup-cgroups-before-cleaning-units
Don't GC unit if it is in cgroup_empty_queue
2023-05-31 14:48:42 +02:00
Daan De Meyer 05d1cbb33c
Merge pull request #26969 from DaanDeMeyer/xopenat-label
fs-util: Add labelling support to xopenat()
2023-05-31 14:35:50 +02:00
Daan De Meyer df4835c897 mkosi: Check for failures by mounting again
We rely on vsock to communicate the exit status back to us from the
VM but vsock in Github Actions is broken so let's switch back to
mounting for now.
2023-05-31 14:22:58 +02:00
Daan De Meyer 84c7929cd4 mkosi: Don't fail on systemd-vconsole-setup.service failure for now
Let's make CI green again and dig into this failure later
2023-05-31 14:22:48 +02:00
Daan De Meyer e167a8283d mkosi: Disable cmdline addon test for now
This fails but we didn't notice until now because error reporting
from the mkosi VM was broken. Let's disable it for now to get CI
green again.
2023-05-31 14:19:25 +02:00
Daan De Meyer 4dfb458f42 mkosi: Use proper check to detect whether we're in a VM 2023-05-31 14:19:25 +02:00
Daan De Meyer fdeed78a71 mkosi: Blacklist vmw_vmci to avoid issues with vsock in Github Actions
If this module is loaded, sending readiness notifications from the
VM will fail with "no route to host" so let's blacklist the module
to prevent that from happening.
2023-05-31 14:19:25 +02:00
Daan De Meyer 86605eed9a mkosi: Enforce usage of vsock with qemu in CI 2023-05-31 14:19:25 +02:00
Daan De Meyer 401027075a mkosi: Update to latest 2023-05-31 14:19:25 +02:00
Daan De Meyer 5fbcad01c1 sd-daemon: Add debug logging 2023-05-31 14:19:25 +02:00
Daan De Meyer bdee762b8c sd-daemon: Introduce pid_notify_with_fds_internal()
No change in behavior, just refactoring
2023-05-31 14:19:25 +02:00
Daan De Meyer a0807bdc23 sysv-generator-test: Bump log level to info
Otherwise, non-fatal debug error logs might interfere with the test.
2023-05-31 14:19:25 +02:00
Lennart Poettering cbf21d1432
Merge pull request #27860 from poettering/loopback-no-prefix-route
loopback-setup: only create a single loopback route when configuring 'lo'
2023-05-31 14:03:04 +02:00
Daan De Meyer 420d2e3136 fs-util: Add XOpenFlags with XO_LABEL flag to have xopenat() MAC label files/dirs 2023-05-31 13:15:56 +02:00
Daan De Meyer a452c807a4 label: Introduce LabelOps to do pre/post labelling operations
By default, label_ops is initialized with a NULL pointer which translates
to noop labelling operations. In mac_selinux_init() and the new mac_smack_init(),
we initialize label_ops with a MAC specific LabelOps pointer.

We also introduce mac_init() to initialize any configured MACs and replace all
usages of mac_selinux_init() with mac_init().
2023-05-31 13:15:53 +02:00
Luca Boccassi 2e6606aaca
Merge pull request #27848 from keszybz/man-page-fixes
Man page fixes
2023-05-31 11:13:51 +01:00
Luca Boccassi 840d3b1522
Merge pull request #27858 from mrc0mmand/followups
Use structured initialization in two more places
2023-05-31 11:09:53 +01:00
Luca Boccassi 1a7e5c51dc
Merge pull request #27853 from keszybz/various-bits-and-pieces-included-to-reuse-the-ci-run
Various bits and pieces included to reuse the ci run
2023-05-31 11:08:36 +01:00
Luca Boccassi 5aab673dd1
Merge pull request #27840 from mrc0mmand/gcc-13
ci: add gcc-13, drop gcc-12
2023-05-31 11:07:22 +01:00
Luca Boccassi 29084afd91
Merge pull request #27519 from yuwata/journalctl-fixes
journalctl: several fixes and cleanups for --follow
2023-05-31 11:05:54 +01:00
Luca Boccassi 23f315dc08
Merge pull request #27835 from keszybz/test-58-repart-modernization
Cleanup/simplifications for TEST-58-repart
2023-05-31 11:00:18 +01:00
Zbigniew Jędrzejewski-Szmek 088d8c99fe test-fstab-generator: fix test on systemd with systemd-boot
(… or other boot loaders implementing the Boot Loader Interface.)

Fixes #27857.
2023-05-31 10:59:50 +01:00
Lennart Poettering f734b2cc66 test-loopback: run test in network + user namespace
This way it can actually do useful testing even when unprivileged.
2023-05-31 11:11:45 +02:00
Lennart Poettering 53d883d30d loopback-setup: clean up logging
All users of loopback_setup() ignore the return values (with the notable
exception of the test cases). Hence let's adjust the log messaging to
always log at LOG_WARNING level at most, and suffix messages with ",
ignoring", to make clear these failures are ignored.
2023-05-31 11:11:45 +02:00
Lennart Poettering 8557425aaf loopback-setup: set IFA_F_NOPREFIXROUTE when configuring 'lo' ipv6 address
Otherwise the kernel will set up two routes to ::1, one in the "main",
and one in the "local" routing table.

Fixes: #25819
2023-05-31 11:11:45 +02:00
Lennart Poettering 14e5c99236 find-esp: drop some redundant 'else' 2023-05-31 10:12:47 +02:00
Lennart Poettering 0b2aa2064f find-esp: change "unprivileged_mode" parameter to be tristate
Previously, unprivileged mode for find_esp_and_warn() and
find_xbootldr_and_warn() could be enabled or disabled. With this change
it can also be set to negative in which case the functions will enable
it automatically if found to be executing without privileges.

This just moves te geteuid() check we often do for the param inside of
the functions.

At the same time internally in the functions we also pass around the
VerifyESPFlags field across the various functions instead of booleans.

Both changes are just refactoring. No changes in behaviour.
2023-05-31 10:12:47 +02:00
Lennart Poettering 40fb9eebbc tmpfiles: use same credstore perms everywhere
In b6033b7060 support was added to create
{/etc|/run}/credstore{|.encrypted} via tmpfiles.d with perms 0000. These
perms are so restrictive that not even root can access them unless it
has CAP_DAC_OVERRIDE capability. This is creates the dirs at boot time

In 24039e1207 support was added to create
/etc/credstore with perm 0700 from meson.build at build time.

This patch makes unifies the two parts:

1. creates both /etc/credstore *and* /etc/credstore.encrypted in both
   places (the build system still won't create them in /run/, since
   that's pointless since not shipped, and the runtime won't create the
   dirs below /usr/lib/, since that's not generically writable anyway).

2. Both at runtime and at build time we'll create the dirs with mode
   0700. This is easier for packaging tools to handle since they
   generally react pretty negatively on dirs they can't enumerate.
2023-05-31 11:15:26 +08:00
Frantisek Sumsal f018fad483 sd-network: use structured initialization
And squash one unnecessary assignment.
2023-05-30 21:35:33 +02:00
Frantisek Sumsal 9f91d2fbde journal-remote: use structured initialization 2023-05-30 21:18:08 +02:00
Frantisek Sumsal 241ecd1cc2 core,shared: add a couple of asserts
To appease the LTO overlords:

In file included from ../../../../src/basic/macro.h:446,
                 from ../../../../src/shared/blockdev-util.h:8,
                 from ../../../../src/shared/creds-util.c:11:
../../../../src/shared/creds-util.c: In function 'get_credential_host_secret':
../../../../src/shared/creds-util.c:379:52: error: '%s' directive argument is null [-Werror=format-overflow=]
  379 |                                 log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.",
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../src/basic/log.h:214:86: note: in definition of macro 'log_full_errno_zerook'
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../../../../src/basic/log.h:250:41: note: in expansion of macro 'log_full_errno'
  250 | #define log_debug_errno(error, ...)     log_full_errno(LOG_DEBUG,   error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../../../../src/shared/creds-util.c:379:33: note: in expansion of macro 'log_debug_errno'
  379 |                                 log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.",
      |                                 ^~~~~~~~~~~~~~~
../../../../src/shared/creds-util.c:379:74: note: format string is defined here
  379 |                                 log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.",
      |                                                                          ^~
cc1: some warnings being treated as errors

../../../../src/core/transaction.c: In function 'transaction_verify_order_one':
../../../../src/core/transaction.c:338:38: error: '%s' directive argument is null [-Werror=format-overflow=]
  338 |                 sprintf(ans + size, "%s%s", unit_log_field, *unit_id);
      |                                      ^~
cc1: some warnings being treated as errors
2023-05-30 16:23:40 +02:00
Frantisek Sumsal 4189d009ae ci: add gcc-13, drop gcc-12 2023-05-30 16:23:40 +02:00
Zbigniew Jędrzejewski-Szmek 5ad6600364 test-dlopen: allow loading of multiple libraries
This is useful for debugging, for example if we want to test multiple different
dlls being loaded in the same namespace.
2023-05-30 16:05:06 +02:00
Zbigniew Jędrzejewski-Szmek 6483bcef54 shared/loop-util: add comment
Requested in afbe20b7d4 (r115653459).
2023-05-30 16:04:35 +02:00
Zbigniew Jędrzejewski-Szmek e80444729f tests: drop unnecessary redirection of stderr
command -v doesn't print anything to stderr, let's use the canonical
form with just >/dev/null.
2023-05-30 16:04:35 +02:00
Zbigniew Jędrzejewski-Szmek 5fdec39796 dissect: use pager for --help
This output is already too long to fit on an normal terminal, and the
interesting parts are towards the top.
2023-05-30 16:04:13 +02:00
Zbigniew Jędrzejewski-Szmek 78435d620c basic/user-util: attach pointer symbol to return type, not function
Surrounding code was predominantly using this style already, let's make things
consistent.
2023-05-30 16:03:32 +02:00
Daan De Meyer 0690160e2c label: Rename to label-util.h 2023-05-30 14:50:56 +02:00
Daan De Meyer cc11107fd2 test-udev: Skip running in container
Containers generally don't have permission to mknod() which is
required by test-udev so let's skip the test as well if we detect
we're running in a container.
2023-05-30 14:48:38 +02:00
Daan De Meyer 5dcb40a1b0 oom: Make sure temporary test file is in /tmp 2023-05-30 14:48:38 +02:00
Daan De Meyer abf25fae90 kmod-setup: Load virtio-vsock kernel module early
We might want to send sd-notify over vsock very early on so let's
make sure we load the relevant kernel module as early as possible.
2023-05-30 14:48:38 +02:00
Daan De Meyer 600bf76c17 repart: Allow target directory excludes
Currently, ExcludeFiles= supports excluding directories on the host
from being copied. Let's extend this to also support preventing files
from being copied into specific directories in the partition by adding
a new option ExcludeFilesTarget=. An example where this is useful is
when setting up btrfs subvolumes in the top level that are intended to
be mounted into specific locations, so /usr would be stored in @usr,
/home in @home, .... To accomplish this, we need to copy /usr to @usr
and prevent any files from being copied into /usr in the partition,
which with this commit, we'd be able to do as follows:

```
[Partition]
CopyFiles=/usr:@usr
ExcludeFilesTarget=/usr
```
2023-05-30 13:45:49 +02:00
Zbigniew Jędrzejewski-Szmek afbe20b7d4 shared/loop-util: use longer delay when waiting for loop device
The kernel may be syncing a file system or doing something else that requires
more time. So make the delay a bit longer, but provide some feedback and also
grow the delay exponentially (though with a long exponent). If the kernel is
doing something else, no need to repeat so often. With 38 attempts, we get a
total of slightly above 5000 ms.

I wrote this when I thought that the the delay is not long enough. It turned
out that we were blocking the file system on the loop device, so waiting longer
wasn't helpful. But I think it's nicer to do it this way anyway.
2023-05-30 13:41:56 +02:00
Zbigniew Jędrzejewski-Szmek e52f929574 man: extend description of .target a bit
The man page is reference documentation, so we shouldn't write too much
duplicate things here, but we can make the text a bit more approachable. This
rewords and extends the documentation as requested and suggested in #24231 and
adds some hints for the user.

Closes #24231.
2023-05-30 13:41:24 +02:00
Zbigniew Jędrzejewski-Szmek 88ebc58880 man/systemd-gpt-auto-generator: mention that swap may be on luks too
Fixes #25972.
2023-05-30 13:41:24 +02:00
Zbigniew Jędrzejewski-Szmek fb12f1404f man/systemctl: say that kexec loads the kernel, mention --force
Fixes #24588.
Fixes #15029.
2023-05-30 13:41:24 +02:00