From bda54ae03f3b7a38f91ac813a350b5a466b0424a Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 6 May 2024 14:11:13 +0200 Subject: [PATCH 1/4] mkosi: Skip build if NO_BUILD is set This allows running the integration tests against the distro's packaged version of systemd. --- mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot | 4 ++++ .../system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot | 4 ++++ .../system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot | 4 ++++ .../system/mkosi.conf.d/10-opensuse/mkosi.build.chroot | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot index 33a64cb1d5..7df218823e 100755 --- a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot @@ -2,6 +2,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -e +if ((NO_BUILD)); then + exit 0 +fi + # shellcheck source=/dev/null . /usr/lib/os-release diff --git a/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot index 498c52e011..a8e4e7e90f 100755 --- a/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot @@ -2,6 +2,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -e +if ((NO_BUILD)); then + exit 0 +fi + # shellcheck source=/dev/null . /usr/lib/os-release diff --git a/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot index 52a23a53b5..2015a4b46c 100755 --- a/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot @@ -2,6 +2,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -e +if ((NO_BUILD)); then + exit 0 +fi + # shellcheck source=/dev/null . /usr/lib/os-release diff --git a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot index 83b5a7e666..2fe3d9464c 100755 --- a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot @@ -2,6 +2,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later set -e +if ((NO_BUILD)); then + exit 0 +fi + # shellcheck source=/dev/null . /usr/lib/os-release ID="${ID%-*}" From 21e9282bc200285901901dd95a232caf326e161e Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 6 May 2024 14:39:28 +0200 Subject: [PATCH 2/4] mkosi: Only look for services in /usr and /etc --- mkosi.images/system/mkosi.postinst.chroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkosi.images/system/mkosi.postinst.chroot b/mkosi.images/system/mkosi.postinst.chroot index 5683d5ca53..de333f364b 100755 --- a/mkosi.images/system/mkosi.postinst.chroot +++ b/mkosi.images/system/mkosi.postinst.chroot @@ -38,7 +38,7 @@ TTYVHangup=no CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG EOF # ASAN and syscall filters aren't compatible with each other. - find / -name '*.service' -type f -exec sed -i 's/^\(MemoryDeny\|SystemCall\)/# \1/' {} + + find /usr /etc -name '*.service' -type f -exec sed -i 's/^\(MemoryDeny\|SystemCall\)/# \1/' {} + # `systemd-hwdb update` takes > 50s when built with sanitizers so let's not run it by default. systemctl mask systemd-hwdb-update.service From 71b7156bd3bb31812db39a992c48fdf102536e96 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 6 May 2024 14:44:27 +0200 Subject: [PATCH 3/4] mkosi: Add missing SPDX line --- .../systemd/system/user@.service.d/99-SYSTEMD_UNIT_PATH.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkosi.images/system/mkosi.extra/usr/lib/systemd/system/user@.service.d/99-SYSTEMD_UNIT_PATH.conf b/mkosi.images/system/mkosi.extra/usr/lib/systemd/system/user@.service.d/99-SYSTEMD_UNIT_PATH.conf index fa634935cb..d0093b7e24 100644 --- a/mkosi.images/system/mkosi.extra/usr/lib/systemd/system/user@.service.d/99-SYSTEMD_UNIT_PATH.conf +++ b/mkosi.images/system/mkosi.extra/usr/lib/systemd/system/user@.service.d/99-SYSTEMD_UNIT_PATH.conf @@ -1,2 +1,4 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + [Service] PassEnvironment=SYSTEMD_UNIT_PATH From fdf3820e54fb44820da251fe68d9ffbb6dc6e1a6 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 6 May 2024 14:44:43 +0200 Subject: [PATCH 4/4] mkosi: Configure coredump to store coredumps in the journal. Makes it easier to debug coredumps that happen in CI as we can retrieve them via the journal. --- mkosi.images/system/mkosi.extra/usr/lib/systemd/coredump.conf | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 mkosi.images/system/mkosi.extra/usr/lib/systemd/coredump.conf diff --git a/mkosi.images/system/mkosi.extra/usr/lib/systemd/coredump.conf b/mkosi.images/system/mkosi.extra/usr/lib/systemd/coredump.conf new file mode 100644 index 0000000000..cde9785d28 --- /dev/null +++ b/mkosi.images/system/mkosi.extra/usr/lib/systemd/coredump.conf @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Coredump] +Storage=journal