环境: 可以科学上网的 Ubuntu20.04
先决条件
sudo apt install \
android-tools-adb \
android-tools-fastboot \
autoconf \
automake \
bc \
bison \
build-essential \
ccache \
cscope \
curl \
device-tree-compiler \
expect \
flex \
ftp-upload \
gdisk \
iasl \
libattr1-dev \
libcap-dev \
libfdt-dev \
libftdi-dev \
libglib2.0-dev \
libgmp3-dev \
libhidapi-dev \
libmpc-dev \
libncurses5-dev \
libpixman-1-dev \
libssl-dev \
libtool \
make \
mtools \
netcat \
ninja-build \
python3-crypto \
python3-cryptography \
python3-pip \
python3-pyelftools \
python3-serial \
rsync \
unzip \
uuid-dev \
xdg-utils \
xterm \
xz-utils \
zlib1g-dev
sudo ln -s /usr/bin/python3 /usr/bin/python
安装 repo
- 安装 git 并配置信息
sudo apt install git
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
- 安装 repo
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
获取源代码 (默认QEMU v7版本)
mkdir optee
cd optee
repo init -u https://github.com/OP-TEE/manifest.git
repo sync
获取 toolchains
cd build
make toolchains
运行 qemu
make run
此步正确运行后会弹出两个终端(Normal World 和 Secure World),显示如下:
如果此步失败,可以多尝试几次。
在 qemu 终端输入c启动系统:
(qemu) c
在 Normal World 终端输入 root 登录
运行 xtest 测试
xtest
如果成功,结果如下:
https://optee.readthedocs.io/en/latest/building/gits/build.html#
https://optee.readthedocs.io/en/latest/building/devices/qemu.html