1 Star 0 Fork 23

xywang/openharmony_oneclick_env_init

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install_gcc_riscv32.sh 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
mamingshuai 提交于 2021-07-31 14:49 . 增加获取系统版本脚本
#!/bin/bash
baseDirForScriptSelf=$(cd "$(dirname "$0")"; pwd)
source ${baseDirForScriptSelf}/source.sh
# 安装gn
source ${baseDirForScriptSelf}/proxy.sh
DownLoad_URL=https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz
file_name=`basename ${DownLoad_URL}`
cd ${work_dir}
if [ ! -f "${work_dir}/${file_name}" ];then
wget –-no-check-certificate "${DownLoad_URL}" >>${baseDirForScriptSelf}/init_run.log 2>&1
check_line=$((LINENO-1))
if [ $? -gt 0 ];then
push_error "${check_line}" "gcc_riscv32 download failed,please check!" "1"
else
check_sha256 "${DownLoad_URL}" "${work_dir}/${file_name}"
fi
fi
if [ -d ~/gcc_riscv32 ];then
mv ~/gcc_riscv32 ~/gcc_riscv32_bak_${unix_time}
fi
mkdir ~/gcc_riscv32
tar -zxf ${work_dir}/gcc_riscv32-linux-7.3.0.tar.gz -C ~/gcc_riscv32 >>${baseDirForScriptSelf}/init_run.log 2>&1
BIN_FILE=`find ~/gcc_riscv32 -maxdepth 5 -type f -name 'riscv32-unknown-elf-gcc'`
BIN_PATH=`dirname ${BIN_FILE}`
sudo bash -c "echo 'export PATH=${BIN_PATH}:\$PATH' >/etc/profile.d/gcc_riscv32.sh"
source /etc/profile
source /etc/profile.d/gcc_riscv32.sh
gcc_riscv32_version=`riscv32-unknown-elf-gcc --version|grep riscv32`
if [ $? -gt 0 ];then
echo -e "${failed_color},gcc_riscv32 install failed.Please check!"
exit 1
else
echo -e "${success_color},gcc_riscv32 install success.Revision:${gcc_riscv32_version}"
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/OH-wxy/openharmony_oneclick_env_init.git
git@gitee.com:OH-wxy/openharmony_oneclick_env_init.git
OH-wxy
openharmony_oneclick_env_init
openharmony_oneclick_env_init
master

搜索帮助