summaryrefslogtreecommitdiffstats
path: root/mkosi.postinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:35:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:35:18 +0000
commitb750101eb236130cf056c675997decbac904cc49 (patch)
treea5df1a06754bdd014cb975c051c83b01c9a97532 /mkosi.postinst
parentInitial commit. (diff)
downloadsystemd-b750101eb236130cf056c675997decbac904cc49.tar.xz
systemd-b750101eb236130cf056c675997decbac904cc49.zip
Adding upstream version 252.22.upstream/252.22
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xmkosi.postinst38
1 files changed, 38 insertions, 0 deletions
diff --git a/mkosi.postinst b/mkosi.postinst
new file mode 100755
index 0000000..756077e
--- /dev/null
+++ b/mkosi.postinst
@@ -0,0 +1,38 @@
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+if [ "$1" = "final" ]; then
+ if command -v bootctl > /dev/null && [ -d "/efi" ]; then
+ bootctl install
+ fi
+
+ cat >> /root/.gdbinit <<EOF
+set debuginfod enabled off
+set build-id-verbose 0
+EOF
+
+ if [ -n "$SANITIZERS" ]; then
+ # ASAN and syscall filters aren't compatible with each other.
+ find / -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
+ fi
+
+ # Make sure dnsmasq.service doesn't start on boot on Debian/Ubuntu.
+ rm -f /etc/systemd/system/multi-user.target.wants/dnsmasq.service
+
+ # This unit comes from packages newer than this repository, and is left around as wejust rely on
+ # overwriting from the local build, so disable it manually, as it will fail the CI run
+ systemctl mask systemd-tmpfiles-setup-dev-early.service
+fi
+
+# Temporary workaround until https://github.com/openSUSE/suse-module-tools/commit/158643414ddb8d8208016a5f03a4484d58944d7a
+# gets into OpenSUSE repos
+if [ "$1" = "final" ] && grep -q openSUSE /etc/os-release; then
+ if [ -e "/usr/lib/systemd/system/boot-sysctl.service" ] && \
+ ! grep -F -q 'ConditionPathExists=/boot/sysctl.conf' "/usr/lib/systemd/system/boot-sysctl.service"; then
+ mkdir -p "/etc/systemd/system/boot-sysctl.service.d/"
+ printf '[Unit]\nConditionPathExists=/boot/sysctl.conf-%%v' >"/etc/systemd/system/boot-sysctl.service.d/99-temporary-workaround.conf"
+ fi
+fi