xref: /openbmc/qemu/scripts/make-release (revision ca5aa28e)
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
19# Only include wraps that are invoked with subproject()
20SUBPROJECTS="libvfio-user keycodemapdb berkeley-softfloat-3
21  berkeley-testfloat-3 proc-macro2-1-rs quote-1-rs
22  syn-2-rs unicode-ident-1-rs"
23
24src="$1"
25version="$2"
26destination=qemu-${version}
27
28git clone --single-branch -b "v${version}" -c advice.detachedHead=false \
29    "${src}" ${destination}
30
31pushd ${destination}
32
33git submodule update --init --single-branch
34meson subprojects download $SUBPROJECTS
35
36(cd roms/seabios && git describe --tags --long --dirty > .version)
37(cd roms/skiboot && ./make_version.sh > .version)
38# Fetch edk2 submodule's submodules, since it won't have access to them via
39# the tarball later.
40#
41# A more uniform way to handle this sort of situation would be nice, but we
42# don't necessarily have much control over how a submodule handles its
43# submodule dependencies, so we continue to handle these on a case-by-case
44# basis for now.
45(cd roms/edk2 && \
46    git submodule update --init --depth 1 -- \
47        ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 \
48        BaseTools/Source/C/BrotliCompress/brotli \
49        CryptoPkg/Library/OpensslLib/openssl \
50        MdeModulePkg/Library/BrotliCustomDecompressLib/brotli)
51popd
52tar --exclude=.git -cJf ${destination}.tar.xz ${destination}
53rm -rf ${destination}
54