Add README and update script for Trusty
Bug: 325156402
Test: update_emulator_trusty.sh 11897741
Test: repo init --standalone-manifest -u trusty-x86_64/manifest.xml
Change-Id: Ia5b8ae4ca9c1e793520a2912c48594d2e68e36e0
diff --git a/README.trusty.md b/README.trusty.md
new file mode 100644
index 0000000..2893125
--- /dev/null
+++ b/README.trusty.md
@@ -0,0 +1,18 @@
+# QEMU for Trusty
+
+The `trusty-x86_64` contains the binaries for the QEMU emulator
+used to test Trusty with Android.
+
+## Downloading the sources
+
+To download the exact repository used to build these binaries,
+run the following command:
+
+```
+$ repo init --standalone-manifest -u file://path/to/prebuilts/android-emulator/trusty-x86_64/manifest.xml
+```
+
+## Updating the binaries (for Googlers)
+
+Run `update_emulator_trusty.sh <BUILD_NUMBER>` with the build number as its
+only argument.
diff --git a/update_emulator_trusty.sh b/update_emulator_trusty.sh
new file mode 100755
index 0000000..3c2af49
--- /dev/null
+++ b/update_emulator_trusty.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+# Find builds here:
+# https://android-build.googleplex.com/builds/branches/aosp-emu-dev/grid?
+set -e
+
+if [ $# == 1 ]
+then
+build=$1
+else
+ echo Usage: $0 build
+ exit 1
+fi
+
+prebuilt_tool="/google/data/ro/projects/android/prebuilt_drop_tool/prebuilt_drop.par"
+
+common_args=()
+common_args+=(--build_id=$build)
+common_args+=(--target=trusty_tee-trusty_x64)
+common_args+=(--dest_host='https://android-review.googlesource.com')
+common_args+=(--dest_project='platform/prebuilts/android-emulator')
+common_args+=(--dest_git_branch=main)
+common_args+=(--topic="trusty_qemu_build_$build")
+
+$prebuilt_tool "${common_args[@]}" --source_dest_file_pair="manifest_$build.xml:trusty-x86_64/manifest.xml"
+$prebuilt_tool "${common_args[@]}" --source_dest_file_pair="sdk-repo-trusty_x64-qemu-$build.zip:trusty-x86_64/qemu.zip" --transform='unzip' --use_git