xref: /openbmc/qemu/scripts/make-release (revision 36ebc7db)
1#!/bin/bash -e
2#
3# QEMU Release Script
4#
5# Copyright IBM, Corp. 2012
6#
7# Authors:
8#  Anthony Liguori <aliguori@us.ibm.com>
9#
10# This work is licensed under the terms of the GNU GPLv2 or later.
11# See the COPYING file in the top-level directory.
12
13if [ $# -ne 2 ]; then
14    echo "Usage:"
15    echo " $0 gitrepo version"
16    exit 0
17fi
18
19src="$1"
20version="$2"
21destination=qemu-${version}
22
23git clone --single-branch -b "v${version}" -c advice.detachedHead=false \
24    "${src}" ${destination}
25
26pushd ${destination}
27
28git submodule update --init --single-branch
29(cd roms/seabios && git describe --tags --long --dirty > .version)
30(cd roms/skiboot && ./make_version.sh > .version)
31# Fetch edk2 submodule's submodules, since it won't have access to them via
32# the tarball later.
33#
34# A more uniform way to handle this sort of situation would be nice, but we
35# don't necessarily have much control over how a submodule handles its
36# submodule dependencies, so we continue to handle these on a case-by-case
37# basis for now.
38(cd roms/edk2 && \
39    git submodule update --init --depth 1 -- \
40        ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 \
41        BaseTools/Source/C/BrotliCompress/brotli \
42        CryptoPkg/Library/OpensslLib/openssl \
43        MdeModulePkg/Library/BrotliCustomDecompressLib/brotli)
44popd
45tar --exclude=.git -cjf ${destination}.tar.bz2 ${destination}
46rm -rf ${destination}
47