I have a question about the build-p.sh script. Does this script cover any changes made to AOSP files and files under optee/optee_os/ ? I remember in the past OPTEE needed separate compilation.
OP-TEE doesn’t need separate compilation. We’ve integrated it as part of the main AOSP build. That said, if you make any changes under optee/optee_os, optee_os and fip.bin might not be rebuild automatically due the make target missing a dependency. We’ll try to get the fix ‘loaded’ into our repos asap, but in the meantime, you can patch device/linaro/hikey manually as below.
index eb8100a6..bc6e1a1c 100644
--- a/build/tasks/build_uefi.mk
+++ b/build/tasks/build_uefi.mk
@@ -14,7 +14,13 @@ endif
HOST_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
-$(DIST_DIR_PRODUCT)/fip.bin: $(BOOTLOADER_DIR)/Makefile
+OPTEE_OS_DIR=optee/optee_os
+
+# rebuild fip.bin whenever optee_os is modified
+$(DIST_DIR_PRODUCT)/fip.bin: $(BOOTLOADER_DIR)/Makefile $(sort $(shell find -L
$(OPTEE_OS_DIR)))
rm -fr $(DIST_DIR_PRODUCT) $(OPTEE_OS_DIR)/out $(PRODUCT_OUT)/obj/optee
As for changes made to other AOSP files not related to OP-TEE, yes those should be covered as well as long as the Makefiles/Android.mk/Android.bp for them are written properly. The scripts are basically just wrappers around the ‘repo’ and ‘make’ commands with extra commands added to facilitate/automate patching for OP-TEE support and (hopefully) make it more user friendly.