#!/bin/sh # Download the arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf toolchain for to compile things in the arm folder of ASM labs # Full download link: # https://developer.arm.com/-/media/files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz # Older link not working anymore: https://snapshots.linaro.org/gnu-toolchain/11.3-2022.06-1/arm-linux-gnueabihf/gcc-linaro-11.3.1-2022.06-x86_64_arm-linux-gnueabihf.tar.xz # License: MIT # # Note: This comment from rossierd is very helpful: # https://discourse.heig-vd.ch/t/environnement-de-la-vm-linux-virtualbox/52/11 set -xe # stops the execution if one the command fails TOOLCHAIN=arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf TOOLCHAIN_ARCHIVE=$TOOLCHAIN.tar.xz OPT_FOLDER=$TOOLCHAIN CHECKSUM=$TOOLCHAIN_ARCHIVE.asc # Note: make sure to include a slash at the end of this link LINK=https://developer.arm.com/-/media/files/downloads/gnu/11.3.rel1/binrel/ pushd /tmp # important to avoid big latency in WSL when under /mnt/ curl -LO "$LINK$TOOLCHAIN_ARCHIVE" curl -LO "$LINK$CHECKSUM" md5sum --check $CHECKSUM tar -xvf $TOOLCHAIN_ARCHIVE >/dev/null sudo mkdir -p /opt/toolchains sudo mv $TOOLCHAIN /opt/toolchains/$OPT_FOLDER rm $TOOLCHAIN_ARCHIVE $CHECKSUM popd