-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprepare.sh
executable file
·75 lines (64 loc) · 1.69 KB
/
prepare.sh
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
function usage
{
echo -e "usage: $0 [OPTION...]"
echo -e ""
echo -e "Initialize git submodules and build QEMU, EDK2, SVSM, etc."
echo -e ""
echo -e " -h, --help print this help"
}
while [ "$1" != "" ]; do
case $1 in
-h | --help )
usage
exit
;;
* )
echo -e "\nParameter not found: $1\n"
usage
exit 1
esac
shift
done
set -ex
pushd "${SCRIPT_PATH}"
git submodule sync
git submodule update --init
popd
# Based on https://github.com/coconut-svsm/svsm/blob/main/Documentation/INSTALL.md
pushd "${SCRIPT_PATH}/igvm"
make -f igvm_c/Makefile
PREFIX=${SCRIPT_PATH}/install make -f igvm_c/Makefile install
popd
pushd "${SCRIPT_PATH}/qemu"
if [ ! -d "./build" ]; then
PKG_CONFIG_PATH=${SCRIPT_PATH}/install/lib64/pkgconfig ./configure \
--disable-docs --disable-user --target-list=x86_64-softmmu \
--enable-igvm --extra-ldflags=-L"${SCRIPT_PATH}/install/lib64" \
--extra-cflags=-I"${SCRIPT_PATH}/install/include"
fi
make -j"$(nproc)"
popd
pushd "${SCRIPT_PATH}/edk2"
git submodule sync
git submodule update --init
export PYTHON3_ENABLE=TRUE
export PYTHON_COMMAND=python3
make -j"$(nproc)" -C BaseTools/
{
source ./edksetup.sh --reconfig
build -a X64 -b DEBUG -t GCC5 -DTPM2_ENABLE -p OvmfPkg/OvmfPkgX64.dsc
}
popd
pushd "${SCRIPT_PATH}/ms-tpm-containerized-build"
git submodule sync
git submodule update --init
make
popd
pushd "${SCRIPT_PATH}/svsm"
git submodule sync
git submodule update --init
make utils/cbit
FW_FILE=${SCRIPT_PATH}/edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd make
popd