summaryrefslogtreecommitdiffstats
path: root/mkosi.presets/00-base/mkosi.prepare
blob: 269ba3e1536b9c6b350ee36b850c0b077b131400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e

if [ "$1" = "build" ]; then
    . /etc/os-release

    if [ "$ID" = "centos" ] && [ "$VERSION" = "8" ]; then
        alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
        alternatives --set python3 /usr/bin/python3.9
    fi

    # Make sure the necessary test users are available in the build image. We do this here because the build
    # script does not run as root.
    for id in 1 2 3; do
        getent group $id >/dev/null || echo "g testgroup$id $id -" | systemd-sysusers -
    done
fi