|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
# Copyright : (C) 2022 Phytium Information Technology, Inc.
|
|
|
|
# All Rights Reserved.
|
|
|
|
|
|
|
|
# This program is OPEN SOURCE software: you can redistribute it and/or modify it
|
|
|
|
# under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd,
|
|
|
|
# either version 1.0 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY;
|
|
|
|
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the Phytium Public License for more details.
|
|
|
|
|
|
|
|
# FilePath: install.py
|
|
|
|
# Date: 2021-10-14 08:19:30
|
|
|
|
# LastEditTime: 2022-02-18 09:26:24
|
!66 v1.0.0 Version update
* Merge branch 'pub_230118' into sync_230118
* Merge branch '1.0version' into 'new_master'
* Standalone SDK 1.0version release
* Merge branch 'fgpio_sw_pwm_modify' into 'new_master'
* Fgpio sw pwm modify
* Merge branch 'test2023-1' into 'new_master'
* Merge branch 'new_master' of https://gitlab.phytium.com.cn/embedded/ph…
* Merge branch 'nand_modify' into 'new_master'
* Merge branch 'new_master' of https://gitlab.phytium.com.cn/embedded/ph…
* 修改
* Merge branch 'git_format' into 'new_master'
* 修改参数名称
* 修改参数名
* qspi,sata
* test-2023-1-17
* 修改readme描述,无更改代码
* e2000q adds nand test configuration
* Merge branch 'git_format' into 'new_master'
* 修改changelog
* Merge remote-tracking branch 'pubilc_gitlab/new_master' into local_fdcdp
* Merge branch 'review_0109' into 'new_master'
* adc, gic, pcie, pwm, wdt review
* Merge branch 'new_master' into 'new_master'
* modified files and add rtc description
* Merge branch 'comment_230104' into 'new_master'
* 更新代码说明
* Merge branch 'review2' into 'new_master'
* Merge branch 'review_2023-01-03' into 'new_master'
* Review 2023 01 03
* 冲突解决
* Merge branch 'new_master' into 'new_master'
* 代码review修改
* Merge branch 'sdboot_230104' into 'new_master'
* 添加说明文档,支持从 SD 卡和 U 盘启动镜像
* Merge branch 'sync_230109' into 'new_master'
* gitee 库 回流
* Merge branch 'review_lqz_2301' into 'new_master'
* review_2301
* 更改时间格式为年/月/日,更改lib获取framebuffer获取接口
* Merge branch 'preview' into 'new_master'
* Network debug
* Merge branch 'preview' into 'new_master'
* Date format modified
* 修改版本迭代
* can完善,review2
* can完善修改,review
* 添加注释,删除不必要的代码
* 更新文件夹名字,添加lvgl版本号
* 修改
* Merge branch 'new_master' of https://gitlab.phytium.com.cn/embedded/ph…
* 文件描述&版本信息
* Merge branch 'preview' into 'new_master'
* developer message supplement && kconfig adjustment in lwip-2.1.2
* update
* 根据pr意见修改开发者信息格式,同时修改lvgl.mk以便与rtos分开
* Merge branch 'work_221229' into 'new_master'
* update for spim driver
* 添加文件描述,删除之前的reboo说明
* 添加文件描述,删除之前遗留的reboot说明
* 合并主分支
* Merge branch 'review_1220' into 'new_master'
* review: eth, usb, pcie, sdmmc
* Merge branch 'fatfs_sata_0.1.4' into 'new_master'
* Fatfs sata 0.1.4
* Merge branch 'preview' into 'new_master'
* Preview
* Merge branch 'new_master' into 'new_master'
* New master
* Merge branch 'fdcdp_lib' into 'new_master'
* 合并Fdcdp lib
* Merge branch 'git_format' into 'new_master'
* review代码,timer ,protocols ,qspi_sfud,spiffs_test等等
* 合入
* 修正
* 修正命令行大小写
* Merge branch 'review_lqz_2212' into 'new_master'
* 完成负责部分代码的review工作,修改首字母大小写、标点符号、打印接口等,没有改动example中的打印接口
* Merge branch 'release_1215' into 'new_master'
* fix printf info type and header file declare
* Merge branch '2022-12-21_check' into 'new_master'
* Resolve #2022 "12 21 check"
* Merge branch 'review_2022-12-19' into 'new_master'
* Review 2022 12 19
* 修正单词拼写问题
* 修正误merge sfud_ops代码, 删除files 为file
* 修改changelog
* 修改changelog日期,fassert.c
* 修改打印
* Merge remote-tracking branch 'pubilc_gitlab/new_master' into local_format
* Merge branch 'new_master' into 'new_master'
* Standardization
* “格式修改,修改去掉不必要的打印”
* “修改格式”
* “修改格式和语法“
* Merge branch 'git_format' into 'new_master'
* “最新merge版本后对整个项目进行格式化操作,包括.c.h,排除第三方库,暂时排除汇编文件,代码小修modbus,修改changelog”
* “利用testsuit编译全部项目,修改了modbus编译错误项,更改后能够全部正常编译完成”
* “在刘治宏merge版本后对整个项目进行格式化操作,包括.c.h,排除第三方库,暂时排除汇编文件,代码无改动”
* Merge branch 'lwip_port_test' into 'new_master'
* Lwip port && raw api example
* Merge branch 'can_2210' into 'new_master'
* CAN,QSPI功能完善
* gitee回归
* Merge branch 'new_master' of https://gitlab.phytium.com.cn/embedded/ph…
* Merge branch 'gitlab_new_1206' into 'new_master'
* add port Kconfig
* Merge branch 'gitlab_new_1206' into 'new_master'
* 同步 gitee 的 commit 号
* Merge branch 'sdmmc_1117' into 'new_master'
* 修改 SD 协议栈,合入 FATFS 0.1.4 支持同时使用多种介质上的文件系统
* Merge branch 'modbus' into 'new_master'
* Modbus
* Merge branch 'd2000x_1128_stand' into 'new_master'
* 统一参数命名,增加 DX 的部分适配
* Merge branch 'sync20221104' into 'new_master'
* Merge branch 'pub20221104' into sync20221104
* Merge branch 'new_master' into 'new_master'
* 发布前修改文档错误,添加配置项
* Merge branch '0.4.0_test' into 'new_master'
* 修改部分readme
* Merge branch 'test' into 'new_master'
* test modified including readme.md sdkconfig ADD ft2004eg64 or 32 d20…
* Merge branch 'release_1102' into 'new_master'
* 添加例程图片和说明,补全部分例程的配置文件
* Merge branch 'v0.4.0release_11_04' into 'new_master'
* V0.4.0release 11 04
* Merge branch '0_4_0_test' into 'new_master'
* 完善部分测试例程,如adc,pcie等
* Merge branch 'release_1028' into 'new_master'
* GPIO/SPI/SDIO/USB 等例程支持 E2000Q Demo 板,修复部分驱动中的bug
* Merge branch 'rtt_1025' into 'new_master'
* 以 f 开头重命名系统文件名,增加一键导出 RT-Thread BSP 的脚本,修改 Kconfig 适应 scons
* Merge branch 'sync_1021' into 'new_master'
* Merge branch 'pub_1021' into sync_1021
* Merge branch 'sata_0926' into 'new_master'
* E2000 Sata控制器完善,适配demo板,对can的部分代码进行一些整理
* 新增soft pwm 与 sdk用户使用手册
* 新增soft pwm 与 sdk用户使用手册
* Merge branch 'sync_1019' into 'new_master'
* Merge branch 'pub_1019' into sync_1019
* E2000支持USB XHCI, 支持轮询模式下获取键盘输入
* E2000支持USB XHCI, 支持轮询模式下获取键盘输入
* Merge branch 'dev' into 'new_master'
* Gmac和Xmac bug解决
* Merge branch 'new_master' into 'new_master'
* UART example add flaw control and ddma
* Merge branch 'can_loopback_0915' into 'new_master'
* 裸机can驱动完善
* Merge branch 'sync_0909' into 'new_master'
* Merge branch 'pub_0909' into sync_0909
* Merge branch 'sata_0831' into 'new_master'
* 完善Sata和Qspi的接口,增加博雅flash的quad读适配
* Merge branch 'new_master' into 'new_master'
* release board commit
* Merge branch 'adc_qspi_0824' into 'new_master'
* Adc适配Freertos造成的裸机驱动修改
* add cherry usb
* Merge branch 'sync_0827' into 'new_master'
* Merge branch 'pub_0827' into sync_0827
* Merge branch 'sync' into 'new_master'
* Merge branch 'sync' of https://gitlab.phytium.com.cn/zhugengyu/phytium…
* Merge branch 'pub' into sync
* Merge branch 'pub' into sync
* Merge branch 'e2000q_adapt_0815' into 'new_master'
* E2000q adapt pwm
* 补充E2000测试例程(gpio_test/spi_ddma/spi_loopback),完成FT2004回归测试(sdmmc_cmd)
* 补充E2000测试例程(gpio_test/spi_ddma/spi_loopback),完成FT2004回归测试(sdmmc_cmd)
* Merge branch 'new_master' into 'new_master'
* E2000Q 支持更新
* Merge branch 'readme_v' into 'new_master'
* update files
* Merge branch 'gitee_v0.3.0' into 'new_master'
* !49 v0.3.0 更新
* Merge branch 'E2000_TEST' into 'new_master'
* E2000 v0.3 发布
* Merge branch 'v0_2_0_gitee' into 'new_master'
* Merge branch '0_2_0' into 'new_master'
* build all, before push to gitee 0.2.0
* Merge branch 'gmac_phy_0526' into 'new_master'
* 完善gmac驱动,完善裸机lwip测试,适配freertos的lwip测试
* Merge branch 'new_master' into 'new_master'
* iic_timer_tacho
* Merge branch 'debug_0609' into 'new_master'
* 支持汇编调试打印,修改异常打印,增加例程用于异常调试
* Merge branch 'nand_0512' into 'new_master'
* Nand 0512
* 重构SDIO驱动,支持SD 2.0协议和DMA读写
* 重构SDIO驱动,支持SD 2.0协议和DMA读写
* 合入Seamphore驱动,完成GDMA驱动重构
* 合入Seamphore驱动,完成GDMA驱动重构
* Merge branch 'pwm_0525' into 'new_master'
* 重构CAN驱动,新增E2000 PWM、ADC驱动
* 合入DDMA驱动,新增DDMA+SPI回环例程,更新PR Check list和编码规范
* 合入DDMA驱动,新增DDMA+SPI回环例程,更新PR Check list和编码规范
* Merge branch 'new_master' into 'new_master'
* fi2c_slave
* Merge branch 'revert-425e915e' into 'new_master'
* Revert "Merge branch 'revert' into 'new_master'"
* Merge branch 'revert' into 'new_master'
* revert version
* Merge branch 'fi2c_0429' into 'new_master'
* Fi2c 0429
* Merge branch 'new_master' into 'new_master'
* add fi2c_master
* Merge branch 'xmac_gmac' into 'new_master'
* Gmac and Xmac Restruct
* Merge branch 'new_gic' into 'new_master'
* New gic
* Merge branch 'spi_0413' into 'new_master'
* 支持 LittleFS 和 Spiffs,新增 SPI 回环测试
* Merge branch '0_1_17' into 'new_master'
* !40 Release v0.1.17
* Merge branch 'new_master' into 'new_master'
* add uart file
* Merge branch '0_1_17' into 'new_master'
* v0.1.17发布前覆盖测试
* 解决Issue:I2C 驱动速度无法调节至3.4M
* 解决Issue:I2C 驱动速度无法调节至3.4M
* Merge branch 'wdt_restruct' into 'new_master'
* watchdog驱动重构与验证
* Merge branch 'qspi' into 'new_master'
* 重构QSPI驱动,解耦驱动和FLASH关联,完善功能特性支持和测试例程
* 重构芯片引脚控制和GPIO驱动,新增引脚控制相关例程
* 重构芯片引脚控制和GPIO驱动,新增引脚控制相关例程
* Merge branch 'ctest-pr-0317' into 'new_master'
* redefine assert and shell cmd to support ctest
* Merge branch 'openamp_update' into 'new_master'
* Openamp update
* Release v0.1.16, Support USB and SATA
* Release v0.1.16, Support USB and SATA
* Merge branch 'release_0218' into 'new_master'
* Release 0.1.16 进行发布例程功能测试,修改许可证为Phytium Public License 1.0
* 合入FUSB和FXHCI驱动,支持通过FATFS读写U盘
* 合入FUSB和FXHCI驱动,支持通过FATFS读写U盘
* Merge branch 'back' into 'new_master'
* 修改多核问题,删除glibc
* Merge branch 'sata' into 'new_master'
* add pcie & sata driver and example test
* Merge branch 'rm_some_right' into 'new_master'
* Rm some right
2 years ago
|
|
|
# Description: This file is for install phytiunm standalone sdk
|
|
|
|
|
|
|
|
# Modify History:
|
|
|
|
# Ver Who Date Changes
|
|
|
|
# ----- ------ -------- --------------------------------------
|
|
|
|
# 1.0 Zhu Gengyu 2021/9/30 init
|
|
|
|
|
|
|
|
# Before run this script, Run 'pip download -r requirment.txt' to make sure all depended module exists
|
|
|
|
# Run 'pip freeze' to output requirment.txt
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import pwd
|
|
|
|
import stat
|
|
|
|
import platform
|
|
|
|
import getpass
|
|
|
|
import tarfile
|
|
|
|
import re
|
|
|
|
import shutil
|
|
|
|
|
|
|
|
### environment constant
|
|
|
|
sdk_profile_path = "/etc/profile.d/phytium_dev.sh"
|
|
|
|
sdk_version = "v1.4.0"
|
|
|
|
|
|
|
|
### functions
|
|
|
|
def rm_line(str, file_path):
|
|
|
|
with open(file_path,'r+') as f:
|
|
|
|
lines = [line for line in f.readlines() if str not in line]
|
|
|
|
f.seek(0)
|
|
|
|
f.truncate(0)
|
|
|
|
f.writelines(lines)
|
|
|
|
|
|
|
|
def ap_line(str, file_path):
|
|
|
|
with open(file_path, 'a') as f:
|
|
|
|
f.write(str + '\n')
|
|
|
|
|
|
|
|
#################################################################
|
|
|
|
# STEP 1: Check environment
|
|
|
|
|
|
|
|
phytium_dev_path = os.environ.get("PHYTIUM_DEV_PATH")
|
|
|
|
if None == phytium_dev_path or not os.path.exists(phytium_dev_path):
|
|
|
|
print("[1]: Failed: Phytium Dev Path not setup {}!!!".format(phytium_dev_path))
|
|
|
|
exit()
|
|
|
|
|
|
|
|
aarch32_cc_path = os.environ.get("AARCH32_CROSS_PATH")
|
|
|
|
if None == aarch32_cc_path or not os.path.exists(aarch32_cc_path):
|
|
|
|
print("[1]: Failed: AARCH32 CC not setup {} !!!".format(aarch32_cc_path))
|
|
|
|
exit()
|
|
|
|
|
|
|
|
aarch64_cc_path = os.environ.get("AARCH64_CROSS_PATH")
|
|
|
|
if None == aarch64_cc_path or not os.path.exists(aarch64_cc_path):
|
|
|
|
print("[1]: Failed: AARCH64 CC not setup {} !!!".format(aarch64_cc_path))
|
|
|
|
exit()
|
|
|
|
|
|
|
|
# get absoulte path current pwd to install sdk
|
|
|
|
install_path, install_script = os.path.split(os.path.abspath(__file__))
|
|
|
|
curr_path = os.getcwd()
|
|
|
|
standalone_sdk_path = ''
|
|
|
|
|
|
|
|
# in case user call this script not from current path
|
|
|
|
if (curr_path != install_path):
|
|
|
|
print("[1]: Please cd to install script path first !!!")
|
|
|
|
exit()
|
|
|
|
|
|
|
|
# get absolute path of sdk install dir
|
|
|
|
standalone_sdk_path = install_path
|
|
|
|
print("[1]: Standalone SDK at {}".format(standalone_sdk_path))
|
|
|
|
print("[1]: SDK version is {}".format(sdk_version))
|
|
|
|
|
|
|
|
# make sure sdk scripts are executable
|
|
|
|
os.system("chmod +x ./*.sh --silent ")
|
|
|
|
os.system("chmod +x ./scripts/*.sh --silent ")
|
|
|
|
os.system("chmod +x ./make/*.mk --silent ")
|
|
|
|
os.system("chmod +x ./lib/Kconfiglib/*.py --silent ")
|
|
|
|
|
|
|
|
## STEP 2: reset environment
|
|
|
|
# remove environment variables
|
|
|
|
rm_line('### PHYTIUM STANDALONE SDK SETTING START', sdk_profile_path)
|
|
|
|
rm_line('export STANDALONE_SDK_ROOT=', sdk_profile_path)
|
|
|
|
rm_line('export STANDALONE_SDK_VERSION=', sdk_profile_path)
|
|
|
|
rm_line('### PHYTIUM STANDALONE SDK SETTING END', sdk_profile_path)
|
|
|
|
|
|
|
|
print("[2]: Reset environment")
|
|
|
|
|
|
|
|
## STEP 3: display success message and enable environment
|
|
|
|
print("[3]: Success!!! Standalone SDK {} is Install at {}".format(sdk_version, standalone_sdk_path))
|
|
|
|
print("[3]: SDK Environment Variables is in {}".format(sdk_profile_path))
|
|
|
|
print("[3]: Input 'source {}' or Reboot System to Active SDK".format(sdk_profile_path))
|