LoginSignup
1
1

More than 3 years have passed since last update.

Raspberry Pi3 用にOP-TEEをビルドする

Posted at

2020/8/18

Raspberry Pi3 用にOP-TEEをビルドする

OP-TEEのビルド、実行の流れ

  • ビルド自体はPCで行い、ビルドしたものをmicroSDカードに書き込み、ラズパイに差し込んで起動する

ビルド環境

  • Linuxでのビルドが推奨されているため、Windows10上でVitualboxを利用し、Ubuntu20.04.01でビルドを行った。

  • 詳細環境

    • Virtual Box:6.1.12
    • ホストOS:Windows10
    • ゲストOS:Ubuntu20.04.01
    • microSDカード:32GB

ビルド手順

  • i386アーキテクチャパッケージのインストールを有効にし、パッケージマネージャデータベースを更新
$ sudo dpkg --add-architecture i386
$ sudo apt update && sudo apt upgrade
  • OP-TEEのビルドにはgit、pythonが必要
$ sudo apt install git
$ sudo apt install python
  • 必要なパッケージをインストール
$ sudo apt-get install android-tools-adb android-tools-fastboot autoconf \
    automake bc bison build-essential cscope curl device-tree-compiler \
    expect flex ftp-upload gdisk iasl libattr1-dev libc6:i386 libcap-dev \
    libfdt-dev libftdi-dev libglib2.0-dev libhidapi-dev libncurses5-dev \
    libpixman-1-dev libssl-dev libstdc++6:i386 libtool libz1:i386 make \
    mtools netcat python-crypto python-wand unzip uuid-dev \
    xdg-utils xterm xz-utils zlib1g-dev

Android repoのインストール
- ディレクトリ、パスの設定

$ mkdir ~/bin
$ PATH=~/bin:$PATH
  • Repoツールをダウンロードし、実行可能であることを確認
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
  • gitのアカウント、パスワードを設定
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"
  • OP-TEEソースファイルをダウンロード
$ mkdir -p $HOME/devel/optee
$ cd $HOME/devel/optee
$ repo init -u https://github.com/OP-TEE/manifest.git -m rpi3.xml
$ repo sync
  • ツールチェーンの作成
$ cd build
$ make (必要なら:-j2) toolchains
  • OP-TEEのビルド
$ make
  • imgファイルへの展開
  • 表示された手順通りにSDカードへ書き込む
$ make img-help

OP-TEEのファイル構成(PC)

dir.png

参考

ビルドの記事
- https://optee.readthedocs.io/en/latest/building/devices/rpi3.html
- https://www.youtube.com/watch?v=-IcC2b3AJdA&t=246s
- https://blog.crysys.hu/2018/06/op-tee-default-build-and-installation-on-the-raspberry-pi/
エミュレータ
- https://lepidum.co.jp/blog/2020-03-13/tee/

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1