1# Binder for Trusty
2
3This is the Trusty port of the libbinder library.
4To build it, first you will need a checkout of the Trusty tree:
5```shell
6$ mkdir /path/to/trusty
7$ cd /path/to/trusty
8$ repo init -u https://android.googlesource.com/trusty/manifest -b master
9$ repo sync -j$(nproc) -c --no-tags
10```
11
12After the checkout is complete, you can use the `build.py` script for both
13building and testing Trusty. For a quick build without any tests, run:
14```shell
15$ ./trusty/vendor/google/aosp/scripts/build.py generic-arm64-test-debug
16```
17This will build the smaller `generic-arm64-test-debug` project which
18does not run any tests.
19
20The qemu-generic-arm64-test-debug` project includes the QEMU emulator and
21a full Trusty test suite, including a set of libbinder tests.
22To run the latter, use the command:
23```shell
24$ ./trusty/vendor/google/aosp/scripts/build.py \
25    --test "boot-test:com.android.trusty.binder.test" \
26    qemu-generic-arm64-test-debug
27```
28
29## Building AIDL files on Trusty
30To compile AIDL interfaces into Trusty libraries, include the `make/aidl.mk`
31in your `rules.mk` file, e.g.:
32```
33LOCAL_DIR := $(GET_LOCAL_DIR)
34
35MODULE := $(LOCAL_DIR)
36
37MODULE_AIDLS := \
38        $(LOCAL_DIR)/IFoo.aidl \
39
40include make/aidl.mk
41```
42
43## Examples
44The Trusty tree contains some sample test apps at
45`trusty/user/app/sample/binder-test`.
46