@@ -24,15 +24,27 @@ READ_AHEAD_KB=${READ_AHEAD_KB:-15380}
2424
2525HOST_CMD=" nsenter --mount=/proc/1/ns/mnt"
2626
27- if [ " ${INSTALL_BLOBFUSE} " = " true" ] || [ " ${INSTALL_BLOBFUSE2} " = " true" ]
27+ DISTRIBUTION=$( $HOST_CMD cat /etc/os-release | grep ^ID= | cut -d' =' -f2 | tr -d ' "' )
28+ echo " Linux distribution: $DISTRIBUTION "
29+
30+ if [ " ${DISTRIBUTION} " = " ubuntu" ] && { [ " ${INSTALL_BLOBFUSE} " = " true" ] || [ " ${INSTALL_BLOBFUSE2} " = " true" ]; }
2831then
29- cp /blobfuse-proxy/packages-microsoft-prod.deb /host/etc/
32+ release=$( $HOST_CMD lsb_release -rs)
33+ echo " Ubuntu release: $release "
34+
35+ if [ " $( expr " $release " \< " 22.04" ) " -eq 1 ]
36+ then
37+ cp /blobfuse-proxy/packages-microsoft-prod-18.04.deb /host/etc/packages-microsoft-prod.deb
38+ else
39+ cp /blobfuse-proxy/packages-microsoft-prod-22.04.deb /host/etc/packages-microsoft-prod.deb
40+ fi
41+
3042 # when running dpkg -i /etc/packages-microsoft-prod.deb, need to enter y to continue.
3143 # refer to https://stackoverflow.com/questions/45349571/how-to-install-deb-with-dpkg-non-interactively
3244 yes | $HOST_CMD dpkg -i /etc/packages-microsoft-prod.deb && $HOST_CMD apt update
3345
3446 pkg_list=" "
35- if [ " ${INSTALL_BLOBFUSE} " = " true" ]
47+ if [ " ${INSTALL_BLOBFUSE} " = " true" ] && [ " $( expr " $release " \< " 22.04 " ) " -eq 1 ]
3648 then
3749 pkg_list=" ${pkg_list} fuse"
3850 # install blobfuse with latest version or specific version
4658
4759 if [ " ${INSTALL_BLOBFUSE2} " = " true" ]
4860 then
49- release=$( $HOST_CMD lsb_release -rs)
50- if [ " $release " = " 18.04" ]; then
61+ if [ " $( expr " $release " \< " 22.04" ) " -eq 1 ]; then
5162 echo " install fuse for blobfuse2"
5263 pkg_list=" ${pkg_list} fuse"
5364 else
0 commit comments