发帖
3 0 0

搓了一个安装脚本

unsigned
注册会员

1

主题

2

回帖

114

积分

注册会员

积分
114

执行要在bash中,不要cmd!!
如题,把安装的命令放在了一个sh里,然后生成了path脚本,使用时 . path导入环境变量并打印工具的版本信息
log6.png

如果在安装前已经有了项目文件夹,会删除此文件夹(不过回收站),使用时注意!!
  1. #!bash

  2. if [ -d AiPi-Open-Kits ]; then
  3.     echo The AiPi-Open-Kits folder already exists and will be deleted soon
  4.     rm -rf AiPi-Open-Kits
  5. fi

  6. START_PATH=$(pwd)

  7. git clone https://gitee.com/Ai-Thinker-Open/AiPi-Open-Kits.git

  8. cd AiPi-Open-Kits

  9. sed -i 's/github.com/gitee.com/g' .gitmodules

  10. git submodule init

  11. git submodule update

  12. cd aithinker_Ai-M6X_SDK/

  13. git submodule init

  14. git submodule update

  15. git clone https://gitee.com/bouffalolab/toolchain_gcc_t-head_windows.git


  16. cd $START_PATH

  17. echo= > path

  18. echo '#!bash' >> path
  19. echo >> path
  20. echo RISCV_GCC_PATH=$START_PATH/AiPi-Open-Kits/aithinker_Ai-M6X_SDK/toolchain_gcc_t-head_windows/bin/ >> path
  21. echo MAKE_PATH=$START_PATH/AiPi-Open-Kits/aithinker_Ai-M6X_SDK/tools/make/ >> path
  22. echo NINJA_PATH=$START_PATH/AiPi-Open-Kits/aithinker_Ai-M6X_SDK/tools/ninja/ >> path
  23. echo >> path
  24. echo 'PATH=$RISCV_GCC_PATH:$MAKE_PATH:$NINJA_PATH:$PATH' >> path
  25. echo >> path
  26. echo RISCV_GCC_PATH= >> path
  27. echo MAKE_PATH= >> path
  28. echo NINJA_PATH= >> path
  29. echo >> path

  30. echo 'riscv64-unknown-elf-gcc --version' >> path
  31. echo 'make --version' >> path
  32. echo 'echo' >> path
  33. echo 'echo -n ninja version: ' >> path
  34. echo 'ninja --version' >> path


复制代码


──── 0人觉得很赞 ────

使用道具 举报

2023-11-10 17:42:52
自动化好
2023-11-10 18:53:52
2024-6-23 21:22:52
......
您需要登录后才可以回帖 立即登录
高级模式
返回
统计信息
  • 会员数: 28290 个
  • 话题数: 40267 篇