Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 1 | # |
| 2 | # Common definition to all platforms |
| 3 | # |
| 4 | |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 5 | BASH ?= bash |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 6 | ROOT ?= $(shell pwd)/.. |
| 7 | |
Philip Attfield | 3f9250f | 2016-09-14 07:43:32 +0200 | [diff] [blame] | 8 | BUILD_PATH ?= $(ROOT)/build |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 9 | LINUX_PATH ?= $(ROOT)/linux |
Victor Chong | 9f0d120 | 2016-04-23 16:28:31 +0100 | [diff] [blame] | 10 | OPTEE_GENDRV_MODULE ?= $(LINUX_PATH)/drivers/tee/optee/optee.ko |
Pascal Brand | 440ef9c | 2015-09-08 16:01:58 +0200 | [diff] [blame] | 11 | GEN_ROOTFS_PATH ?= $(ROOT)/gen_rootfs |
| 12 | GEN_ROOTFS_FILELIST ?= $(GEN_ROOTFS_PATH)/filelist-tee.txt |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 13 | OPTEE_OS_PATH ?= $(ROOT)/optee_os |
| 14 | OPTEE_CLIENT_PATH ?= $(ROOT)/optee_client |
| 15 | OPTEE_CLIENT_EXPORT ?= $(OPTEE_CLIENT_PATH)/out/export |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 16 | OPTEE_TEST_PATH ?= $(ROOT)/optee_test |
| 17 | OPTEE_TEST_OUT_PATH ?= $(ROOT)/optee_test/out |
Victor Chong | 8519bcf | 2016-07-15 08:43:03 +0100 | [diff] [blame] | 18 | HELLOWORLD_PATH ?= $(ROOT)/hello_world |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 19 | |
Pascal Brand | 23ef205 | 2016-03-09 15:25:01 +0100 | [diff] [blame] | 20 | CFG_TEE_CORE_LOG_LEVEL ?= 3 |
| 21 | |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 22 | CCACHE ?= $(shell which ccache) # Don't remove this comment (space is needed) |
| 23 | |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 24 | |
| 25 | ################################################################################ |
| 26 | # Check coherency of compilation mode |
| 27 | ################################################################################ |
| 28 | |
| 29 | ifneq ($(COMPILE_NS_USER),) |
| 30 | ifeq ($(COMPILE_NS_KERNEL),) |
| 31 | $(error COMPILE_NS_KERNEL must be defined as COMPILE_NS_USER=$(COMPILE_NS_USER) is defined) |
| 32 | endif |
| 33 | ifeq (,$(filter $(COMPILE_NS_USER),32 64)) |
| 34 | $(error COMPILE_NS_USER=$(COMPILE_NS_USER) - Should be 32 or 64) |
| 35 | endif |
| 36 | endif |
| 37 | |
| 38 | ifneq ($(COMPILE_NS_KERNEL),) |
| 39 | ifeq ($(COMPILE_NS_USER),) |
| 40 | $(error COMPILE_NS_USER must be defined as COMPILE_NS_KERNEL=$(COMPILE_NS_KERNEL) is defined) |
| 41 | endif |
| 42 | ifeq (,$(filter $(COMPILE_NS_KERNEL),32 64)) |
| 43 | $(error COMPILE_NS_KERNEL=$(COMPILE_NS_KERNEL) - Should be 32 or 64) |
| 44 | endif |
| 45 | endif |
| 46 | |
| 47 | ifeq ($(COMPILE_NS_KERNEL),32) |
| 48 | ifneq ($(COMPILE_NS_USER),32) |
| 49 | $(error COMPILE_NS_USER=$(COMPILE_NS_USER) - Should be 32 as COMPILE_NS_KERNEL=$(COMPILE_NS_KERNEL)) |
| 50 | endif |
| 51 | endif |
| 52 | |
| 53 | ifneq ($(COMPILE_S_USER),) |
| 54 | ifeq ($(COMPILE_S_KERNEL),) |
| 55 | $(error COMPILE_S_KERNEL must be defined as COMPILE_S_USER=$(COMPILE_S_USER) is defined) |
| 56 | endif |
| 57 | ifeq (,$(filter $(COMPILE_S_USER),32 64)) |
| 58 | $(error COMPILE_S_USER=$(COMPILE_S_USER) - Should be 32 or 64) |
| 59 | endif |
| 60 | endif |
| 61 | |
| 62 | ifneq ($(COMPILE_S_KERNEL),) |
| 63 | OPTEE_OS_COMMON_EXTRA_FLAGS ?= O=out/arm |
| 64 | OPTEE_OS_BIN ?= $(OPTEE_OS_PATH)/out/arm/core/tee.bin |
| 65 | ifeq ($(COMPILE_S_USER),) |
| 66 | $(error COMPILE_S_USER must be defined as COMPILE_S_KERNEL=$(COMPILE_S_KERNEL) is defined) |
| 67 | endif |
| 68 | ifeq (,$(filter $(COMPILE_S_KERNEL),32 64)) |
| 69 | $(error COMPILE_S_KERNEL=$(COMPILE_S_KERNEL) - Should be 32 or 64) |
| 70 | endif |
| 71 | endif |
| 72 | |
| 73 | ifeq ($(COMPILE_S_KERNEL),32) |
| 74 | ifneq ($(COMPILE_S_USER),32) |
| 75 | $(error COMPILE_S_USER=$(COMPILE_S_USER) - Should be 32 as COMPILE_S_KERNEL=$(COMPILE_S_KERNEL)) |
| 76 | endif |
| 77 | endif |
| 78 | |
| 79 | |
| 80 | ################################################################################ |
| 81 | # set the compiler when COMPILE_xxx are defined |
| 82 | ################################################################################ |
Pascal Brand | efe5659 | 2016-03-03 10:46:52 +0100 | [diff] [blame] | 83 | CROSS_COMPILE_NS_USER ?= "$(CCACHE)$(AARCH$(COMPILE_NS_USER)_CROSS_COMPILE)" |
| 84 | CROSS_COMPILE_NS_KERNEL ?= "$(CCACHE)$(AARCH$(COMPILE_NS_KERNEL)_CROSS_COMPILE)" |
| 85 | CROSS_COMPILE_S_USER ?= "$(CCACHE)$(AARCH$(COMPILE_S_USER)_CROSS_COMPILE)" |
| 86 | CROSS_COMPILE_S_KERNEL ?= "$(CCACHE)$(AARCH$(COMPILE_S_KERNEL)_CROSS_COMPILE)" |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 87 | |
| 88 | ifeq ($(COMPILE_S_USER),32) |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 89 | OPTEE_OS_TA_DEV_KIT_DIR ?= $(OPTEE_OS_PATH)/out/arm/export-ta_arm32 |
| 90 | endif |
| 91 | ifeq ($(COMPILE_S_USER),64) |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 92 | OPTEE_OS_TA_DEV_KIT_DIR ?= $(OPTEE_OS_PATH)/out/arm/export-ta_arm64 |
| 93 | endif |
| 94 | |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 95 | ifeq ($(COMPILE_S_KERNEL),64) |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 96 | OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_ARM64_core=y |
| 97 | endif |
| 98 | |
| 99 | |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 100 | ################################################################################ |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 101 | # defines, macros, configuration etc |
| 102 | ################################################################################ |
| 103 | define KERNEL_VERSION |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 104 | $(shell cd $(LINUX_PATH) && $(MAKE) --no-print-directory kernelversion) |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 105 | endef |
| 106 | DEBUG ?= 0 |
| 107 | |
| 108 | ################################################################################ |
Pascal Brand | cb45260 | 2015-10-13 10:46:33 +0200 | [diff] [blame] | 109 | # default target is all |
| 110 | ################################################################################ |
| 111 | all: |
| 112 | |
| 113 | ################################################################################ |
Pascal Brand | 440ef9c | 2015-09-08 16:01:58 +0200 | [diff] [blame] | 114 | # Busybox |
| 115 | ################################################################################ |
| 116 | BUSYBOX_COMMON_TARGET ?= TOBEDEFINED |
| 117 | BUSYBOX_CLEAN_COMMON_TARGET ?= TOBEDEFINED |
Pascal Brand | 440ef9c | 2015-09-08 16:01:58 +0200 | [diff] [blame] | 118 | |
| 119 | busybox-common: linux |
| 120 | cd $(GEN_ROOTFS_PATH) && \ |
Pascal Brand | efe5659 | 2016-03-03 10:46:52 +0100 | [diff] [blame] | 121 | CROSS_COMPILE=$(CROSS_COMPILE_NS_USER) \ |
Pascal Brand | 440ef9c | 2015-09-08 16:01:58 +0200 | [diff] [blame] | 122 | PATH=${PATH}:$(LINUX_PATH)/usr \ |
| 123 | $(GEN_ROOTFS_PATH)/generate-cpio-rootfs.sh \ |
| 124 | $(BUSYBOX_COMMON_TARGET) |
| 125 | |
| 126 | busybox-clean-common: |
| 127 | cd $(GEN_ROOTFS_PATH) && \ |
| 128 | $(GEN_ROOTFS_PATH)/generate-cpio-rootfs.sh \ |
| 129 | $(BUSYBOX_CLEAN_COMMON_TARGET) |
| 130 | |
| 131 | busybox-cleaner-common: |
| 132 | rm -rf $(GEN_ROOTFS_PATH)/build |
| 133 | rm -rf $(GEN_ROOTFS_PATH)/filelist-final.txt |
Victor Chong | 87f5fcf | 2015-11-26 10:52:52 +0900 | [diff] [blame] | 134 | |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 135 | ################################################################################ |
| 136 | # Linux |
| 137 | ################################################################################ |
| 138 | LINUX_COMMON_FLAGS ?= LOCALVERSION= CROSS_COMPILE=$(CROSS_COMPILE_NS_KERNEL) |
| 139 | |
| 140 | linux-common: linux-defconfig |
| 141 | $(MAKE) -C $(LINUX_PATH) $(LINUX_COMMON_FLAGS) |
| 142 | |
Jerome Forissier | e100238 | 2015-11-26 11:36:00 +0100 | [diff] [blame] | 143 | $(LINUX_PATH)/.config: $(LINUX_DEFCONFIG_COMMON_FILES) |
| 144 | cd $(LINUX_PATH) && \ |
| 145 | ARCH=$(LINUX_DEFCONFIG_COMMON_ARCH) \ |
| 146 | scripts/kconfig/merge_config.sh $(LINUX_DEFCONFIG_COMMON_FILES) |
| 147 | |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 148 | linux-defconfig-clean-common: |
Victor Chong | 87f5fcf | 2015-11-26 10:52:52 +0900 | [diff] [blame] | 149 | rm -f $(LINUX_PATH)/.config |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 150 | |
Victor Chong | 87f5fcf | 2015-11-26 10:52:52 +0900 | [diff] [blame] | 151 | # LINUX_CLEAN_COMMON_FLAGS can be defined in specific makefiles (hikey.mk,...) |
| 152 | # if necessary |
| 153 | |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 154 | linux-clean-common: linux-defconfig-clean |
| 155 | $(MAKE) -C $(LINUX_PATH) $(LINUX_CLEAN_COMMON_FLAGS) clean |
| 156 | |
Victor Chong | 87f5fcf | 2015-11-26 10:52:52 +0900 | [diff] [blame] | 157 | # LINUX_CLEANER_COMMON_FLAGS can be defined in specific makefiles (hikey.mk,...) |
| 158 | # if necessary |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 159 | |
| 160 | linux-cleaner-common: linux-defconfig-clean |
Victor Chong | 87f5fcf | 2015-11-26 10:52:52 +0900 | [diff] [blame] | 161 | $(MAKE) -C $(LINUX_PATH) $(LINUX_CLEANER_COMMON_FLAGS) distclean |
Pascal Brand | e3d8598 | 2015-09-10 17:20:42 +0200 | [diff] [blame] | 162 | |
Pascal Brand | 440ef9c | 2015-09-08 16:01:58 +0200 | [diff] [blame] | 163 | ################################################################################ |
Pascal Brand | 9a0f50f | 2015-09-08 15:34:17 +0200 | [diff] [blame] | 164 | # EDK2 / Tianocore |
| 165 | ################################################################################ |
| 166 | # Make sure edksetup.sh only will be called once and that we don't rebuild |
| 167 | # BaseTools again and again. |
| 168 | $(EDK2_PATH)/Conf/target.txt: |
| 169 | set -e && cd $(EDK2_PATH) && $(BASH) edksetup.sh && \ |
| 170 | $(MAKE) -j1 -C $(EDK2_PATH)/BaseTools |
| 171 | |
| 172 | edk2-common: $(EDK2_PATH)/Conf/target.txt |
| 173 | set -e && cd $(EDK2_PATH) && $(BASH) edksetup.sh && \ |
| 174 | $(call edk2-call) |
| 175 | |
| 176 | edk2-clean-common: |
| 177 | set -e && cd $(EDK2_PATH) && $(BASH) edksetup.sh && \ |
| 178 | $(call edk2-call) clean && \ |
| 179 | $(MAKE) -j1 -C $(EDK2_PATH)/BaseTools clean && \ |
| 180 | rm -f $(EDK2_PATH)/Conf/target.txt |
| 181 | |
| 182 | ################################################################################ |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 183 | # OP-TEE |
| 184 | ################################################################################ |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 185 | OPTEE_OS_COMMON_FLAGS ?= \ |
| 186 | $(OPTEE_OS_COMMON_EXTRA_FLAGS) \ |
| 187 | CROSS_COMPILE=$(CROSS_COMPILE_S_USER) \ |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 188 | CROSS_COMPILE_core=$(CROSS_COMPILE_S_KERNEL) \ |
Victor Chong | badc792 | 2015-12-08 17:23:20 +0000 | [diff] [blame] | 189 | CROSS_COMPILE_ta_arm64=$(AARCH64_CROSS_COMPILE) \ |
| 190 | CROSS_COMPILE_ta_arm32=$(AARCH32_CROSS_COMPILE) \ |
Pascal Brand | 23ef205 | 2016-03-09 15:25:01 +0100 | [diff] [blame] | 191 | CFG_TEE_CORE_LOG_LEVEL=$(CFG_TEE_CORE_LOG_LEVEL) \ |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 192 | DEBUG=$(DEBUG) |
| 193 | |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 194 | optee-os-common: |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 195 | $(MAKE) -C $(OPTEE_OS_PATH) $(OPTEE_OS_COMMON_FLAGS) |
| 196 | |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 197 | OPTEE_OS_CLEAN_COMMON_FLAGS ?= $(OPTEE_OS_COMMON_EXTRA_FLAGS) |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 198 | |
Victor Chong | 8519bcf | 2016-07-15 08:43:03 +0100 | [diff] [blame] | 199 | optee-os-clean-common: xtest-clean helloworld-clean |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 200 | $(MAKE) -C $(OPTEE_OS_PATH) $(OPTEE_OS_CLEAN_COMMON_FLAGS) clean |
| 201 | |
| 202 | OPTEE_CLIENT_COMMON_FLAGS ?= CROSS_COMPILE=$(CROSS_COMPILE_NS_USER) |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 203 | |
| 204 | optee-client-common: |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 205 | $(MAKE) -C $(OPTEE_CLIENT_PATH) $(OPTEE_CLIENT_COMMON_FLAGS) |
| 206 | |
Victor Chong | 87f5fcf | 2015-11-26 10:52:52 +0900 | [diff] [blame] | 207 | # OPTEE_CLIENT_CLEAN_COMMON_FLAGS can be defined in specific makefiles |
| 208 | # (hikey.mk,...) if necessary |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 209 | |
| 210 | optee-client-clean-common: |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 211 | $(MAKE) -C $(OPTEE_CLIENT_PATH) $(OPTEE_CLIENT_CLEAN_COMMON_FLAGS) \ |
| 212 | clean |
| 213 | |
Pascal Brand | 070d955 | 2015-09-01 15:33:22 +0200 | [diff] [blame] | 214 | ################################################################################ |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 215 | # xtest / optee_test |
| 216 | ################################################################################ |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 217 | XTEST_COMMON_FLAGS ?= CROSS_COMPILE_HOST=$(CROSS_COMPILE_NS_USER)\ |
| 218 | CROSS_COMPILE_TA=$(CROSS_COMPILE_S_USER) \ |
| 219 | TA_DEV_KIT_DIR=$(OPTEE_OS_TA_DEV_KIT_DIR) \ |
Etienne Carriere | 5e11351 | 2016-10-21 10:13:57 +0200 | [diff] [blame^] | 220 | OPTEE_CLIENT_EXPORT=$(OPTEE_CLIENT_EXPORT) \ |
Pascal Brand | 6044eb5 | 2016-02-23 15:48:31 +0100 | [diff] [blame] | 221 | COMPILE_NS_USER=$(COMPILE_NS_USER) \ |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 222 | O=$(OPTEE_TEST_OUT_PATH) |
| 223 | |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 224 | xtest-common: optee-os optee-client |
Pascal Brand | dc83b9a | 2015-09-24 02:43:25 +0200 | [diff] [blame] | 225 | $(MAKE) -C $(OPTEE_TEST_PATH) $(XTEST_COMMON_FLAGS) |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 226 | |
Victor Chong | 87f5fcf | 2015-11-26 10:52:52 +0900 | [diff] [blame] | 227 | XTEST_CLEAN_COMMON_FLAGS ?= TA_DEV_KIT_DIR=$(OPTEE_OS_TA_DEV_KIT_DIR) |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 228 | |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 229 | xtest-clean-common: |
Pascal Brand | dc83b9a | 2015-09-24 02:43:25 +0200 | [diff] [blame] | 230 | $(MAKE) -C $(OPTEE_TEST_PATH) $(XTEST_CLEAN_COMMON_FLAGS) clean |
Pascal Brand | d6536da | 2015-09-01 10:38:43 +0200 | [diff] [blame] | 231 | |
Pascal Brand | dc83b9a | 2015-09-24 02:43:25 +0200 | [diff] [blame] | 232 | XTEST_PATCH_COMMON_FLAGS ?= $(XTEST_COMMON_FLAGS) |
Jerome Forissier | ae45fbf | 2015-09-04 09:40:17 +0200 | [diff] [blame] | 233 | |
Pascal Brand | dc83b9a | 2015-09-24 02:43:25 +0200 | [diff] [blame] | 234 | xtest-patch-common: |
| 235 | $(MAKE) -C $(OPTEE_TEST_PATH) $(XTEST_PATCH_COMMON_FLAGS) patch |
Victor Chong | 8519bcf | 2016-07-15 08:43:03 +0100 | [diff] [blame] | 236 | |
| 237 | ################################################################################ |
| 238 | # hello_world |
| 239 | ################################################################################ |
| 240 | HELLOWORLD_COMMON_FLAGS ?= HOST_CROSS_COMPILE=$(CROSS_COMPILE_NS_USER)\ |
| 241 | TA_CROSS_COMPILE=$(CROSS_COMPILE_S_USER) \ |
| 242 | TA_DEV_KIT_DIR=$(OPTEE_OS_TA_DEV_KIT_DIR) \ |
| 243 | TEEC_EXPORT=$(OPTEE_CLIENT_EXPORT) |
| 244 | |
| 245 | helloworld-common: optee-os optee-client |
| 246 | $(MAKE) -C $(HELLOWORLD_PATH) $(HELLOWORLD_COMMON_FLAGS) |
| 247 | |
| 248 | HELLOWORLD_CLEAN_COMMON_FLAGS ?= TA_DEV_KIT_DIR=$(OPTEE_OS_TA_DEV_KIT_DIR) |
| 249 | |
| 250 | helloworld-clean-common: |
| 251 | $(MAKE) -C $(HELLOWORLD_PATH) $(HELLOWORLD_CLEAN_COMMON_FLAGS) clean |
Etienne Carriere | 5e11351 | 2016-10-21 10:13:57 +0200 | [diff] [blame^] | 252 | |
| 253 | ################################################################################ |
| 254 | # rootfs |
| 255 | ################################################################################ |
| 256 | update_rootfs-common: busybox filelist-tee |
| 257 | cat $(GEN_ROOTFS_PATH)/filelist-final.txt > $(GEN_ROOTFS_PATH)/filelist.tmp |
| 258 | cat $(GEN_ROOTFS_FILELIST) >> $(GEN_ROOTFS_PATH)/filelist.tmp |
| 259 | cd $(GEN_ROOTFS_PATH) && \ |
| 260 | $(LINUX_PATH)/usr/gen_init_cpio $(GEN_ROOTFS_PATH)/filelist.tmp | \ |
| 261 | gzip > $(GEN_ROOTFS_PATH)/filesystem.cpio.gz |
| 262 | |
| 263 | update_rootfs-clean-common: |
| 264 | rm -f $(GEN_ROOTFS_PATH)/filesystem.cpio.gz |
| 265 | rm -f $(GEN_ROOTFS_PATH)/filelist-all.txt |
| 266 | rm -f $(GEN_ROOTFS_PATH)/filelist-tmp.txt |
| 267 | rm -f $(GEN_ROOTFS_FILELIST) |
| 268 | |
| 269 | filelist-tee-common: fl:=$(GEN_ROOTFS_FILELIST) |
| 270 | filelist-tee-common: optee-client xtest helloworld |
| 271 | @echo "# filelist-tee-common /start" > $(fl) |
| 272 | @echo "dir /lib/optee_armtz 755 0 0" >> $(fl) |
| 273 | @echo "# xtest / optee_test" >> $(fl) |
| 274 | @find $(OPTEE_TEST_OUT_PATH) -type f -name "xtest" | \ |
| 275 | sed 's/\(.*\)/file \/bin\/xtest \1 755 0 0/g' >> $(fl) |
| 276 | @find $(OPTEE_TEST_OUT_PATH) -name "*.ta" | \ |
| 277 | sed 's/\(.*\)\/\(.*\)/file \/lib\/optee_armtz\/\2 \1\/\2 444 0 0/g' \ |
| 278 | >> $(fl) |
| 279 | @if [ -e $(HELLOWORLD_PATH)/host/hello_world ]; then \ |
| 280 | echo "file /bin/hello_world" \ |
| 281 | "$(HELLOWORLD_PATH)/host/hello_world 755 0 0" >> $(fl); \ |
| 282 | echo "file /lib/optee_armtz/8aaaf200-2450-11e4-abe20002a5d5c51b.ta" \ |
| 283 | "$(HELLOWORLD_PATH)/ta/8aaaf200-2450-11e4-abe20002a5d5c51b.ta" \ |
| 284 | "444 0 0" >> $(fl); \ |
| 285 | fi |
| 286 | @echo "# Secure storage dir" >> $(fl) |
| 287 | @echo "dir /data 755 0 0" >> $(fl) |
| 288 | @echo "dir /data/tee 755 0 0" >> $(fl) |
| 289 | @if [ -e $(OPTEE_GENDRV_MODULE) ]; then \ |
| 290 | echo "# OP-TEE device" >> $(fl); \ |
| 291 | echo "dir /lib/modules 755 0 0" >> $(fl); \ |
| 292 | echo "dir /lib/modules/$(call KERNEL_VERSION) 755 0 0" \ |
| 293 | >> $(fl); \ |
| 294 | echo "file /lib/modules/$(call KERNEL_VERSION)/optee.ko" \ |
| 295 | "$(OPTEE_GENDRV_MODULE) 755 0 0" \ |
| 296 | >> $(fl); \ |
| 297 | fi |
| 298 | @echo "# OP-TEE Client" >> $(fl) |
| 299 | @echo "file /bin/tee-supplicant $(OPTEE_CLIENT_EXPORT)/bin/tee-supplicant 755 0 0" \ |
| 300 | >> $(fl) |
| 301 | @echo "file /lib/libteec.so.1.0 $(OPTEE_CLIENT_EXPORT)/lib/libteec.so.1.0 755 0 0" \ |
| 302 | >> $(fl) |
| 303 | @echo "slink /lib/libteec.so.1 libteec.so.1.0 755 0 0" >> $(fl) |
| 304 | @echo "slink /lib/libteec.so libteec.so.1 755 0 0" >> $(fl) |
| 305 | @if [ -e $(OPTEE_CLIENT_EXPORT)/lib/libsqlfs.so.1.0 ]; then \ |
| 306 | echo "file /lib/libsqlfs.so.1.0" \ |
| 307 | "$(OPTEE_CLIENT_EXPORT)/lib/libsqlfs.so.1.0 755 0 0" \ |
| 308 | >> $(fl); \ |
| 309 | echo "slink /lib/libsqlfs.so.1 libsqlfs.so.1.0 755 0 0" >> $(fl); \ |
| 310 | echo "slink /lib/libsqlfs.so libsqlfs.so.1 755 0 0" >> $(fl); \ |
| 311 | fi |
| 312 | @echo "# filelist-tee-common /end" >> $(fl) |