Trusty 儲存庫可在 Android 開源專案 (AOSP) 中找到。
使用這些連結在 AOSP 中尋找適當的 Trusty 核心分支:
安裝倉庫
若要下載 Trusty,請先下載並安裝 Repo 。
成功安裝 Repo 後,您可以複製 Android Trusty 儲存庫。
mkdir trusty
cd trusty
repo init -u https://android.googlesource.com/trusty/manifest -b main
repo sync -j32
建造
使用下列指令為 Trusty 建立通用 arm64 映像。
./trusty/vendor/google/aosp/scripts/build.py generic-arm64
建置結果將位於build-root/build-generic-arm64/.
尋找 lk.bin,它是一個 TEE 映像,其中包含編譯的所有應用程式:
ls build-root/build-generic-arm64/lk.bin
安裝
您可以將 lk.bin 組裝成韌體映像並將其刷新到裝置。產生韌體映像因所使用的板而異。請聯絡您的電路板製造商以取得說明。
值得信賴的 QEMU
如果尚未安裝,請在主機上安裝所需的軟體包:
sudo apt install libpixman-1-dev libstdc++-8-dev pkg-config libglib2.0-dev libusb-1.0-0-dev
建置(使用建置伺服器腳本)trusty 和 qemu 鏡像:
trusty/vendor/google/aosp/scripts/build.py qemu-generic-arm64-test-debug
這也將運行為此目標配置的所有測試。
若要手動執行測試運行程式測試(連接埠啟動)(com.android.ipc-unittest.ctrl):
build-root/build-qemu-generic-arm64-test-debug/run --headless --boot-test "com.android.ipc-unittest.ctrl"
要在啟動時使用核心偵錯輸出執行測試執行程式測試 (com.android.ipc-unittest.ctrl):
build-root/build-qemu-generic-arm64-test-debug/run-qemu --boot-test "com.android.ipc-unittest.ctrl" --headless --verbose
ATF 在返回測試運行程序之前禁用控制台。若要在本機上停用此功能,請註解掉 external/arm-trusted-firmware/plat/common/aarch64/plat_common.c 中 bl31_plat_runtime_setup 中的所有程式碼。
要從 Android shell 執行測試,
build-root/build-qemu-generic-arm64-test-debug/run-qemu --shell-command "/data/nativetest64/tipc-test/tipc-test -t ta2ta-ipc" --headless
啟動到互動式 shell(從簽入的預先建置)
build-root/build-qemu-generic-arm64-test-debug/run
該命令還有各種其他可用的覆蓋 - check --help 以了解更多資訊。
如果adb devices -l
在運行qmeu.py
時失敗,則系統上運行的 adb 伺服器版本可能是錯誤的版本。
adb kill-server
要啟動本地的 Android 版本,
build-root/build-qemu-generic-arm64-test-debug/run --android path/to/your/android/source/dir
要為 Trusty 建立 Android,
mkdir android cd android repo init -u https://android.googlesource.com/platform/manifest -b main repo sync -j32 source build/envsetup.sh lunch qemu_trusty_arm64-userdebug m