mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-22 07:51:16 +00:00
Refactoring and features in this patch: - Add support for aarch64 build - Add offline build configuration using vendored crates - Add script to generate vendored sources - Fix openssl-sys dependency Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
37 lines
715 B
Bash
37 lines
715 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
CH_VER=$1
|
|
CH_SPEC_DIR=$(pwd)
|
|
CH_TMP_DIR=$CH_SPEC_DIR/ch_tmp
|
|
CH_SRC_DIR=$CH_SPEC_DIR/SOURCES
|
|
|
|
if [ -z $CH_VER ]; then
|
|
echo "Replace sources with the given <version>"
|
|
echo "Usage: $0 <version>"
|
|
exit 1
|
|
fi
|
|
|
|
rm -rf $CH_TMP_DIR
|
|
if [ ! -d $CH_SRC_DIR ]; then
|
|
mkdir $CH_SRC_DIR
|
|
fi
|
|
rm -f $CH_SRC_DIR/v*.tar.gz $CH_SRC_DIR/config.toml $CH_SRC_DIR/vendor.tar.gz
|
|
|
|
|
|
wget https://github.com/cloud-hypervisor/cloud-hypervisor/archive/v${CH_VER}.tar.gz -O $CH_SRC_DIR/v${CH_VER}.tar.gz
|
|
mkdir $CH_TMP_DIR
|
|
tar xf $CH_SRC_DIR/v${CH_VER}.tar.gz -C $CH_TMP_DIR --strip-components=1
|
|
|
|
|
|
pushd $CH_TMP_DIR
|
|
|
|
cargo vendor > $CH_SRC_DIR/config.toml
|
|
tar czvf $CH_SRC_DIR/vendor.tar.gz vendor
|
|
|
|
popd
|
|
|
|
rm -rf $CH_TMP_DIR
|
|
|