1616
1717set -xe
1818
19- # in coreos, we could just copy the blobfuse2 binary to /usr/local/bin/blobfuse2
19+ BIN_PATH=${BIN_PATH:-/ usr/ local/ bin}
20+ if [ " ${DISTRIBUTION} " = " cos" ]; then
21+ BIN_PATH=" /home/kubernetes/bin"
22+ fi
23+ # copy blobfuse2 binary to BIN_PATH/blobfuse2
2024updateBlobfuse2=" true"
2125if [ " ${INSTALL_BLOBFUSE} " = " true" ] || [ " ${INSTALL_BLOBFUSE2} " = " true" ]
2226then
23- if [ -f " /host/usr/local/bin /blobfuse2" ]; then
24- old=$( sha256sum /host/usr/local/bin /blobfuse2 | awk ' {print $1}' )
27+ if [ -f " /host/${BIN_PATH} /blobfuse2" ]; then
28+ old=$( sha256sum /host/${BIN_PATH} /blobfuse2 | awk ' {print $1}' )
2529 new=$( sha256sum /usr/bin/blobfuse2 | awk ' {print $1}' )
2630 if [ " $old " = " $new " ]; then
2731 updateBlobfuse2=" false"
3438fi
3539if [ " $updateBlobfuse2 " = " true" ]; then
3640 echo " copy blobfuse2...."
37- cp /usr/bin/blobfuse2 /host/usr/local/bin /blobfuse2 --force
38- chmod 755 /host/usr/local/bin /blobfuse2
41+ cp /usr/bin/blobfuse2 /host/${BIN_PATH} /blobfuse2 --force
42+ chmod 755 /host/${BIN_PATH} /blobfuse2
3943fi
4044
4145if [ " ${INSTALL_BLOBFUSE_PROXY} " = " true" ]; then
4246 # install blobfuse-proxy
4347 updateBlobfuseProxy=" true"
44- if [ -f " /host/usr/local/bin /blobfuse-proxy" ]; then
45- old=$( sha256sum /host/usr/local/bin /blobfuse-proxy | awk ' {print $1}' )
48+ if [ -f " /host/${BIN_PATH} /blobfuse-proxy" ]; then
49+ old=$( sha256sum /host/${BIN_PATH} /blobfuse-proxy | awk ' {print $1}' )
4650 new=$( sha256sum /blobfuse-proxy/blobfuse-proxy | awk ' {print $1}' )
4751 if [ " $old " = " $new " ]; then
4852 updateBlobfuseProxy=" false"
@@ -51,14 +55,14 @@ if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then
5155 fi
5256 if [ " $updateBlobfuseProxy " = " true" ]; then
5357 echo " copy blobfuse-proxy...."
54- rm -rf /host/" $ KUBELET_PATH" /plugins/blob.csi.azure.com/blobfuse-proxy.sock
55- cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin /blobfuse-proxy --force
56- chmod 755 /host/usr/local/bin /blobfuse-proxy
58+ rm -rf /host/${ KUBELET_PATH} /plugins/blob.csi.azure.com/blobfuse-proxy.sock
59+ cp /blobfuse-proxy/blobfuse-proxy /host/${BIN_PATH} /blobfuse-proxy --force
60+ chmod 755 /host/${BIN_PATH} /blobfuse-proxy
5761 fi
5862
5963 updateService=" true"
60- echo " change from /usr/bin/blobfuse-proxy to /usr/local/bin /blobfuse-proxy in blobfuse-proxy.service"
61- sed -i ' s/\/ usr\ /bin\ /blobfuse-proxy/\/usr\/local\/bin\/ blobfuse-proxy/g ' /blobfuse-proxy/blobfuse-proxy.service
64+ echo " change from /usr/bin/blobfuse-proxy to ${BIN_PATH} /blobfuse-proxy in blobfuse-proxy.service"
65+ sed -i " s|/ usr/bin/blobfuse-proxy| ${BIN_PATH} / blobfuse-proxy|g " /blobfuse-proxy/blobfuse-proxy.service
6266 if [ -f " /host/etc/systemd/system/blobfuse-proxy.service" ]; then
6367 old=$( sha256sum /host/etc/systemd/system/blobfuse-proxy.service | awk ' {print $1}' )
6468 new=$( sha256sum /blobfuse-proxy/blobfuse-proxy.service | awk ' {print $1}' )
0 commit comments