Skip to content

Instantly share code, notes, and snippets.

@imdurgadas
Last active November 3, 2018 14:12
Show Gist options
  • Save imdurgadas/b07a1b1cf310cd1b6fc845361238d38d to your computer and use it in GitHub Desktop.
Save imdurgadas/b07a1b1cf310cd1b6fc845361238d38d to your computer and use it in GitHub Desktop.
Get QEMU
ARCHS=(arm s390x amd64 ppc64le)
QEMUARCHS=(arm s390x x86_64 ppc64le)
QEMUVER="v2.12.0-1"
get-qemu() {
if [[ ! $(find . -name "*qemu-*") ]]; then
echo "Downloading Qemu "
for target_arch in ${QEMUARCHS[*]}; do
if ! curl -OLs "https://github.com/multiarch/qemu-user-static/releases/download/$QEMUVER/x86_64_qemu-${target_arch}-static.tar.gz"; then
echo "Error downloading Qemu"
exit
fi
tar -xvf x86_64_qemu-"${target_arch}"-static.tar.gz
done
rm -f x86_64_qemu-*
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment