]> git.ipfire.org Git - thirdparty/systemd.git/blob - mkosi.postinst
log: don't attempt to duplicate closed fd
[thirdparty/systemd.git] / mkosi.postinst
1 #!/bin/sh
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3
4 if [ "$1" = "final" ]; then
5 if command -v bootctl > /dev/null && [ -d "/efi" ]; then
6 bootctl install
7 fi
8
9 cat >> /root/.gdbinit <<EOF
10 set debuginfod enabled off
11 set build-id-verbose 0
12 EOF
13
14 if [ -n "$SANITIZERS" ]; then
15 # ASAN and syscall filters aren't compatible with each other.
16 find / -name '*.service' -type f -exec sed -i 's/^\(MemoryDeny\|SystemCall\)/# \1/' {} +
17
18 # `systemd-hwdb update` takes > 50s when built with sanitizers so let's not run it by default.
19 systemctl mask systemd-hwdb-update.service
20 fi
21
22 # Make sure dnsmasq.service doesn't start on boot on Debian/Ubuntu.
23 rm -f /etc/systemd/system/multi-user.target.wants/dnsmasq.service
24 fi
25
26 # Temporary workaround until https://github.com/openSUSE/suse-module-tools/commit/158643414ddb8d8208016a5f03a4484d58944d7a
27 # gets into OpenSUSE repos
28 if [ "$1" = "final" ] && grep -q openSUSE /etc/os-release; then
29 if [ -e "/usr/lib/systemd/system/boot-sysctl.service" ] && \
30 ! grep -F -q 'ConditionPathExists=/boot/sysctl.conf' "/usr/lib/systemd/system/boot-sysctl.service"; then
31 mkdir -p "/etc/systemd/system/boot-sysctl.service.d/"
32 printf '[Unit]\nConditionPathExists=/boot/sysctl.conf-%%v' >"/etc/systemd/system/boot-sysctl.service.d/99-temporary-workaround.conf"
33 fi
34 fi