#!/bin/sh # Download the i686-linux_6.4.0 toolchain for to compile things in the x86 folder of ASM labs # Full download link: # https://toolchains.bootlin.com/downloads/releases/toolchains/x86-i686/tarballs/x86-i686--glibc--stable-2018.02-2.tar.bz2 # 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=x86-i686--glibc--stable-2018.02-2 TOOLCHAIN_ARCHIVE=$TOOLCHAIN.tar.bz2 OPT_FOLDER=i686-linux_6.4.0 CHECKSUM=$TOOLCHAIN.sha256 LINK=https://toolchains.bootlin.com/downloads/releases/toolchains/x86-i686/tarballs/ pushd /tmp # important to avoid big latency in WSL when under /mnt/ curl -LO "$LINK$TOOLCHAIN_ARCHIVE" curl -LO "$LINK$CHECKSUM" sha256sum --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