diff options
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -9,10 +9,15 @@ ############################################################################## set -ex +#avoid locale issue on some environment +export LC_ALL=en_US.UTF-8 + COMPASS_PATH=`cd ${BASH_SOURCE[0]%/*};pwd` WORK_DIR=$COMPASS_PATH/work/building export CACHE_DIR=$WORK_DIR/cache +COMPASS_ARCH=$(uname -m) + echo $COMPASS_PATH REDHAT_REL=${REDHAT_REL:-"false"} @@ -23,12 +28,17 @@ mkdir -p $WORK_DIR $CACHE_DIR function install_docker_ubuntu() { + REPO_ARCH=amd64 + if [ "$COMPASS_ARCH" = "aarch64" ]; then + REPO_ARCH=arm64 + fi + sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual sudo apt-get install -y apt-transport-https ca-certificates curl \ software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88 - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ + sudo add-apt-repository "deb [arch=$REPO_ARCH] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" sudo apt-get update @@ -78,7 +88,12 @@ function prepare_env() function download_packages() { - python $COMPASS_PATH/build/parser.py $COMPASS_PATH/build/build.yaml + build_yaml_file=build.yaml + if [ -f "$COMPASS_PATH/build/build-$COMPASS_ARCH.yaml" ]; then + build_yaml_file=build-$COMPASS_ARCH.yaml + fi + + python $COMPASS_PATH/build/parser.py $COMPASS_PATH/build/$build_yaml_file } function build_tar() |