#!/bin/bash # SPDX-License-Identifier: LGPL-2.1-or-later set -e if [ -n "$SANITIZERS" ]; then LD_PRELOAD=$(ldd /usr/lib/systemd/systemd | grep libasan.so | awk '{print $3}') mkdir -p /etc/systemd/system.conf.d cat >/etc/systemd/system.conf.d/10-asan.conf </etc/systemd/system/systemd-journald.service.d/10-stdout-tty.conf </etc/systemd/system/console-getty.service.d/10-no-vhangup.conf < 50s when built with sanitizers so let's not run it by default. systemctl mask systemd-hwdb-update.service fi if command -v authselect >/dev/null; then # authselect 1.5.0 renamed the minimal profile to the local profile without keeping backwards compat so # let's use the new name if it exists. if [ -d /usr/share/authselect/default/local ]; then PROFILE=local else PROFILE=minimal fi authselect select "$PROFILE" if authselect list-features "$PROFILE" | grep -q "with-homed"; then authselect enable-feature with-homed fi fi # Let tmpfiles.d/systemd-resolve.conf handle the symlink. /etc/resolv.conf might be mounted over so undo that # if that's the case. mountpoint -q /etc/resolv.conf && umount /etc/resolv.conf rm -f /etc/resolv.conf # sbsign is not available on CentOS Stream if command -v sbsign &>/dev/null; then # Ensure that side-loaded PE addons are loaded if signed, and ignored if not addons_dir=/efi/loader/addons mkdir -p "$addons_dir" ukify build --secureboot-private-key mkosi.key --secureboot-certificate mkosi.crt --cmdline this_should_be_here -o "$addons_dir/good.addon.efi" ukify build --cmdline this_should_not_be_here -o "$addons_dir/bad.addon.efi" fi