2017-02-16 21:40:17 +00:00
|
|
|
#!/bin/bash -ex
|
2015-05-07 11:02:00 +00:00
|
|
|
|
2017-11-13 15:42:22 +00:00
|
|
|
find_latest_qemu_version() {
|
|
|
|
git ls-remote --tags git://git.qemu.org/qemu.git \
|
|
|
|
| grep -v '\-rc' \
|
2018-04-20 13:00:18 +00:00
|
|
|
| grep -oh 'v[0-9]\{1,2\}\.[0-9]\{1,2\}\(\.[0-9]\{1,2\}\(\.[0-9]\{0,2\}\)\?\)\?' \
|
2017-11-13 15:42:22 +00:00
|
|
|
| sort --version-sort -r \
|
|
|
|
| head -n 1
|
|
|
|
}
|
|
|
|
|
|
|
|
#VERSION=v2.10.1
|
|
|
|
VERSION=$(find_latest_qemu_version)
|
2018-04-20 13:00:18 +00:00
|
|
|
echo $VERSION > qemu_version
|
2017-08-15 14:56:27 +00:00
|
|
|
git clone --depth=1 -b "$VERSION" git://git.qemu-project.org/qemu.git
|
2016-10-13 12:07:40 +00:00
|
|
|
|
2018-04-20 13:00:18 +00:00
|
|
|
set +x
|
2016-10-13 12:07:40 +00:00
|
|
|
source ctf-tools-venv-activate
|
2018-04-20 13:00:18 +00:00
|
|
|
set -x
|
2017-09-27 08:05:22 +00:00
|
|
|
|
|
|
|
prefix="--prefix=$(pwd)"
|
|
|
|
python="--python=$(which python)"
|
2018-04-20 13:00:18 +00:00
|
|
|
build_flags=""
|
2017-09-27 08:05:22 +00:00
|
|
|
|
2018-04-20 13:00:18 +00:00
|
|
|
mkdir build
|
|
|
|
pushd build
|
|
|
|
if ! ../qemu/configure "$prefix" "$python" $build_flags; then
|
2017-09-27 08:05:22 +00:00
|
|
|
echo "Updating QEMU submodules in case dependencies are missing"
|
2018-04-20 13:00:18 +00:00
|
|
|
pushd ../qemu/
|
2017-09-27 08:05:22 +00:00
|
|
|
git submodule init
|
|
|
|
git submodule update --recursive
|
2018-04-20 13:00:18 +00:00
|
|
|
popd
|
|
|
|
|
|
|
|
# redo configure step
|
|
|
|
../qemu/configure "$prefix" "$python" $build_flags
|
2017-09-27 08:05:22 +00:00
|
|
|
fi
|
2015-05-07 11:02:00 +00:00
|
|
|
make -j $(nproc)
|
2018-04-20 13:00:18 +00:00
|
|
|
|
2015-05-07 11:02:00 +00:00
|
|
|
make install
|
2018-04-20 13:00:18 +00:00
|
|
|
# remove build artifacts - qemu is huge otherwise...
|
|
|
|
make clean
|
|
|
|
popd
|
|
|
|
rm -rf build
|