blob: ed3f415c2b2cb3205d6a78edc5cd6d5676f43a10 [file] [log] [blame]
<html devsite><head>
<title>下载和编译</title>
<meta name="project_path" value="/_project.yaml"/>
<meta name="book_path" value="/_book.yaml"/>
</head>
<body>
<!--
Copyright 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<p><a href="https://android-review.googlesource.com/admin/repos/q/filter:trusty" class="external">Trusty 代码库</a>可在 Android 开源项目 (AOSP) 中获取。</p>
<p>点击以下链接可在 AOSP 中找到相应的 Trusty 内核分支:</p>
<ul>
<li><a class="external" href="https://android.googlesource.com/kernel/common/+/android-trusty-4.4">4.4</a></li>
<li><a class="external" href="https://android.googlesource.com/kernel/common/+/android-trusty-4.9">4.9</a></li>
<li><a class="external" href="https://android.googlesource.com/kernel/common/+/android-trusty-4.14">4.14</a></li>
</ul>
<h2 id="installing_repo">安装 Repo</h2>
<p>要下载 Trusty,请先<a href="/setup/build/downloading#installing-repo">下载并安装 Repo</a></p>
<p>成功安装 Repo 后,您可以克隆 Android Trusty 代码库。</p>
<pre class="prettyprint">
<code class="devsite-terminal">mkdir trusty</code>
<code class="devsite-terminal">cd trusty</code>
<code class="devsite-terminal">repo init -u https://android.googlesource.com/trusty/manifest -b master</code>
<code class="devsite-terminal">repo sync -j32</code>
</pre>
<h3 id="build">编译</h3>
<p>请使用以下代码为 Trusty 编译通用 arm64 映像。
</p><pre class="devsite-terminal devsite-click-to-copy">
./trusty/vendor/google/aosp/scripts/build.py generic-arm64
</pre>
<p>编译结果位于 <code>build-root/build-generic-arm64/.</code> 下。请查找 lk.bin,这是一个 TEE 映像,其中包含在以下位置编译的所有应用:</p>
<pre class="devsite-terminal devsite-click-to-copy">
ls build-root/build-generic-arm64/lk.bin
</pre>
<h3 id="install">安装</h3>
<p>您可以将 lk.bin 汇编到固件映像中,然后将其刷入设备。生成的固件映像因所使用的开发板而异。如需了解相关说明,请与开发板制造商联系。</p>
</body></html>