Commit graph

195 commits

Author SHA1 Message Date
Luca Boccassi 0bec281d29
Merge pull request #33198 from keszybz/update-distro-hash
Add helper script to update distro packaging hashes
2024-06-06 10:22:15 +01:00
Zbigniew Jędrzejewski-Szmek 531e0f5481 mkosi: update fedora commit reference
* 1f94b56cee Partially backport PR #33016 to fix crashes in KDE 6.3.0
2024-06-06 10:02:23 +02:00
Zbigniew Jędrzejewski-Szmek 7d3cc45a53 mkosi: update debian commit reference
* 5b9607385d debian/tests/storage: without scsi_debug, skip test
* 8a195a6327 debian/extra: use a dropin to configure Nice=-1 on systemd-journald.service
* 5436d49288 debian/extra: use a drop-in resolved.conf to configure Cache=no-negative
* 596a99d2d3 debian/extra: set ManagedOOMSwap=auto on -.slice
* 07ba81b14d LimitCORE: restore default hard limit to infinity
* df3a9a91e8 Restart managers on libc-upgrade dpkg trigger
2024-06-06 10:02:23 +02:00
Zbigniew Jędrzejewski-Szmek 2f3ae702a1 mkosi: set -o nounset for scripts
Those scripts are written with the expectation that all input variables are set
and will not behave correctly if something is ommitted. In particular, the
non-chrooted scripts (mkosi.clean, mkosi.sync) might wreak havoc if called
without the full environment.
2024-06-06 10:02:23 +02:00
Daan De Meyer 60a20eff80 Revert "mkosi: Don't install wireguard-tools on Debian"
wireguard-tools was added back to debian testing.

This reverts commit 8c335463d9.
2024-06-05 19:36:05 +02:00
Daan De Meyer 0c639a9010 mkosi: Stop sourcing /etc/makepkg.conf
We don't need this anymore since we now just do delayed evaluation
of $CFLAGS in /etc/makepkg.conf and it imports $CFLAGS into the
script environment which messes everything up.
2024-06-04 16:03:45 +02:00
Daan De Meyer f57cd0afbf mkosi: Build with -O0 by default
This was accidentally removed in https://github.com/systemd/systemd/pull/33193
2024-06-04 15:53:06 +02:00
Luca Boccassi 0af5114534
Merge pull request #33193 from DaanDeMeyer/fortify
mkosi: Disable FORTIFY_SOURCE when building without optimizations or with sanitizers
2024-06-04 13:38:00 +01:00
Daan De Meyer cbbffa8355 mkosi: Drop $OPTIMIZATION variable
Let's instead just use $CFLAGS to override the optimization level.
2024-06-04 12:20:19 +02:00
Daan De Meyer 98a0e73b45 mkosi: Use __meson_verbose in opensuse build script
OpenSUSE Tumbleweed now ships meson 1.4.0 which ships the new
__meson_verbose macro.
2024-06-04 11:04:46 +02:00
Daan De Meyer a16c186667 mkosi: Use meson_extra_configure_options for opensuse
This is now available so let's use it.
2024-06-04 11:00:53 +02:00
Daan De Meyer 21b338de4c mkosi: Update opensuse commit to latest 2024-06-04 11:00:38 +02:00
Daan De Meyer c45ce65f2f mkosi: Allow using $MESON_VERBOSE to enable verbose meson output 2024-06-03 14:06:19 +02:00
Daan De Meyer 05895728e6 mkosi: Allow clearing meson cache with WIPE=1
meson does not support changing compilation flags on the fly, when
doing so, the entire build directory has to be cleared explicitly, so
let's add a way to do that by setting WIPE=1.

Let's also allow developers to specify their own meson options via
$MESON_OPTIONS.
2024-06-03 13:47:33 +02:00
Daan De Meyer 51ce4c7864 mkosi: Allow setting custom CFLAGS and LDFLAGS 2024-06-03 12:58:16 +02:00
Daan De Meyer 0ccbd22f04 mkosi: Fix comment 2024-06-03 12:58:16 +02:00
Daan De Meyer 02bfe0fa1b mkosi: Add support for building with LLVM
Now you can do mkosi -E LLVM=1 to build with clang+lld. This includes
support for building with sanitizers.
2024-06-03 12:53:03 +02:00
Daan De Meyer 4548e53ee5 mkosi: Make sure initrd coredumps are also stored in the journal
Let's also translate the coredump config into a dropin so we don't
accidentally override any existing configuration.
2024-06-03 12:52:48 +02:00
Daan De Meyer 90ce4096c6 mkosi: Update debian packaging to latest 2024-06-03 12:52:48 +02:00
Daan De Meyer 9d25dc0d86 mkosi: Disable iscsiuio.socket as well 2024-06-03 12:52:48 +02:00
Daan De Meyer 6a88774c96 mkosi: Use env where appropriate 2024-06-03 12:52:48 +02:00
Daan De Meyer c397b5c701 mkosi: drop Debian /tmp hack
/tmp is now a tmpfs in debian testing so let's drop our workaround.
2024-06-03 12:43:20 +02:00
Daan De Meyer e9ef4d6c7f mkosi: Add missing [Content] section 2024-06-03 12:29:23 +02:00
Daan De Meyer 51018ed1c2 mkosi: Make system dependencies conditional on format
If the none format is specified, we don't use the extra trees at all
so let's make the dependencies on the subimages conditional on Format=
not being set to "none".

This speeds up builds when using Format=none.
2024-06-03 11:51:08 +02:00
Daan De Meyer f9dd837104 mkosi: Filter out sdubby and grubby from fedora rpm dependencies
When we query dependencies with rpmspec, we get the following:

"""
bash-5.2# mkosi-chroot rpmspec --with upstream --query --requires --define "_topdir /var/tmp" --define "_sourcedir pkg/fedora" "pkg/fedora/systemd.spec" | sort --unique
(grubby > 8.40-72 if grubby)
(sdubby > 1.0-3 if sdubby)
(systemd-rpm-macros = 256~rc3-1.fc41 if rpm-build)
(util-linux-core or util-linux)
/bin/sh
coreutils
dbus >= 1.9.18
firewalld-filesystem
grep
kbd
kmod >= 18-4
libidn2.so.0()(64bit)
libidn2.so.0(IDN2_0.0.0)(64bit)
libkmod.so.2()(64bit)
libkmod.so.2(LIBKMOD_5)(64bit)
openssl-libs
python3dist(cryptography)
python3dist(pefile)
python3dist(psutil)
python3dist(zstd)
systemd = 256~rc3-1.fc41
systemd(x86-64) = 256~rc3-1.fc41
systemd-boot
systemd-libs(x86-64) = 256~rc3-1.fc41
systemd-networkd = 256~rc3-1.fc41
systemd-pam(x86-64) = 256~rc3-1.fc41
systemd-udev = 256~rc3-1.fc41
"""

Trying to install with dnf5 correctly filters out grubby and sdubby
as they are conditional dependencies and shouldn't be installed. However,
dnf doesn't do the right thing and tries to install both grubby and sdubby,
and since they conflict this causes the build to fail.

Let's filter out sdubby and grubby explicitly to work around the bug in dnf
as it's unlikely to get fixed since all development effort is now focused on
dnf5.
2024-05-31 23:46:58 +02:00
Daan De Meyer f4a0dd0ef6
Merge pull request #33105 from DaanDeMeyer/sanitizers
Sanitizers
2024-05-31 19:44:05 +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
Zbigniew Jędrzejewski-Szmek 00d359e988 Revert "mkosi: Disable add-determinism on Fedora"
This reverts commit e74a994ebf.

The description in that commit was confused, add-determinism was not broken
and was not causing any problems, except a log message.
2024-05-31 13:34:58 +02:00
Daan De Meyer 1baea86287 mkosi: Override rpm's _fixperms script to be a noop
Since rpm 4.20 it tries to fix the permissions of all source files
in the sources. This takes forever and fails in our case with a
permission error. Since we don't want rpm touching our source files,
override the script to be a noop.
2024-05-30 22:19:00 +02:00
Daan De Meyer e74a994ebf mkosi: Disable add-determinism on Fedora
This was added for reproducible builds which we don't really care
about when building rpms in mkosi, so disable it from running as it's
broken and breaks our rpm builds.
2024-05-30 22:17:29 +02:00
Daan De Meyer 3b046883ad mkosi: Skip debuginfo workaround on newer rpm
The corresponding bug was fixed in rpm 4.20 (of which the alpha is in
rawhide as rpm 4.19.91) so skip the workaround when we detect a newer
rpm version.
2024-05-30 22:16:13 +02:00
Daan De Meyer 8c335463d9 mkosi: Don't install wireguard-tools on Debian
Package was removed from testing. This can be reverted next week once
it's added back to testing.
2024-05-30 20:54:06 +02:00
Daan De Meyer ba592dc715 mkosi: Replace submodules with our own thing
Unfortunately, git submodules break in all sorts of ways:

- Various github workflows (dependabot, github pages) try to do a shallow
clone of git submodules which does not work at all when the git repository
is hosted on pagure (https://pagure.io/pagure/issue/5453,
https://github.com/dependabot/dependabot-core/issues/9391).
- If the git forge hosting the git repository uses SHA256, then it breaks our
usage of it as a submodule as SHA256 repositories cannot be used as submodules
in SHA1 repositories (src.opensuse.org moved to SHA256 which broke our usage of
opensuse's systemd spec as a submodule).
- git submodules completely break usage of git worktrees.
- ...

Let's avoid all these issues by just doing our own home grown implementation of
git submodules. We lose the automatic dependabot updates this way but since dependabot
fails to run more often that not with submodules we don't really lose anything.
2024-05-30 19:31:32 +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 fe2a793b2d mkosi: Stop installing dbus-broker on OpenSUSE
dbus-broker and dbus-daemon have not been made interchangable on
OpenSUSE so we currently end up with dbus-broker used for the system
bus and dbus-daemon for the session bus. Let's stick to dbus-daemon
on OpenSUSE until they switch to dbus-broker.
2024-05-30 09:59:30 +02:00
Daan De Meyer 9b112737fa mkosi: Install bpftrace 2024-05-30 09:59:30 +02:00
Daan De Meyer 556659adfe mkosi: Switch back to cloud/KVM kernel packages
Now that we don't need megasas2 anymore, let's switch back to the
KVM/cloud kernel images to save on image size, build times and boot
times.
2024-05-29 15:24:03 +02:00
Daan De Meyer 14aea4a9f5 mkosi: Disable iscsi service and socket
We'll always start these on demand in integration tests that need
them. No need to start them by default.
2024-05-29 14:10:50 +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 6448993a4b mkosi: Set EXTRA_CFLAGS on opensuse
The opensuse spec doesn't unconditionally set FORTIFY_SOURCE=2 anymore
so let's drop our workaround.
2024-05-29 11:26:06 +02:00
Luca Boccassi 386dc7d0fd mkosi: explicitly install g++ in opensuse
Not pulled in by default at build time
2024-05-21 19:07:39 +01:00
Yu Watanabe 90fe8cf209 test: install more kernel modules for Fedora image
Otherwise, several tests for networkd are skipped.

Follow-up for #32666.
2024-05-20 18:38:45 +09:00
Daan De Meyer e182c7b4db test: Enable TEST-69-SHUTDOWN for mkosi
In mkosi, we run the test inside the VM instead of outside. To simplify
the implementation we drop the reboot part and only verify that we can
schedule and cancel shutdowns and that the wall messages are sent as
expected.
2024-05-16 18:21:32 +02:00
Daan De Meyer 4ac46561e9 test: Enable TEST-24-CRYPTSETUP for mkosi
Encrypted /var is skipped because meson's limitations make per test
images not really feasible and we can't encrypt /var by default because
it slows down the image build too much.

Co-authored-by: Richard Maw <richard.maw@codethink.co.uk>
2024-05-16 14:46:37 +02:00
Daan De Meyer b13b7978e7 test: Enable TEST-08-INITRD on mkosi 2024-05-15 10:09:53 +02:00
Daan De Meyer 985ea31173
Merge pull request #32666 from DaanDeMeyer/mkosi-network
test: Add TEST-85-NETWORK to run systemd-networkd-tests.py
2024-05-15 07:30:04 +02:00
Daan De Meyer 9e262ef92e test: Enable TEST-54-CREDS on mkosi 2024-05-14 23:19:28 +02:00
Daan De Meyer 16585dbaf4 mkosi: Disable journald rate-limiting 2024-05-14 22:58:28 +02:00
Daan De Meyer 5692f87160 test: Run TEST-64-UDEV-STORAGE with mkosi
We add a configure script for each subtest to add the required
qemu arguments.

Co-authored-by: Richard Maw <richard.maw@codethink.co.uk>
2024-05-14 12:43:28 +02:00