Skip to content

Commit

Permalink
qemu version change (#2862)
Browse files Browse the repository at this point in the history
* qemu version change

* allow multiple versions

* codefactor

* typo

* oops
  • Loading branch information
md-shafiul-alam authored Jul 31, 2024
1 parent d73195c commit 0b26452
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .ci/env/apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,31 @@ function install_qemu_emulation_apt {
}

function install_qemu_emulation_deb {
qemu_deb=qemu-user-static_9.0.1+ds-1~bpo12+1_amd64.deb
set +e

versions=(9.0.2 9.0.1 8.2.4)
found_version=""
for version in ${versions[@]}; do
qemu_deb="qemu-user-static_${version}+ds-1_amd64.deb"
echo "Checking for http://ftp.debian.org/debian/pool/main/q/qemu/${qemu_deb}"
if wget -q --method=HEAD http://ftp.debian.org/debian/pool/main/q/qemu/${qemu_deb} &> /dev/null;
then
echo "Found qemu version ${version}"
found_version=${qemu_deb}
break
fi
done

set -eo pipefail
wget http://ftp.debian.org/debian/pool/main/q/qemu/${qemu_deb}
sudo dpkg -i ${qemu_deb}
if [[ -z "${found_version}" ]] ; then
# If nothing is found, error out and fail
echo "None of the requested qemu versions ${versions[*]} are available."
false
fi

wget http://ftp.debian.org/debian/pool/main/q/qemu/${found_version}
sudo dpkg -i ${found_version}

sudo systemctl restart systemd-binfmt.service
set +eo pipefail
}
Expand Down

0 comments on commit 0b26452

Please sign in to comment.