1
0
mirror of https://github.com/systemd/systemd synced 2024-07-01 07:34:28 +00:00
Commit Graph

34 Commits

Author SHA1 Message Date
Daan De Meyer
d5474f78b8 ci: Switch to Ubuntu 24.04 2024-06-08 12:33:32 +02:00
Daan De Meyer
0731321d14 mkosi: Include fewer modules in the initramfs
Let's only use mkosi's default list of modules instead of all of
them.
2024-06-06 16:44:00 +02:00
Daan De Meyer
a743cacd7b mkosi: Disable scratch device by default
We include scratch space in the rootfs image itself so we don't have
need for the scratch device so let's disable it by default.
2024-06-05 18:59:41 +02:00
Daan De Meyer
8919f86f57 mkosi: Sanitizer improvements
- Let's set the environment on the kernel command line so it applies
to initrd and main system.
- Let's add the necessary wrappers that are also added in test-functions.
Unlike test-functions we don't use gcc/clang to get the library path as
that requires installing gcc/clang in the initrd.
- Let's drop the hack to get journald writing to the console and have
it write to kmsg instead. We'll get the output either way.
- Stop removing libstdc++ and sanitizer libraries from Arch Linux
initrds and other images as it's required by the sanitizer libraries.
- Add a workaround for specifying extra meson options for opensuse
- Add a leak sanitizer suppression file as a workaround for a false
positive leak in verify_selinuxmnt() in libselinux. We do a soname match
because the stacktrace can't be properly symbolized on Debian.
2024-05-31 17:26:13 +02:00
Daan De Meyer
5d2a40ab11 mkosi: Add note about kernel command line limit 2024-05-31 17:26:01 +02:00
Daan De Meyer
c95f8dd784 mkosi: Drop kernel command line to enable log context
The log context is already enabled by virtue of the log level being
set to debug, so no need to enable it explicitly.
2024-05-31 13:48:14 +02:00
Daan De Meyer
3a8e9b4a0e mkosi: Unify device timeout for CI and local runs
Now that we use KVM and don't use repart anymore to create a root
partition on first boot, let's see if we can use the same device timeout
for both local and CI runs.
2024-05-31 10:25:08 +02:00
Daan De Meyer
074ac66e88 Revert "mkosi: Sanitizer improvements"
This reverts commit aef13ad029.
2024-05-30 14:50:21 +02:00
Daan De Meyer
aef13ad029 mkosi: Sanitizer improvements
- Let's set the environment on the kernel command line so it applies
to initrd and main system.
- Let's add the necessary wrappers that are also added in test-functions.
Unlike test-functions we don't use gcc/clang to get the library path as
that requires installing gcc/clang in the initrd.
- Let's drop the hack to get journald writing to the console and have
it write to kmsg instead. We'll get the output either way.
- Stop removing libstdc++ and sanitizer libraries from Arch Linux
initrds and other images as it's required by the sanitizer libraries.
- Add a workaround for specifying extra meson options for opensuse
- Add a leak sanitizer suppression file as a workaround for a false
positive leak in verify_selinuxmnt() in libselinux. We do a soname match
because the stacktrace can't be properly symbolized on Debian.
2024-05-30 12:47:45 +02:00
Daan De Meyer
3c367df7c6 mkosi: Switch from btrfs to ext4
Mounting multiple btrfs filesystems with the same fsid only works
properly from kernel 6.7 onwards. Let's switch to ext4 for now which
does support this.
2024-05-29 14:10:50 +02:00
Daan De Meyer
8e8a1b832d mkosi: Mask mdmonitor and isc-dhcp-server services
They always fail and do not ship with proper units so we can't
disable them with presets so we mask them instead.
2024-05-14 12:43:28 +02:00
Daan De Meyer
ff45d26de0 mkosi: Make sure the kernel fails loudly on oops/panic/softlockup
Helps with noticing kernel related failures.
2024-05-09 09:57:40 +02:00
Daan De Meyer
f1d2dc187f mkosi: Add raid=noautodetect to kernel command line
Should speed up boot times a little.
2024-05-09 09:57:04 +02:00
Daan De Meyer
1c329956e5 mkosi: Insist on KVM, VSOCK and TPM by default
By default mkosi will not run VMs with these features if they're not
available, but since various stuff in systemd makes use of these, let's
fail loudly if any of these are not available by default in systemd.

Users can still override these defaults locally if they wish.
2024-05-06 10:56:45 +02:00
Daan De Meyer
c89244842b test: Don't persist journal in mkosi image if we're not debugging tests
If we're not debugging tests, there's no point in persisting the journal,
so let's use the volatile journal storage mode in that case to avoid doing
unnecessary work.

We don't disable journal storage alltogether since various tests check
that stuff is written to the journal.
2024-04-30 15:20:55 +02:00
Daan De Meyer
e7c8507977 mkosi: Introduce particle profile
Unfortunately the current mkosi partitioning setup is a bit too
avant-garde for the integration tests. Both in that distributions
aren't ready for it yet (some more than others), and that software
which we depend on in the integration tests isn't ready for it yet
(e.g. libselinux does not read its configuration from /usr).

Let's switch back to a more boring partioning setup by default but
keep the fancy stuff around as a mkosi profile. This means that it
can still be used for manually testing stuff by running
"mkosi --profile particle -f qemu".
2024-04-30 10:46:18 +02:00
Daan De Meyer
b85e54961c test: Various mkosi integration test improvements
- Stop using logging module since the default output formatting is
  pretty bad. Prefer print() for now.
- Log less, logging the full mkosi command line is rather verbose,
  especially when it contains multi-line dropins.
- Streamline the journalctl command we output for debugging failed
  tests.
- Don't force usage of the disk image format.
- Don't force running without unit tests.
- Don't force disabling RuntimeBuildSources.
- Update documentation to streamline the command for running a single
  test and remove sudo as it's not required anymore.
- Improve the console output by having the test unit's output logged
  to both the journal and the console.
- Disable journal console log forwarding as we have journal forwarding
  as a better alternative.
- Delete existing journal file before running test.
- Delete journal files of succeeded tests to reduce disk usage.
- Rename system_mkosi target to just mkosi
- Pass in mkosi source directory explicitly to accomodate arbitrary
  build directory locations.
- Add test interactive debugging if stdout is connected to a tty
- Stop explicitly using the 'system' image since it'll likely be
  dropped soon.
- Only forward journal if we're not running in debugging mode.
- Stop using testsuite.target and instead just add the necessary
  extras to the main testsuite unit via the credential dropin.
- Override type to idle so test output is not interleaved with
  status output.
- Don't build mkosi target by default
- Always add the mkosi target if mkosi is found
- Remove dependency of the integration tests on the mkosi target
  as otherwise the image is always built, even though we configure
  it to not be built by default.
- Move mkosi output, cache and build directory into build/ so that
  invocations from meson and regular invocations share the same
  directories.
- Various aesthetic cleanups.
2024-04-23 10:32:42 +02:00
Daan De Meyer
792eb0f440 mkosi: Build command line into the image
This allows using systemd-vmspawn itself while still getting a decent
experience.
2024-04-19 15:05:19 +02:00
Richard Maw
945b722f13 test: Add mkosi-based integration test runner
The first two tests are included to ensure parallel test execution is
demonstrable.
2024-04-18 16:26:38 +01:00
Richard Maw
20c7c570b9 mkosi: Extend default device timeout to 20 seconds
A moderately heavily loaded system booting an image without a rootfs
may timeout before the root device appears.
20 seconds is enough for a VM with 2 CPUs and 2GB RAM.
2024-04-18 16:26:38 +01:00
Daan De Meyer
9d98617c1a Update debugging with vscode section
- We have ssh-generator now, so need for mkosi's Ssh= option anymore.
- By enabling RuntimeBuildSources= by default, we don't need the gdb
  config file in the image anymore, since the build and source
  directories will be mounted at the expected locations.
2024-04-16 15:25:34 +02:00
Daan De Meyer
8630fb6041 mkosi: Don't log debug logs to console
We have various tools that log directly to the console, as well as
pid1 which logs directly to the console when running in a container.
Let's make sure that we don't log debug messages to the console by
default, but keep the behavior when running in CI.
2024-04-14 19:59:10 +02:00
Daan De Meyer
962f9d6fb4 mkosi: Update to latest 2024-04-14 19:53:09 +02:00
Daan De Meyer
e5cd051724 mkosi: Switch to linux-virtual on Ubuntu
This now finally has support for credentials and erofs so let's switch
to this much smaller kernel package that doesn't pull in linux-firmware.
2024-03-29 15:58:13 +01:00
Daan De Meyer
1bee93c4c7 mkosi: Enable log context 2024-03-22 15:15:01 +01:00
Daan De Meyer
45a0bb4bb5 mkosi: Add BuildSourcesEphemeral=yes
Required to make sure that any changes packaging specs make to the
source files are thrown away after the build so they don't mess with
the source tree.
2024-03-08 19:37:27 +01:00
Daan De Meyer
4d0f1451b5 Build distribution packages in mkosi
Instead of running meson install and hoping for the best, let's build
distribution packages from the downstream packaging specs. This gets
us the following:

- Vastly simplified mkosi scripts since we don't need a separate initrd
  image anymore but can just reuse the default mkosi initrd.
- Almost everything can move to the base image as its not the basis
  anymore for the initrd and as such we don't need to care about the
  size anymore.
- The systemd packages that get pulled in as dependencies of other
  packages get properly uninstalled and replaced with our packages that
  we built instead of just installing on top of an existing systemd
  installation with no guarantee that everything from that previous
  installation was removed.
- Much better testing coverage as what we're testing is much closer
  to what will actually be deployed in distributions.
- Immediate feedback if something we change breaks distribution packaging
- We get integration with the distribution for free as we'll automatically
  use the proper directories and such instead of having to hack this
  into a mkosi build script.
- ...
2024-03-07 10:47:19 +01:00
Daan De Meyer
c00b17f6d3 mkosi: Allow users to configure the build and cache directory 2024-03-05 19:41:50 +01:00
Daan De Meyer
adbb0237c6 mkosi: Set minimum version
This will only be taken into account by newer mkosi versions but it'll
at least save some pain from running on a too old version.
2024-03-05 19:41:06 +01:00
Daan De Meyer
52842bb2c5 mkosi: Build a directory image by default
Both building and booting a directory image is much faster than
building or booting a disk image so let's default to a directory
image.

In CI, we stick to a disk image to make sure that keeps working as
well.

The only extra dependency this introduces is virtiofsd which is
packaged in all distributions except Debian stable. For users
hacking on systemd on Debian stable, a disk image can be built by
writing the following to mkosi.local.conf:

```
[Output]
Format=disk
```
2024-01-12 16:19:48 +01:00
Luca Boccassi
c2d5d8c401
Merge pull request #30464 from CodethinkLabs/misc-integration-test-fixes
Misc integration test fixes
2023-12-18 16:11:16 +01:00
Lennart Poettering
641489e257 mkosi: use systemd.firstboot=no to turn of interactivity at boot
Now that creds are processed even if systemd.firstboot=no is set, we can
use it to disable the root pw prompt *and* the new homectl prompt at the
same time, without breaking the creds stuff.
2023-12-18 11:11:11 +01:00
Richard Maw
eae7ce2d61 mkosi: Allow the output directory to be overridden
For integration tests it would be preferable to operate on a copy
so tests can be run in parallel and avoid interfering.
2023-12-13 17:55:46 +00:00
Daan De Meyer
bcb335ac68 Update to mkosi v19
- Use mkosi.images/ instead of mkosi.presets/
- Use the .chroot suffix to run scripts in the image
- Use BuildSources= match for the kernel build
- Move 10-systemd.conf to mkosi.conf and rely on mkosi.local.conf
  for local configuration
2023-11-28 19:54:58 +01:00