-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathinstall
executable file
·42 lines (35 loc) · 992 Bytes
/
install
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
#!/bin/bash -ex
find_latest_qemu_version() {
git ls-remote --tags git://git.qemu.org/qemu.git \
| grep -v '\-rc' \
| grep -oh 'v[0-9]\{1,2\}\.[0-9]\{1,2\}\(\.[0-9]\{1,2\}\(\.[0-9]\{0,2\}\)\?\)\?' \
| sort --version-sort -r \
| head -n 1
}
#VERSION=v2.10.1
VERSION=$(find_latest_qemu_version)
echo $VERSION > qemu_version
git clone --depth=1 -b "$VERSION" git://git.qemu-project.org/qemu.git
set +x
source ctf-tools-venv-activate
set -x
prefix="--prefix=$(pwd)"
python="--python=$(which python)"
build_flags=""
mkdir build
pushd build
if ! ../qemu/configure "$prefix" "$python" $build_flags; then
echo "Updating QEMU submodules in case dependencies are missing"
pushd ../qemu/
git submodule init
git submodule update --recursive
popd
# redo configure step
../qemu/configure "$prefix" "$python" $build_flags
fi
make -j $(nproc)
make install
# remove build artifacts - qemu is huge otherwise...
make clean
popd
rm -rf build