开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
forked from OneOS/OneOS
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
dev
分支 (22)
标签 (13)
dev
OneOS-Lite-V3.3.0
master
OneOS-Lite-V3.2.0
OneOS-Lite-V3.2.1
disassemble_components_temp
OneOS-V3.1.0
OneOS_For_OneNET
OneOS-V3.0.1
backup-temporary
OneOS-V2.4.1
OneOS-V2.3.1
OneOS-V2.2.1
OneOS-V3.0.0
OneOS-V2.4.0
OneOS-V2.4.0-Release
ch2601_evb
OneOS-V2.3.0
OneOS-V2.2.0
OneOS-V2.1.0
OneOS-Lite-v3.3.0
OneOS-Lite-v3.2.0
OneOS-Lite-v3.1.0
OneOS_for_OneNET_v1.0.0_release
OneOS-v3.0.1
OneOS-v2.4.1
OneOS-v2.3.1
OneOS-v2.2.1
OneOS-v3.0.0
OneOS-v2.4.0
OneOS-v2.3.0
OneOS-v2.2.0
OneOS-V2.2.0
dev
分支 (22)
标签 (13)
dev
OneOS-Lite-V3.3.0
master
OneOS-Lite-V3.2.0
OneOS-Lite-V3.2.1
disassemble_components_temp
OneOS-V3.1.0
OneOS_For_OneNET
OneOS-V3.0.1
backup-temporary
OneOS-V2.4.1
OneOS-V2.3.1
OneOS-V2.2.1
OneOS-V3.0.0
OneOS-V2.4.0
OneOS-V2.4.0-Release
ch2601_evb
OneOS-V2.3.0
OneOS-V2.2.0
OneOS-V2.1.0
OneOS-Lite-v3.3.0
OneOS-Lite-v3.2.0
OneOS-Lite-v3.1.0
OneOS_for_OneNET_v1.0.0_release
OneOS-v3.0.1
OneOS-v2.4.1
OneOS-v2.3.1
OneOS-v2.2.1
OneOS-v3.0.0
OneOS-v2.4.0
OneOS-v2.3.0
OneOS-v2.2.0
OneOS-V2.2.0
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
dev
分支 (22)
标签 (13)
dev
OneOS-Lite-V3.3.0
master
OneOS-Lite-V3.2.0
OneOS-Lite-V3.2.1
disassemble_components_temp
OneOS-V3.1.0
OneOS_For_OneNET
OneOS-V3.0.1
backup-temporary
OneOS-V2.4.1
OneOS-V2.3.1
OneOS-V2.2.1
OneOS-V3.0.0
OneOS-V2.4.0
OneOS-V2.4.0-Release
ch2601_evb
OneOS-V2.3.0
OneOS-V2.2.0
OneOS-V2.1.0
OneOS-Lite-v3.3.0
OneOS-Lite-v3.2.0
OneOS-Lite-v3.1.0
OneOS_for_OneNET_v1.0.0_release
OneOS-v3.0.1
OneOS-v2.4.1
OneOS-v2.3.1
OneOS-v2.2.1
OneOS-v3.0.0
OneOS-v2.4.0
OneOS-v2.3.0
OneOS-v2.2.0
OneOS-V2.2.0
OneOS
/
scripts
/
generate.py
OneOS
/
scripts
/
generate.py
generate.py 3.18 KB
一键复制 编辑 原始数据 按行查看 历史
likefei 提交于 2022年11月18日 19:51 +08:00 . first merge yaml
import os
import sys
import shutil
import importlib
import importlib.util
import time
import re
from print_helper import print_debug, print_info, print_warn, print_error
def find_soc(src, soc):
soc_dir = [os.path.basename(src)]
#soc_dir = ['hk32-common', 'replace', 'HK32F030', 'replace', 'TEMP_HK32F030CBT6']
names = os.listdir(src)
for name in names:
if name == soc:
soc_dir.append(name)
#tools.print_debug(soc_dir)
return soc_dir
srcname = os.path.join(src, name)
if not os.path.isdir(srcname):
continue
sub_soc_dir = find_soc(srcname, soc)
if len(sub_soc_dir) > 1:
soc_dir.extend(sub_soc_dir)
#tools.print_debug(soc_dir)
return soc_dir
#tools.print_debug(soc_dir)
return soc_dir
def copytree(src, dst, ignore, symlinks=False):
names = os.listdir(src)
if not os.path.isdir(dst):
os.makedirs(dst)
errors = []
for name in names:
if isinstance(ignore, list):
if name in ignore:
continue
elif isinstance(ignore, str):
if name == ignore:
continue
srcname = os.path.join(src, name)
dstname = os.path.join(dst, name)
try:
if symlinks and os.path.islink(srcname):
linkto = os.readlink(srcname)
os.symlink(linkto, dstname)
elif os.path.isdir(srcname):
copytree(srcname, dstname, ignore, symlinks)
else:
if os.path.isdir(dstname):
os.rmdir(dstname)
elif os.path.isfile(dstname):
os.remove(dstname)
shutil.copy2(srcname, dstname)
except (IOError, os.error) as why:
errors.append((srcname, dstname, str(why)))
except OSError as err:
errors.extend(err.args[0])
def template(source_path, g):
target_path = os.path.join(source_path, 'target')
for item in g:
if 'TEMP_' in item:
soc = item
print_info(source_path)
print_info(target_path)
print_info(soc)
if os.path.exists(target_path):
shutil.rmtree(target_path)
# find soc dir
soc_dir = find_soc(source_path, soc)
print_info("soc_dir")
print(soc_dir)
#soc_dir = ['hk32-common', 'replace', 'HK32F030', 'replace', 'TEMP_HK32F030CBT6']
if len(soc_dir) < 2:
print_warn("invalid soc_dir %s" % soc_dir)
return None
# copy replace files
replace_path = source_path
copytree(replace_path, target_path, ['replace', 'generate.py'])
for i in range(1, len(soc_dir)):
if i % 2 == 1 and soc_dir[i] != 'replace':
print_warn("invalid soc_dir %s\n"
"soc_dir[%d] is %s, expect 'replace'"
% (soc_dir, i, soc_dir[i]))
return None
replace_path = os.path.join(replace_path, soc_dir[i])
if soc_dir[i] == 'replace':
continue
copytree(replace_path, target_path, ['replace', 'generate.py'])
return target_path
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

OneOS是中国移动针对物联网领域推出的轻量级操作系统,具有可裁剪、跨平台、低功耗、高安全等特点,支持ARM Cortex-M/R/A、MIPS、RISC-V等主流CPU架构,兼容POSIX、CMSIS等标准接口,支持Micropython语言开发,提供图形化开发工具,能够有效提高开发效率并降低开发成本,帮助客户开发稳定可靠、安全易用的物联网应用。 官网地址:https://os.iot.10086.cn/
暂无标签
Apache-2.0
使用 Apache-2.0 开源许可协议
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/liak-git/OneOS.git
git@gitee.com:liak-git/OneOS.git
liak-git
OneOS
OneOS
dev
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /