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

3996 Commits

Author SHA1 Message Date
Frantisek Sumsal
04bce24d4e test: ignore missing libudev when creating the test image
Same scenario as with libsystemd - ldd might use unprefixed RPATH, and
we install our own stuff into the image unconditionally anyway.

Also, bail out early if we hit a missing DSO with a possibly helpful
message.
2023-08-05 13:32:17 +09:00
Yu Watanabe
42f13f10d5
Merge pull request #28681 from yuwata/udev-vs-tmpfiles
Udev vs tmpfiles
2023-08-05 13:30:49 +09:00
Luca Boccassi
06e8f7af7b
Merge pull request #28398 from ddstreet/tpm2_specify_pcr_value
Tpm2 specify pcr value
2023-08-04 21:04:03 +01:00
Yu Watanabe
23acdb8d0b test: shorten timeout for 'udevadm monitor'
The command should never finish, it is not necessary to wait so long.
2023-08-05 05:03:20 +09:00
Yu Watanabe
b768379e8b test: add short test for device node permission 2023-08-05 04:52:16 +09:00
Luca Boccassi
bdfa3f3a5c portablectl: fix regression when using --force without extension parameters
c18f4eb9e9 made it possible to use --force with various verbs, by
going through the newer D-Bus methods. Except it didn't, as it regressed
during PR review refactorings, and nobody noticed because there were no
tests for it. Fix it, and add tests.

Follow-up for c18f4eb9e9
2023-08-04 18:29:57 +01:00
Dan Streetman
e85ddd9644 tpm2: update TEST-70-TPM2 to test passing PCR value to systemd-cryptenroll
Add tests to use expected, not current, PCR values during sealing.
2023-08-04 11:20:33 -04:00
Yu Watanabe
48575a59d2
Merge pull request #28628 from yuwata/meson-use-template-part6
meson: use template to declare executables (part 6)
2023-08-04 02:16:07 +09:00
Daan De Meyer
1f1efbbf55
Merge pull request #28632 from DaanDeMeyer/repart-synthesize
repart: Add --copy-from option
2023-08-03 13:49:31 +02:00
Yu Watanabe
dc4a00555a meson: set suite for all tests, and adjust suite for some tests 2023-08-03 20:37:16 +09:00
Yu Watanabe
cbc55c4cce meson: also merge declarations of fuzzers with other executables 2023-08-03 20:37:16 +09:00
Yu Watanabe
130c87b16a meson: merge declarations of normal and test executables 2023-08-03 20:37:16 +09:00
Yu Watanabe
09fa0a0721 test: rename udev-rule-runner -> test-udev-rule-runner
This partially revert 0454cf05d3.
The executable actually does not work with itself, but needs to be
combined with test-udev.py. But, even so, the executable is for testing.

In the next commit, test and normal executables are declared in the same
way, and naming of the executable becomes essential to classify them.
Let's rename the executable and prefix with 'test-'.
2023-08-03 20:37:16 +09:00
Yu Watanabe
adedcd39a8 meson: use template to declare udev plugins 2023-08-03 20:37:16 +09:00
Yu Watanabe
12b4cffdae meson: introduce HAVE_DMI flag
The condition is used at several places. Let's introduce a simple flag
for that.
2023-08-03 20:37:16 +09:00
Yu Watanabe
e5cc6d107c meson: move several test declarations
One of the notable change is that previously test-sysusers.sh was installed
unconditionally, but now it is installed only when sysusers is enabled.

Another change is that test-sysv-generator is now re-introduced which
was mistakenly dropped by 6c713961ab.
2023-08-03 20:33:52 +09:00
Daan De Meyer
1e46985a60 repart: Add --copy-from option
--copy-from synthesizes partition definitions from the given image
which are then applied to the repart algorithm. In its most basic
form, this allows copying an image to another device but it can
also be combined with --definitions to copy + add partitions in the
same call to repart.
2023-08-03 11:12:25 +02:00
Yu Watanabe
c25aa6c8ac network-generator: make network file generated from ip=dhcp matches only physical interfaces
Otherwise, it also matches later created virtual devices, and that
breaks networks generated and managed by container management services,
like docker.

Closes #28626.
2023-08-03 02:51:53 +09:00
Franck Bui
33ce0a8992 test: install systemd-homed for openSUSE
This new sub-package has been recently introduced.
2023-08-01 19:40:38 +02:00
Franck Bui
ba0ff9fc0f test: console fonts are located in /usr/share on openSUSE 2023-08-01 19:38:13 +02:00
Daan De Meyer
86320e626c Revert "repart: Allow combining CopyBlocks= and CopyFiles="
This reverts commit dea0dc7ba2.
2023-08-01 15:12:24 +02:00
Daan De Meyer
7e81a84448 Revert "repart: Add --oem and OEM="
This reverts commit 47c7805579.
2023-08-01 15:10:24 +02:00
Daan De Meyer
47c7805579 repart: Add --oem and OEM=
--oem can be used to only install OEM partitions (usr, verity,
verity-sig, ...). OEM= is used to indicate OEM partitions. If unset,
defaults to !FactoryReset. We also add a credential repart.oem to
allow configuring --oem via a credential.
2023-08-01 07:53:50 +02:00
Daan De Meyer
dea0dc7ba2 repart: Allow combining CopyBlocks= and CopyFiles=
Let's allow the combination of these two options. When used, repart
will first try to apply the CopyBlocks= behavior. If that's not possible,
it falls back to the CopyFiles= behavior.

This is a first step in being able to also use the partition definition
files shipped in the image to build the image in mkosi instead of having
a separate set of repart definition files to build the image.
2023-08-01 07:53:34 +02:00
Yu Watanabe
f2bcd3245a test-network: add more tests for address properties 2023-07-31 18:15:26 +09:00
Yu Watanabe
d19704cd21 test-network: add testcase for overriding Address.RouteMetric=
For issue #25843.
2023-07-31 02:31:17 +09:00
Kiran Vemula
bc837621a3 resolved: added show-server-state verb and DumpStatistics varlink method
Added show-server-state verb to resolvectl
Added DumpStatistics and ResetStatistics  methods to varlink
2023-07-31 02:02:03 +09:00
Yu Watanabe
2ede355908 test-network: add tests for several invalid neighbor settings, and overriding settings
This also makes the checks stricter.
2023-07-31 00:40:03 +09:00
Luca Boccassi
fc3fe92bc8
Merge pull request #28508 from yuwata/network-next-dhcp4
network: several cleanups and fixes for DHCPv4 client
2023-07-29 12:15:38 +01:00
Luca Boccassi
b739b46919
Merge pull request #28391 from ssahani/rp-filter
networkd: allow setting rp_filter for an interface
2023-07-28 21:59:04 +01:00
Luca Boccassi
b0d3095fd6 Drop split-usr and unmerged-usr support
As previously announced, execute order 66:

https://lists.freedesktop.org/archives/systemd-devel/2022-September/048352.html

The meson options split-usr, rootlibdir and rootprefix become no-ops
that print a warning if they are set to anything other than the
default values. We can remove them in a future release.
2023-07-28 19:34:03 +01:00
Susant Sahani
ab2d9e2971 CI: network - Add test for rp_filter 2023-07-28 15:05:12 +05:30
Yu Watanabe
239cce3870 fstab-generator: enable fsck for block device mounts specified in systemd.mount-extra=
Like we do for root= or so.

Another possible option is adding support of fifth (sixth?) field in
systemd.mount-extra=. But that may be overkill, hence let's do that
later if someone request that.

Fixes fsck part of issue #28541.
2023-07-28 09:28:26 +09:00
Yu Watanabe
4001653ddb network/dhcp4: always honor specified gateway address
Follow-up for 77451f654a.

Now, gateway for routes to DNS or NTP servers should be correctly picked,
hence it is not necessary to adjust the gateway address in
dhcp4_request_route_auto() again.

Also, similar for classless static routes, let's always honor
gateway address specified in (non-classless) static routes.
2023-07-28 05:47:11 +09:00
Yu Watanabe
0ce86f5eeb network/dhcp4: always find suitable gateway for destination address
And if not found, refuse to configure the route.

If a DHCP server provides classless static or static routes, then we
should use the gateway for accessing a node in the range specified in
the route. E.g. if a DHCP server provides the default gateway is
192.168.0.1, and classless static route for 8.0.0.0/8 with gateway
192.168.0.2, then we should access 8.8.8.8 through 192.168.0.2 rather
than 192.168.0.1, but should use 192.168.0.1 for 9.9.9.9.

Fixes #28358.
2023-07-28 05:45:51 +09:00
Yu Watanabe
03de154a1e test-fstab-generator: add more tests for systemd.mount-extra= and friends 2023-07-27 00:50:15 +09:00
Yu Watanabe
aeded6b0b5 test-fstab-generator: also test with SYSTEMD_IN_INITRD=no 2023-07-27 00:50:15 +09:00
Yu Watanabe
7f8c67c996 test-fstab-generator: extract core part as a function
No functional change, preparation for later commits.
2023-07-27 00:50:15 +09:00
Yu Watanabe
45c535ddb0 fstab-generator: add rd.systemd.mount-extra= and friends
Previously, mounts specified in systemd.mount-extra= are equally handled
both in initrd and the main system. So, the mounts for the main system
are also mounted in initrd.

This introduces rd.systemd.mount-extra=, which specifies mounts in initrd.
Then, mounts specified in systemd.mount-extra= are still mounted both in
initrd and the main system, but prefixed with /sysroot/ when running in
initrd.

Fixes #28516.
2023-07-27 00:50:01 +09:00
Luca Boccassi
291c66914f
Merge pull request #28498 from bluca/softreboot
softreboot: ensure all processes are killed
2023-07-24 11:36:16 +01:00
Luca Boccassi
b41ab9b3f4 softreboot: ensure all processes are killed
Having surviving processes is not ready yet as a feature, so ensure
everything is killed on the transition for now
2023-07-24 10:45:28 +01:00
Frantisek Sumsal
8256994c63 test: check if we correctly propagate /run mounts during switch root
Since 7c764d4 we bind mount certain directories during switch root
instead of moving the mount directly, and for /run we do this without
MS_REC. This, unfortunately, leaves all mounts under /run behind
in the old root, which breaks certain use cases.

See: https://github.com/systemd/systemd/issues/28452
2023-07-24 10:39:14 +01:00
Luca Boccassi
3835b9aa4b Revert "core: add IgnoreOnSoftReboot= unit option"
The feature is not ready, postpone it

This reverts commit b80fc61e89.
2023-07-22 23:27:27 +01:00
Luca Boccassi
b80fc61e89 core: add IgnoreOnSoftReboot= unit option
As it says on the tin, configures the unit to survive a soft reboot.
Currently all the following options have to be set by hand:

Conflicts=reboot.target kexec.target poweroff.target halt.target
Before=reboot.target kexec.target poweroff.target halt.target
After=sysinit.target basic.target
DefaultDependencies=no
IgnoreOnIsolate=yes

This is not very user friendly. If new default dependencies are added,
or new shutdown/reboot types, they also have to be added manually.

The new option is much simpler, easy to find, and does the right thing
by default.
2023-07-21 18:05:41 +02:00
Luca Boccassi
5022fab15f Revert "test: test new systemd-dissect --attach/--detach/--loop-ref= and /dev/loop/* symlinks"
This reverts commit f5e46b9e09.
2023-07-20 22:26:40 +01:00
Yu Watanabe
b0efbe9b81 test: use XDG_STATE_HOME for %S and %L
This fixes the test failure when invoked by a user.
===
Running ./systemd-tmpfiles --user on 'f /tmp/test-systemd-tmpfiles.1foag_ur/test-content.n_9r_xhm/arg - - - - %S'
expect: '/home/watanabe/.config'
actual: '/home/watanabe/.local/state'
Traceback (most recent call last):
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 233, in <module>
    test_valid_specifiers(user=True)
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 135, in test_valid_specifiers
    test_content('f {} - - - - %S',
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 88, in test_content
    assert content == expected
           ^^^^^^^^^^^^^^^^^^^
AssertionError
===

This also makes the test uses fallback paths.

Follow-up for b50aadaff2.
2023-07-20 12:54:54 +01:00
Luca Boccassi
7177c9022e
Merge pull request #28445 from bluca/run_host_release
core: copy the host's os-release for /run/host/os-release
2023-07-19 09:34:06 +01:00
Frantisek Sumsal
8bdece7479 network: fix fetching link properties
This fixes regression introduced in 5a0c810462 with which all requests
for link properties ended up with EINVAL as we kept hitting
the signature_is_single() assert in sd_bus_get_property().
2023-07-18 23:08:19 +02:00
Frantisek Sumsal
7e107bc31f test-network: probe a couple of uncovered networkctl codepaths 2023-07-18 21:42:39 +02:00
Frantisek Sumsal
aca99a3a38 test-network: validate JSON where applicable 2023-07-18 21:42:39 +02:00