Commit Graph

5717 Commits

Author SHA1 Message Date
Daan De Meyer
75cf5b0d3a mkosi: Enable History= option
This option makes mkosi "remember" all the CLI options specified on
the command line when building an image. This means they don't need
to be specified again when booting the image afterwards or doing any
other operation on the image with "mkosi xxx".

As an example of how this is useful, currently, when running "mkosi
-d opensuse -f" to build an opensuse image and then running "mkosi
sandbox -- meson test -C build TEST-86-MULTI-UKI-PROFILE", running
the test will try to add virtiofs mounts of the fedora~rawhide build
directory on my machine instead of the opensuse one. With the History=
option enabled, it will use the opensuse tumbleweed directory as expected.

We stop setting --extra-search-path and --output-dir in the integration test
wrapper as these are settings that are "remembered" by enabling the History=
option.
2025-02-25 10:59:50 +01:00
Daan De Meyer
890e1ad318 test: Do not add integration tests if want_tests == 'false' 2025-02-25 10:59:50 +01:00
Daan De Meyer
ba29de84cf TEST-64-UDEV-STORAGE: Stop using mkosi configure scripts
Now that we have mkosi sandbox, meson runs with the mkosi tools tree
mounted (if one is used at all), so we can implement all the qemu feature
checks in meson itself, removing the need for mkosi configure scripts.
2025-02-25 10:13:50 +01:00
Daan De Meyer
2db2cb3034 TEST-53-ISSUE-16347: Implement rtc via custom argument
Let's get rid of the configure script for this use case by just
implementing the necessary logic in integration-test-wrapper.py.
We need to get rid of our usage of configure scripts to allow enabling
the History= setting.
2025-02-25 10:13:48 +01:00
Yu Watanabe
1930f5afe6 fuzz: decompress_startswith() may return zero (#36490)
Also, disables fuzz-compress on oss-fuzz.
Fixes #36472.
2025-02-25 11:05:06 +09:00
Dan Streetman
af69ea714d systemd-keyutil: add verb to conver PKCS#1 to PKCS#7
Add verb that takes a PKCS#1 signature (plain rsa) as input and a
certificates, and outputs a PKCS#7 binary detached signature (p7s),
which is what the kernel dm-verity driver expects.

Co-authored-by: Luca Boccassi <bluca@debian.org>
2025-02-23 14:14:09 +00:00
Yu Watanabe
339f2f2eeb fuzz: decompress_startswith() may return zero
Fixes #36472.
2025-02-23 05:04:49 +09:00
Lennart Poettering
3d49850096 import-generator: give import services better names
Previously, we'd name the import services numerically. Let's instead use
the local target file name, i.e. the object we are creating with these
services locally. That's useful so that we can robustely order against
these service instances, should we need to one day.
2025-02-21 10:03:32 +01:00
Lennart Poettering
b4bee5684d fstab-generator: support creating bind mounts via root= kernel cmdline switches
This is useful for bind mounting a freshly downloaded and unpacked tar
disk images to /sysroot to mount into.

Specifically, with a kernel command line like this one:

  rd.systemd.pull=verify=no,machine,tar:root:http://_gateway:8081/image.tar root=bind:/run/machines/root ip=any

The first parameter downloads the root image, the second one then binds
it to /sysroot so that we can boot into it.
2025-02-21 10:03:32 +01:00
Lennart Poettering
a932d2f23e test: fix racy machined test
Previously, one of the io.systemd.Machine.Open() tests would invoke a
command line via machined, and then check if it ran properly. This was
implemented in a racy fashion: the client side would immediately close
the pty fd allocated for the operation, thus triggering an immediate
SIGHUP on the other side. Now, depending whether this client was quicker
in closing or the server was quicker in executing the command line this
was a race.

Fix this comprehensively: let's first wait for the varlink operation to
complete via the new "systemd-notify --fork" logic (because varlinkctl
sends out READY=1 once handing off to --exec). Secondly let's use
varlinkctl's --exec logic to invoke a process which keeps open the open
pty until we kill it (we just use sleep for that).

(Also add some more tests for the varlinkctl --exec stuff)
2025-02-20 18:12:13 +01:00
Lennart Poettering
6828cc112a resolve: cleanups for validating query flags and fix resolving service with record type filter (#36398)
Follow-up for 81ae2237c1.
Fixes
https://github.com/systemd/systemd/pull/36353#issuecomment-2659558382.
2025-02-20 17:31:19 +01:00
Pavithra Barithaya
6a12c90ca3 timedated: Send error when time set is past build date time
When the user/customer sets the time on the system which is prior
than that of the systemd build time, as systemd doesn't allow time
before it's build date after a reboot, systemd is resetting it but
there is no error or exception present in the setTime method due
to which user/customer is unaware of why the time is reset back to
the systemd-build time.

Added a condition check in the set_time() method to return an
error when tried to set time past the systemd build date.

Tested: Verified that it throws an error when we try to set the
time prior to systemd build date.

Change-Id: Ia6b58320bdb7234a21885a44af8fd3bda64c3789
2025-02-20 15:22:15 +01:00
Daan De Meyer
a102b28ad4 mkosi: Do not run unit tests during build by default (#36450) 2025-02-20 13:25:03 +01:00
Daan De Meyer
bddfcd9629 mkosi: Do not run unit tests during build by default
We want the incremental builds to be as fast as possible, so let's
not run the unit tests locally during the image build by default.
2025-02-20 10:31:19 +01:00
Luca Boccassi
5dbc4f37c5 tree-wide: tweaks to mount point inode creation (#36308)
Some love for make_mount_point_inode_from_xyz() and ports PID 1 over to
it for mount units.

Alternative to #36290
2025-02-19 22:09:52 +00:00
Luca Boccassi
4225242149 repart: add parameter to attach offline verity signature (#36405)
Add --join-signature=hash:sig - when a verity signature partition
has been deferred in a previous run, this allows attaching a signature
that was created offline, for example on a build system like OBS where
the private key is not available to the build process.

Can be specified multiple times, the right partition to act upon will
be selected by matching the data+verity partitions UUIDs with the
provided roothash(es)
2025-02-19 18:12:19 +00:00
Luca Boccassi
09fd125059 repart: add parameter to attach offline verity signatures
Add --join-signature=hash:sig - when a verity signature partition
has been deferred in a previous run, this allows attaching a signature
that was created offline, for example on a build system like OBS where
the private key is not available to the build process.

Can be specified multiple times, the right partition to act upon will
be selected by matching the data+verity partitions UUIDs with the
provided roothash(es)
2025-02-19 16:26:05 +00:00
Yu Watanabe
134bb7bfdf nspawn: unconditionally enable FUSE and use FOREACH_ARRAY() (#36407)
- FUSE is unconditionally enabled in the container, as our kernel base
line (v5.4) supports userns-safe FUSE, which is supported since v4.18.
- Create /dev/net/tun only when it is accessible.
- Replaces several loops with FOREACH_ARRAY().
2025-02-19 02:09:58 +09:00
Yu Watanabe
011a83e42b network: fix KeepConfiguration=yes (#36414)
Fixes a regression in dd6d53a8dc (v257).
Fixes #36411.
2025-02-19 02:09:09 +09:00
Steve Ramage
a4750ae156 network: doc and code typo fixes (#36422)
This fixes some typos in the documentation, both grammar as well as
incorrect field names.
It also changes the casing of CheckSum to Checksum in L2TP to match
other casings.
2025-02-19 02:08:16 +09:00
Yu Watanabe
9fff6bf59e nspawn: create /dev/net/tun only when it is accessible
Follow-up for 985ea98e7f.

When DevicePolicy= is enabled, but DeviceAllow= for /dev/net/tun is not
specified, bind-mounting the device node from the host system is
meaningless, as it cannot be used in the container anyway.

Let's check the device node is accessible before creating or
bind-mounting.
2025-02-18 23:24:20 +09:00
Yu Watanabe
1cac0676da test-network: add test case for KeepConfiguration=yes with RTPROT_BOOT
For issue #36411.
2025-02-18 23:01:53 +09:00
Lennart Poettering
a34ce4842b ci: test new logic 2025-02-18 13:49:24 +01:00
Yu Watanabe
7ffa9dc616 TEST-75-RESOLVED: add test cases for resolving service with record type filter 2025-02-16 23:22:50 +09:00
Yu Watanabe
d13b5fdc01 TEST-75-RESOLVED: check TXT field 2025-02-16 23:10:16 +09:00
Yu Watanabe
5a07bb2c55 TEST-75-RESOLVED: revert changes done in each test case 2025-02-16 22:55:22 +09:00
Yu Watanabe
6ad252c1a5 TEST-75-RESOLVED: drop unnecessary symlink creation
It is always done in setup().
2025-02-16 22:55:22 +09:00
Luca Boccassi
21d36ef770 mkosi: Fix mkosi.clangd (#36387)
- Add missing '--' delimiter
- Use the new BuildSubdirectory JSON field to figure out the build
  subdirectory.
- Remove the /usr/include path mapping for now. This means we can't
  jump into system headers anymore if they don't exist on the host,
  we can find a way to add this back later if it turns out to be
  crucial.
2025-02-14 20:02:45 +00:00
Daan De Meyer
487ec6aa3f mkosi: Update to latest 2025-02-14 17:13:08 +01:00
Yu Watanabe
03d8b9dfab TEST-75-RESOLVED: skip a testcase when running on sanitizer 2025-02-14 11:54:56 +00:00
Yu Watanabe
2c9d6986d8 TEST-75-RESOLVED: keep IPv6 stack enabled
To make the issue #36351 easily reproduced.
2025-02-14 11:54:56 +00:00
Yu Watanabe
39da9b894f TEST-75-RESOLVED: assume knot 3.0 or newer is installed
And make the test failed if knot is installed but older than 3.0.
2025-02-14 11:54:56 +00:00
Muhammad Nuzaihan Bin Kamal Luddin
e644b332d0 resolve: clear previous assignments of RefuseRecordTypes= on reload
Follow-up for 81ae2237c1.
2025-02-14 11:54:56 +00:00
Yu Watanabe
4053af87bb core/mount: rework GracefulOptions= as x-systemd.graceful-option= (#36356)
Prompted by #36337
2025-02-14 13:01:14 +09:00
Daan De Meyer
ebcd568aa3 mkosi: Update to latest 2025-02-14 02:05:03 +00:00
Daan De Meyer
1e6514d6d0 fmf: Don't fail if we can't modify sysctl values
If the script is running unprivileged we might not be able to modify
these so let's skip in that case.
2025-02-13 20:35:56 +00:00
Daan De Meyer
b000e16798 ptyfwd: Forward various signals to forked process
We want systemd-pty-forward to be something that can be dropped in
somewhere without too much thought. To enable this, let's make sure
we forward various signals to the forked process. This makes sure that
any signals are delivered to the actual child process regardless of whether
it's running within systemd-pty-forward or not.
2025-02-13 10:21:00 +01:00
Daan De Meyer
b429f82eaf mkosi: Update to latest
In https://github.com/systemd/mkosi/pull/3497, mkosi has started parsing
options passed after the verb as regular mkosi options instead of options
for the invoked command. We adapt to this change by adding '--' as a delimiter
everywhere where required.
2025-02-12 21:39:27 +01:00
Mike Yuan
0d76f1c423 core/mount: rework GracefulOptions= to be just x-systemd.graceful-option=
09fbff57fc introduced new knob
for such functionality. However, that seems unnecessary.

The mount option string is ubiquitous in that all of fstab,
kernel cmdline, credentials, systemd-mount, ... speak it.
And we already have x-systemd.device-bound= that's parsed
by pid1 instead of fstab-generator. It feels hence more natural
for graceful options to be an extension of that, rather than
its own property.

There's also one nice side effect that the setting itself
is now more graceful for systemd versions not supporting
such feature.
2025-02-12 18:16:44 +01:00
Muhammad Nuzaihan Bin Kamal Luddin
81ae2237c1 resolve: add an option to explicitly disable query AAAA, SRV, MX, etc... (#34165)
Based on this patch i had submitted to RedHat
(https://issues.redhat.com/browse/RHEL-56280), i am submitting this
patch to this upstream systemd.

There is no way to explicitly enable/disable IPv6 AAAA queries.

Problem was that i am using RHEL9 and some applications does not use a
newer glibc that supports `no-aaaa` option in `/etc/resolv.conf`. So
some applications will still resolve IPv6 AAAA even with `no-aaaa`
option and it is inconsistent across the system where some work and some
don't.

So this systemd-resolved patch catch-all queries and disable IPv6 AAAA
queries for all applications in the OS by having an option
`RefuseRecordTypes=AAAA` to disable IPv6 AAAA queries.

Although https://github.com/systemd/systemd/pull/28136 tries to fix this
automatically but it still does not work with
`net.ipv6.conf.all.disable_ipv6 = 1`. Also tried with explicitly
removing the conditional and force set `family = AF_INET` and still
resolves AAAA records.

The issue is that i want to explicitly disable IPv6 AAAA queries instead
of systemd-resolved to figure out itself which address family it is
using, which always have problems.
2025-02-11 18:29:39 +09:00
Yu Watanabe
869b0dfe6e core: remove path to transient unit file from unit name maps on stop (#36186)
Fixes #35190.
2025-02-10 00:48:01 +09:00
Yu Watanabe
52e9bc2deb journal-remote,journal-upload: added compression support (#34822) 2025-02-09 13:33:33 +09:00
Yu Watanabe
ed8063d143 udevadm-test: show result in json format (#36284)
This adds `--json=MODE` command line option to `udevadm test`.
This may be useful for parsing e.g. network interface name or device
node symlinks.

Closes #23661.
2025-02-08 15:50:04 +09:00
Luca Boccassi
382e8a03ca network: allow to configure routing policy rule even if requesting interface is not activated yet (#36257)
Fixes a regression caused by 4f8b153d90
(v257).
Fixes #36244.
2025-02-07 22:56:36 +00:00
Yu Watanabe
ac722389a7 udevadm-test: allow to dump result in json format
This adds --json=MODE option for 'udevadm test' command.
When specified, all messages, except for the final result, will be
written to stderr, and the final result is shown in JSON format to
stdout. It may be useful for parsing the test result.
2025-02-08 01:39:35 +09:00
Andrii Chubatiuk
cfaf78001c journal-remote: added compression, compression-level and content-encoding negotiation 2025-02-07 07:05:02 +02:00
Lennart Poettering
8954a2a833 test: add some basic area tests 2025-02-06 09:23:49 +01:00
Yu Watanabe
570cd55783 udevadm: several cleanups for command line option parsers (#36241) 2025-02-06 09:39:03 +09:00
Luca Boccassi
2ee81b556f network/route: improve Gateway=_dhcp4 handling (#36183)
- Also configures route to the gateway and prefix route in the specified
table, if necessary.
- Also set preferred source address of the route.

Closes #36168.
2025-02-05 12:19:01 +00:00
Daan De Meyer
ea086b0877 network/routing-policy-rule: fix compare function (#36268)
Fixes a regression caused by fc58350aa4
(v257).
Fixes #35874.
2025-02-05 09:50:59 +01:00