-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmkosi.sync
More file actions
executable file
·57 lines (48 loc) · 1.3 KB
/
Copy pathmkosi.sync
File metadata and controls
executable file
·57 lines (48 loc) · 1.3 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/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/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 the systemd tools tree
# Using --package-cache-dir because $HOME/.cache/mkosi is read-only
$MKOSI \
--directory=submodules/systemd \
--tools-tree=default \
--package-cache-dir=../../mkosi.pkgcache \
--force \
box -- true
# Build systemd for the host
$MKOSI \
--directory=submodules/systemd \
--tools-tree=default \
box -- meson setup build-host
$MKOSI \
--directory=submodules/systemd \
--tools-tree=default \
box -- meson compile -C build-host
# Build systemd for the target
$MKOSI \
--directory=submodules/systemd \
--distribution="$DISTRIBUTION" \
--release="$RELEASE" \
--package-cache-dir=../../mkosi.pkgcache \
-t none
exit 0