2 # SPDX-License-Identifier: LGPL-2.1-or-later
4 if [ "$1" = "final" ]; then
5 if command -v bootctl
>/dev
/null
&& [ -d "/efi" ]; then
9 cat >>/root
/.gdbinit
<<EOF
10 set debuginfod enabled off
11 set build-id-verbose 0
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/' {} +
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
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
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"