summaryrefslogtreecommitdiffstats
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 4fd0d19b..e70c25a7 100755
--- a/build.sh
+++ b/build.sh
@@ -13,6 +13,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 +25,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 +85,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()