#!bin/bash

VERSION_DATE=${1}

if [ -z "${VERSION_DATE}" ]; then
    echo "[ERROR] Please check input parameter!"
    exit 1
fi

bash /usr/local/Ascend/opp/Ascend910/aicpu/script/uninstall.sh
bash /usr/local/Ascend/toolkit/script/uninstall.sh
bash /usr/local/Ascend/opp/script/uninstall.sh
bash /usr/local/Ascend/tfplugin/script/uninstall.sh
bash /usr/local/Ascend/fwkacllib/script/uninstall.sh
bash /usr/local/Ascend/firmware/script/uninstall.sh
bash /usr/local/Ascend/driver/script/uninstall.sh

cd /nfs/ascend/ascend910/${VERSION_DATE}/ascend910/euleros2.8_aarch64
bash A800-9000-npu-driver*-aarch64.run --full

cd /nfs/ascend/ascend910/${VERSION_DATE}/ascend910/common
bash A800-9000-npu-firmware_*.run --full

cd /nfs/ascend/ascend910/${20210308}/ascend910/common/aarch64
bash Ascend-cann-toolkit*_linux-aarch64.run --install --quiet
