]> git.ipfire.org Git - thirdparty/systemd.git/blob - mkosi.postinst
Merge pull request #24263 from pothos/sysext-for-static-binaries
[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 fi
22
23 # Temporary workaround until https://github.com/openSUSE/suse-module-tools/commit/158643414ddb8d8208016a5f03a4484d58944d7a
24 # gets into OpenSUSE repos
25 if [ "$1" = "final" ] && grep -q openSUSE /etc/os-release; then
26 if [ -e "/usr/lib/systemd/system/boot-sysctl.service" ] && \
27 ! grep -F -q 'ConditionPathExists=/boot/sysctl.conf' "/usr/lib/systemd/system/boot-sysctl.service"; then
28 mkdir -p "/etc/systemd/system/boot-sysctl.service.d/"
29 printf '[Unit]\nConditionPathExists=/boot/sysctl.conf-%%v' >"/etc/systemd/system/boot-sysctl.service.d/99-temporary-workaround.conf"
30 fi
31 fi