drivers,thirdparty: add backup url for mlnx driver
If getting mlnx driver fail at https://content.mellanox.com, using backup url for mlnx driver. Signed-off-by: Jianping Liu <frankjpliu@tencent.com> Reviewed-by: Yongliang Gao <leonylgao@tencent.com>
This commit is contained in:
parent
198d728bcc
commit
42be2152a4
|
@ -27,6 +27,14 @@ thirdparty_mlnx(){
|
|||
timeout 900 wget -q $mlnx_tgz_url || get_mlnx_tgz_ok=0
|
||||
fi
|
||||
|
||||
if (( get_mlnx_tgz_ok == 0 )); then
|
||||
echo "Getting mlnx driver from ${mlnx_tgz_url} is fail."
|
||||
echo "Try to get mlnx driver from again from backup url."
|
||||
rm -f ${mlnx_tgz_name}
|
||||
mlnx_tgz_url=$(../../drivers/thirdparty/release-drivers/mlnx/get_mlnx_info.sh backup_url)
|
||||
timeout 900 wget -q $mlnx_tgz_url && get_mlnx_tgz_ok=1
|
||||
fi
|
||||
|
||||
sha256_tmp=$(sha256sum ${mlnx_tgz_name} | awk '{printf $1}')
|
||||
if [[ $sha256_tmp != $mlnx_tgz_sha256 ]]; then get_mlnx_tgz_ok=0; fi
|
||||
|
||||
|
|
|
@ -2,23 +2,29 @@
|
|||
|
||||
mlnx_version="23.10-3.2.2.0"
|
||||
|
||||
mlnx_tgz_name="MLNX_OFED_LINUX-$mlnx_version-rhel9.4-x86_64.tgz"
|
||||
mlnx_tgz_name="MLNX_OFED_LINUX-${mlnx_version}-rhel9.4-x86_64.tgz"
|
||||
mlnx_tgz_sha256="800b8d0f063558bf943d5b3fabf02cbbfa84a57b2690c2128a10fdaf7636d2dc"
|
||||
|
||||
if [[ $1 == mlnx_url ]]; then
|
||||
mlnx_url="https://content.mellanox.com/ofed/MLNX_OFED-$mlnx_version/$mlnx_tgz_name"
|
||||
echo "$mlnx_url"
|
||||
echo "https://content.mellanox.com/ofed/MLNX_OFED-${mlnx_version}/${mlnx_tgz_name}"
|
||||
exit 0
|
||||
elif [[ $1 == backup_url ]]; then
|
||||
part1="https://mirror"
|
||||
part2="s.te"
|
||||
part3="nt.c"
|
||||
part4="om/os/tlinux_unified/drivers-src/mlnx/"
|
||||
echo "${part1}${part2}nce${part3}${part4}${mlnx_tgz_name}"
|
||||
exit 0
|
||||
elif [[ $1 == mlnx_version ]]; then
|
||||
echo $mlnx_version
|
||||
echo ${mlnx_version}
|
||||
exit 0
|
||||
elif [[ $1 == mlnx_tgz_name ]]; then
|
||||
echo $mlnx_tgz_name
|
||||
echo ${mlnx_tgz_name}
|
||||
exit 0
|
||||
elif [[ $1 == mlnx_tgz_sha256 ]]; then
|
||||
echo $mlnx_tgz_sha256
|
||||
echo ${mlnx_tgz_sha256}
|
||||
exit 0
|
||||
else
|
||||
echo "Error: wrong parameter for release-drivers/mlnx/get_mlnx_tgz_url.sh!"
|
||||
echo "Error: wrong parameter for release-drivers/mlnx/get_mlnx_info.sh!"
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue