-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkosi.sync
executable file
·39 lines (31 loc) · 1.11 KB
/
mkosi.sync
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
fail() {
echo "$@" 1>&2
exit 1
}
MKOSI="submodules/mkosi/bin/mkosi"
if [ ! -x "$MKOSI" ]; then
fail "mkosi submodule not found, run scripts/bootstrap"
fi
if [ ! -r submodules/systemd/mkosi.conf ]; then
fail "systemd submodule not found, run scripts/bootstrap"
fi
# This is a loop because of https://www.shellcheck.net/wiki/SC2144
for f in \
submodules/systemd/build/mkosi.builddir/"${DISTRIBUTION}~${RELEASE}~${ARCHITECTURE}"/systemd-2*.rpm
do
if [ -r "$f" ]; then
echo "Found previously built systemd"
exit 0
fi
done
# Build systemd for the host
# Using --force because we need to build the tools tree as well
# Hardcoding -Dtpm2=enabled because otherwise we don't get systemd-measure
$MKOSI --directory=submodules/systemd --tools-tree=default --force sandbox meson setup -Dtpm2=enabled build-host
$MKOSI --directory=submodules/systemd --tools-tree=default sandbox meson compile -C build-host
# Build systemd for the target
$MKOSI --directory=submodules/systemd --distribution="$DISTRIBUTION" --release="$RELEASE" -t none
exit 0