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