0.使用Qemu运行OPTEE-问题集合
(拾人牙慧的 第一天,人生无常,大肠包小肠。)
最近在按照前辈的教程学习TEE技术,遇到一些问题,记录解决方法合集如下。
优快云教程链接:
https://icyshuai.blog.youkuaiyun.com/article/details/71499619
1.repo 用的是python2,但repo ini 过程中使用的main.py支持的是python3,造成了版本不兼容的问题,暂时没学会高明的解决方法,我先用python2运行了一次repo ini,再用python3运行一次repo ini成功了。
2.manifest.xml只有如下几行,查找其对应的include文件default_stable.xml,就可以看到所有内容。
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT EDIT THIS FILE! It is generated by repo and changes will be discarded.
If you want to use a different manifest, use `repo init -m <file>` instead.
If you want to customize your checkout by overriding manifest settings, use
the local_manifests/ directory instead.
For more information on repo manifests, check out:
https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
-->
<manifest>
<include name="default_stable.xml" />
</manifest>
3.因为原来的链接已经not found,busybox找不到,下载不到。将default_stable.xml文件中的链接改成https://git.busybox.net即可。
4.python安装Crypto等库时SSL验证不通过问题,添加–trusted-host pypi.python.org命令。
pip --trusted-host pypi.python.org install + 想要安装的包
5.python版本问题导致报错如Cannot use python
我当时用的是python3.6,不支持,切换python版本为2.7即可。
sudo update-alternatives --config python
如果没有添加则需要先找到对应的python路径,进行添加。sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 优先级
6.optee_os/scripts 文件夹里有些py文件存在错误,会导致报错。
例如:运行到gen_hashed_bin.py 文件的45行和55行报错truct.error: required argument is not an integer。这是因为传入的init_size参数不是整数引起的,将其做类型转化即可。
还有些因为编写错误导致的报错,打开对应文件修改即可,要改的地方不是很多。
后面跟着教程和B站啊棍棍老师的教程走即可,ok第一课历时两天终于成功啦。
(拉linux代码就拉了十小时,我恨,大家如果有更高效的方法欢迎评论区交流)