mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 18:23:32 +08:00
69d638e67e
- Extra memory because ASAN needs it - The environment variables to make the sanitizers more useful - LD_PRELOAD because the ASAN DSO needs to be the first in the list - The sanitizer library packages - Disable syscall filters because they interfere with ASAN - Disable systemd-hwdb-update because it's super slow when systemd-hwdb is built with sanitizers - Take the value for meson's b_sanitize option from the SANITIZERS environment variable
27 lines
1.1 KiB
Bash
Executable File
27 lines
1.1 KiB
Bash
Executable File
#!/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
|
|
|
|
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
|
|
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
|