Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 1 | # Copyright (C) 2007 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 14 | |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 15 | LOCAL_PATH := $(call my-dir) |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 16 | commands_TWRP_local_path := $(LOCAL_PATH) |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 17 | |
Ethan Yonker | 66bcd49 | 2018-12-20 09:03:17 -0600 | [diff] [blame] | 18 | ifneq ($(project-path-for),) |
Matt Mower | 66766fe | 2014-10-06 18:03:39 -0500 | [diff] [blame] | 19 | ifeq ($(LOCAL_PATH),$(call project-path-for,recovery)) |
| 20 | PROJECT_PATH_AGREES := true |
bigbiff | 7df8747 | 2022-09-24 16:45:03 -0400 | [diff] [blame] | 21 | BOARD_VENDOR_SEPOLICY_DIRS += $(call project-path-for,recovery)/sepolicy |
Matt Mower | 66766fe | 2014-10-06 18:03:39 -0500 | [diff] [blame] | 22 | endif |
| 23 | else |
bigbiff | 7df8747 | 2022-09-24 16:45:03 -0400 | [diff] [blame] | 24 | $(warning BOARD_VENDOR_SEPOLICY_DIRS: $(LOCAL_PATH)) |
Matt Mower | 66766fe | 2014-10-06 18:03:39 -0500 | [diff] [blame] | 25 | ifeq ($(LOCAL_PATH),bootable/recovery) |
| 26 | PROJECT_PATH_AGREES := true |
bigbiff | 7df8747 | 2022-09-24 16:45:03 -0400 | [diff] [blame] | 27 | BOARD_VENDOR_SEPOLICY_DIRS += bootable/recovery/sepolicy |
| 28 | $(warning BOARD_VENDOR_SEPOLICY_DIRS2: $(BOARD_VENDOR_SEPOLICY_DIRS)) |
Ethan Yonker | f0a7e59 | 2019-04-04 10:06:41 -0500 | [diff] [blame] | 29 | else |
| 30 | ifeq ($(LOCAL_PATH),bootable/recovery-twrp) |
| 31 | ifeq ($(RECOVERY_VARIANT),twrp) |
| 32 | PROJECT_PATH_AGREES := true |
bigbiff | 7df8747 | 2022-09-24 16:45:03 -0400 | [diff] [blame] | 33 | BOARD_VENDOR_SEPOLICY_DIRS += bootable/recovery-twrp/sepolicy |
Ethan Yonker | f0a7e59 | 2019-04-04 10:06:41 -0500 | [diff] [blame] | 34 | endif |
| 35 | endif |
Matt Mower | 66766fe | 2014-10-06 18:03:39 -0500 | [diff] [blame] | 36 | endif |
Matt Mower | 55c75ca | 2014-08-31 11:30:15 -0500 | [diff] [blame] | 37 | endif |
| 38 | |
Matt Mower | 66766fe | 2014-10-06 18:03:39 -0500 | [diff] [blame] | 39 | ifeq ($(PROJECT_PATH_AGREES),true) |
Matt Mower | 55c75ca | 2014-08-31 11:30:15 -0500 | [diff] [blame] | 40 | |
Michael Bestas | 0cc2376 | 2018-07-13 21:37:56 +0300 | [diff] [blame] | 41 | ifeq ($(CM_PLATFORM_SDK_VERSION),) |
| 42 | CM_PLATFORM_SDK_VERSION := 0 |
| 43 | endif |
| 44 | |
Motorhead1991 | 75b6f66 | 2014-06-12 15:58:33 -0700 | [diff] [blame] | 45 | include $(CLEAR_VARS) |
| 46 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 47 | TARGET_RECOVERY_GUI := true |
Joe Onorato | 6396e70 | 2012-05-31 23:21:46 -0700 | [diff] [blame] | 48 | |
bigbiff | ee7b7ff | 2020-03-23 15:08:27 -0400 | [diff] [blame] | 49 | LOCAL_STATIC_LIBRARIES := |
| 50 | LOCAL_SHARED_LIBRARIES := |
| 51 | |
bigbiff bigbiff | 584b977 | 2016-12-08 21:21:17 -0500 | [diff] [blame] | 52 | ifneq ($(TW_DEVICE_VERSION),) |
| 53 | LOCAL_CFLAGS += -DTW_DEVICE_VERSION='"-$(TW_DEVICE_VERSION)"' |
| 54 | else |
| 55 | LOCAL_CFLAGS += -DTW_DEVICE_VERSION='"-0"' |
| 56 | endif |
dianlujitao | 4879b37 | 2018-12-03 18:45:47 +0800 | [diff] [blame] | 57 | LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
bigbiff bigbiff | 584b977 | 2016-12-08 21:21:17 -0500 | [diff] [blame] | 58 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 59 | LOCAL_SRC_FILES := \ |
Dees_Troy | 2673cec | 2013-04-02 20:22:16 +0000 | [diff] [blame] | 60 | twrp.cpp \ |
Ethan Yonker | b5fab76 | 2016-01-28 14:03:33 -0600 | [diff] [blame] | 61 | fixContexts.cpp \ |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 62 | twrpTar.cpp \ |
Ethan Yonker | 3fdcda4 | 2016-11-30 12:29:37 -0600 | [diff] [blame] | 63 | exclude.cpp \ |
Ethan Yonker | 1b7a31b | 2014-07-03 15:09:22 -0500 | [diff] [blame] | 64 | find_file.cpp \ |
bigbiff bigbiff | 56cf564 | 2016-08-19 17:43:45 -0400 | [diff] [blame] | 65 | infomanager.cpp \ |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 66 | data.cpp \ |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 67 | partition.cpp \ |
| 68 | partitionmanager.cpp \ |
Ethan Yonker | 472f506 | 2016-02-25 13:47:30 -0600 | [diff] [blame] | 69 | progresstracking.cpp \ |
bigbiff | df8436b | 2020-08-30 16:22:34 -0400 | [diff] [blame] | 70 | startupArgs.cpp \ |
Dees_Troy | 812660f | 2012-09-20 09:55:17 -0400 | [diff] [blame] | 71 | twrp-functions.cpp \ |
bigbiff bigbiff | 56cf564 | 2016-08-19 17:43:45 -0400 | [diff] [blame] | 72 | twrpDigestDriver.cpp \ |
Dees_Troy | e34c133 | 2013-02-06 19:13:00 +0000 | [diff] [blame] | 73 | openrecoveryscript.cpp \ |
bigbiff bigbiff | 19fb79c | 2016-09-05 21:04:51 -0400 | [diff] [blame] | 74 | tarWrite.c \ |
bigbiff | 32cbabe | 2020-04-12 19:16:19 -0400 | [diff] [blame] | 75 | twrpAdbBuFifo.cpp \ |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 76 | twrpRepacker.cpp |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 77 | |
bigbiff | 7992430 | 2021-05-02 20:06:09 -0400 | [diff] [blame] | 78 | ifeq ($(TW_EXCLUDE_APEX),) |
| 79 | LOCAL_SRC_FILES += twrpApex.cpp |
| 80 | else |
| 81 | LOCAL_CFLAGS += -DTW_EXCLUDE_APEX |
| 82 | endif |
| 83 | |
nebrassy | 335d07e | 2021-11-14 21:09:31 +0100 | [diff] [blame] | 84 | LOCAL_STATIC_LIBRARIES += libavb libtwrpinstall libminadbd_services libinit libsnapshot_nobinder update_metadata-protos |
tnakamur | 217c05e | 2022-05-13 08:57:04 +0900 | [diff] [blame] | 85 | LOCAL_SHARED_LIBRARIES += libfs_mgr libhardware android.hardware.boot@1.0 android.hardware.boot@1.1 android.hardware.boot@1.2 libprotobuf-cpp-lite liblp libutils libhidlbase |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 86 | LOCAL_C_INCLUDES += \ |
| 87 | system/core/fs_mgr/libfs_avb/include/ \ |
| 88 | system/core/fs_mgr/include_fstab/ \ |
| 89 | system/core/fs_mgr/include/ \ |
| 90 | system/core/fs_mgr/libdm/include/ \ |
| 91 | system/core/fs_mgr/liblp/include/ \ |
| 92 | system/gsid/include/ \ |
| 93 | system/core/init/ \ |
bigbiff | 1f9e484 | 2020-10-31 11:33:15 -0400 | [diff] [blame] | 94 | system/extras/ext4_utils/include \ |
bigbiff | df53b6c | 2022-01-17 19:31:52 -0500 | [diff] [blame] | 95 | system/vold |
bigbiff | ee7b7ff | 2020-03-23 15:08:27 -0400 | [diff] [blame] | 96 | |
Dees_Troy | a58bead | 2012-09-27 09:49:29 -0400 | [diff] [blame] | 97 | ifneq ($(TARGET_RECOVERY_REBOOT_SRC),) |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 98 | LOCAL_SRC_FILES += $(TARGET_RECOVERY_REBOOT_SRC) |
| 99 | endif |
| 100 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 101 | LOCAL_MODULE := recovery |
| 102 | |
Doug Zongker | e08991e | 2010-02-02 13:09:52 -0800 | [diff] [blame] | 103 | RECOVERY_API_VERSION := 3 |
Ken Sumrall | f35d1ce | 2013-02-13 12:59:35 -0800 | [diff] [blame] | 104 | RECOVERY_FSTAB_VERSION := 2 |
Doug Zongker | fb2e3af | 2009-06-17 17:29:40 -0700 | [diff] [blame] | 105 | LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) |
bigbiff | 7ba7500 | 2020-04-11 20:47:09 -0400 | [diff] [blame] | 106 | LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function |
Tao Bao | 80e46e0 | 2015-06-03 10:49:29 -0700 | [diff] [blame] | 107 | LOCAL_CLANG := true |
Doug Zongker | fb2e3af | 2009-06-17 17:29:40 -0700 | [diff] [blame] | 108 | |
Dan Albert | 1ddd350 | 2015-02-18 15:58:15 -0800 | [diff] [blame] | 109 | LOCAL_C_INCLUDES += \ |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 110 | bionic \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 111 | system/extras \ |
nebrassy | 204e36e | 2021-11-14 23:27:51 +0100 | [diff] [blame] | 112 | packages/modules/adb \ |
bigbiff | ce8f83c | 2015-12-12 18:30:21 -0500 | [diff] [blame] | 113 | system/core/libsparse \ |
bigbiff | df53b6c | 2022-01-17 19:31:52 -0500 | [diff] [blame] | 114 | system/vold \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 115 | external/zlib \ |
nebrassy | 204e36e | 2021-11-14 23:27:51 +0100 | [diff] [blame] | 116 | system/libziparchive/include \ |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 117 | external/freetype/include \ |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 118 | external/boringssl/include \ |
| 119 | external/libcxx/include \ |
| 120 | external/libselinux/include \ |
bigbiff | d81833a | 2021-01-17 11:06:57 -0500 | [diff] [blame] | 121 | external/libpng \ |
| 122 | $(LOCAL_PATH)/gui/include \ |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 123 | $(LOCAL_PATH)/recovery_ui/include \ |
| 124 | $(LOCAL_PATH)/otautil/include \ |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 125 | $(LOCAL_PATH)/install/include \ |
| 126 | $(LOCAL_PATH)/fuse_sideload/include \ |
| 127 | $(LOCAL_PATH)/install/include \ |
bigbiff | 673c7ae | 2020-12-02 19:44:56 -0500 | [diff] [blame] | 128 | $(LOCAL_PATH)/twrpinstall/include \ |
bigbiff | 91bd7a7 | 2021-01-03 17:33:01 -0500 | [diff] [blame] | 129 | $(LOCAL_PATH)/recovery_utils/include \ |
bigbiff | d81833a | 2021-01-17 11:06:57 -0500 | [diff] [blame] | 130 | $(LOCAL_PATH)/libpixelflinger/include \ |
| 131 | $(LOCAL_PATH)/minuitwrp/include \ |
| 132 | $(LOCAL_PATH)/twinstall/include |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 133 | |
bigbiff | df53b6c | 2022-01-17 19:31:52 -0500 | [diff] [blame] | 134 | LOCAL_STATIC_LIBRARIES += libguitwrp libvold |
bigbiff | 673c7ae | 2020-12-02 19:44:56 -0500 | [diff] [blame] | 135 | LOCAL_SHARED_LIBRARIES += libz libc libcutils libstdc++ libtar libblkid libminuitwrp libmtdutils libtwadbbu |
| 136 | LOCAL_SHARED_LIBRARIES += libbootloader_message libcrecovery libtwrpdigest libc++ libaosprecovery libcrypto libbase |
bigbiff | 91bd7a7 | 2021-01-03 17:33:01 -0500 | [diff] [blame] | 137 | LOCAL_SHARED_LIBRARIES += libziparchive libselinux libdl_android.bootstrap |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 138 | |
Dees_Troy | 4546fe7 | 2013-01-10 14:33:27 +0000 | [diff] [blame] | 139 | ifneq ($(wildcard system/core/libsparse/Android.mk),) |
| 140 | LOCAL_SHARED_LIBRARIES += libsparse |
| 141 | endif |
| 142 | |
Ethan Yonker | 7af51ce | 2014-04-04 13:33:30 -0500 | [diff] [blame] | 143 | ifeq ($(TW_OEM_BUILD),true) |
| 144 | LOCAL_CFLAGS += -DTW_OEM_BUILD |
| 145 | BOARD_HAS_NO_REAL_SDCARD := true |
| 146 | TW_USE_TOOLBOX := true |
bigbiff bigbiff | c7eee6f | 2014-09-02 18:59:01 -0400 | [diff] [blame] | 147 | TW_EXCLUDE_MTP := true |
Captain Throwback | 6443cef | 2021-01-30 12:26:25 -0500 | [diff] [blame] | 148 | TW_EXCLUDE_TZDATA := true |
nebrassy | 5078965 | 2021-02-12 23:36:44 +0100 | [diff] [blame] | 149 | TW_EXCLUDE_NANO := true |
DarthJabba9 | fba0cee | 2021-02-20 17:13:09 -0500 | [diff] [blame] | 150 | TW_EXCLUDE_BASH := true |
Ethan Yonker | 7af51ce | 2014-04-04 13:33:30 -0500 | [diff] [blame] | 151 | endif |
Yabin Cui | 99281df | 2016-02-17 12:21:52 -0800 | [diff] [blame] | 152 | |
Elliott Hughes | 01fcbe1 | 2016-05-23 17:43:41 -0700 | [diff] [blame] | 153 | ifeq ($(AB_OTA_UPDATER),true) |
| 154 | LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 |
bigbiff | e2eae2f | 2021-03-07 18:47:06 -0500 | [diff] [blame] | 155 | TWRP_REQUIRED_MODULES += libhardware android.hardware.boot@1.0-service android.hardware.boot@1.0-service.rc \ |
tnakamur | 217c05e | 2022-05-13 08:57:04 +0900 | [diff] [blame] | 156 | android.hardware.boot@1.1-service android.hardware.boot@1.1-service.rc android.hardware.boot@1.1.xml \ |
| 157 | android.hardware.boot@1.2-service android.hardware.boot@1.2-service.rc android.hardware.boot@1.2.xml |
Elliott Hughes | 01fcbe1 | 2016-05-23 17:43:41 -0700 | [diff] [blame] | 158 | endif |
| 159 | |
bigbiff | ee7b7ff | 2020-03-23 15:08:27 -0400 | [diff] [blame] | 160 | ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) |
| 161 | LOCAL_CFLAGS += -DPRODUCT_USE_DYNAMIC_PARTITIONS=1 |
nebrassy | 9c1709b | 2021-04-18 23:31:36 +0200 | [diff] [blame] | 162 | TWRP_REQUIRED_MODULES += android.hardware.health@2.1-service android.hardware.health@2.1-impl.recovery android.hardware.health@2.1-service.rc android.hardware.health@2.1.xml |
bigbiff | 22851b9 | 2021-09-01 16:46:57 -0400 | [diff] [blame] | 163 | TWRP_REQUIRED_MODULES += android.hardware.health@2.0-service android.hardware.health@2.0-impl.recovery android.hardware.health@2.0-service.rc |
bigbiff | 5c083cc | 2021-06-10 19:55:18 -0400 | [diff] [blame] | 164 | ifeq ($(TW_EXCLUDE_LPDUMP),) |
| 165 | TWRP_REQUIRED_MODULES += lpdump lpdumpd.rc |
| 166 | endif |
Captain Throwback | d15051e | 2021-11-18 20:30:38 -0500 | [diff] [blame] | 167 | ifeq ($(TW_EXCLUDE_LPTOOLS),) |
| 168 | TWRP_REQUIRED_MODULES += lptools |
| 169 | endif |
bigbiff | ee7b7ff | 2020-03-23 15:08:27 -0400 | [diff] [blame] | 170 | endif |
| 171 | |
Captain Throwback | 2b9ea72 | 2021-12-31 21:35:52 -0500 | [diff] [blame] | 172 | ifneq ($(TW_SYSTEM_BUILD_PROP_ADDITIONAL_PATHS),) |
| 173 | LOCAL_CFLAGS += -DTW_SYSTEM_BUILD_PROP_ADDITIONAL_PATHS='"$(TW_SYSTEM_BUILD_PROP_ADDITIONAL_PATHS)"' |
| 174 | endif |
| 175 | |
Mohd Faraz | 9a4ef26 | 2020-10-18 23:58:21 +0530 | [diff] [blame] | 176 | ifeq ($(TW_USES_VENDOR_LIBS),true) |
| 177 | LOCAL_CFLAGS += -DUSE_VENDOR_LIBS=1 |
| 178 | endif |
| 179 | |
bigbiff | 32cbabe | 2020-04-12 19:16:19 -0400 | [diff] [blame] | 180 | ifeq ($(TW_NO_BIND_SYSTEM),true) |
| 181 | LOCAL_CFLAGS += -DTW_NO_BIND_SYSTEM |
| 182 | endif |
| 183 | |
Captain Throwback | 02647a9 | 2023-01-11 13:46:30 -0500 | [diff] [blame] | 184 | ifeq ($(TW_NO_FLASH_CURRENT_TWRP),true) |
| 185 | LOCAL_CFLAGS += -DTW_NO_FLASH_CURRENT_TWRP |
| 186 | endif |
| 187 | |
Darth9 | bf42665 | 2023-02-05 23:41:03 +0000 | [diff] [blame] | 188 | ifeq ($(TW_PREPARE_DATA_MEDIA_EARLY),true) |
| 189 | LOCAL_CFLAGS += -DTW_PREPARE_DATA_MEDIA_EARLY |
| 190 | endif |
| 191 | |
Darth9 | 0b24e50 | 2023-04-07 23:32:45 +0100 | [diff] [blame] | 192 | ifeq ($(TW_ENABLE_FS_COMPRESSION),true) |
| 193 | LOCAL_CFLAGS += -DTW_ENABLE_FS_COMPRESSION |
| 194 | endif |
| 195 | |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 196 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 197 | |
Ethan Yonker | 9338282 | 2018-11-01 15:25:31 -0500 | [diff] [blame] | 198 | ifeq ($(TARGET_RECOVERY_TWRP_LIB),) |
| 199 | LOCAL_SRC_FILES += BasePartition.cpp |
| 200 | else |
| 201 | LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_TWRP_LIB) |
| 202 | endif |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 203 | |
Doug Zongker | cc8cd3f | 2010-09-20 12:16:13 -0700 | [diff] [blame] | 204 | LOCAL_C_INCLUDES += system/extras/ext4_utils |
| 205 | |
that | 0e2140e | 2016-08-10 21:04:26 +0200 | [diff] [blame] | 206 | tw_git_revision := $(shell git -C $(LOCAL_PATH) rev-parse --short=8 HEAD 2>/dev/null) |
| 207 | ifeq ($(shell git -C $(LOCAL_PATH) diff --quiet; echo $$?),1) |
| 208 | tw_git_revision := $(tw_git_revision)-dirty |
| 209 | endif |
| 210 | LOCAL_CFLAGS += -DTW_GIT_REVISION='"$(tw_git_revision)"' |
| 211 | |
mauronofrio | babc15e | 2020-03-16 14:59:39 +0000 | [diff] [blame] | 212 | ifeq ($(TW_FORCE_USE_BUSYBOX), true) |
| 213 | TW_USE_TOOLBOX := false |
| 214 | else |
| 215 | TW_USE_TOOLBOX := true |
| 216 | endif |
bigbiff bigbiff | af32bb9 | 2018-12-18 18:39:53 -0500 | [diff] [blame] | 217 | ifeq ($(TW_EXCLUDE_MTP),) |
| 218 | LOCAL_SHARED_LIBRARIES += libtwrpmtp-ffs |
| 219 | endif |
Captain Throwback | bc2cfa3 | 2021-09-16 10:04:26 -0400 | [diff] [blame] | 220 | ifeq ($(BOARD_USES_RECOVERY_AS_BOOT), true) |
| 221 | LOCAL_CFLAGS += -DBOARD_USES_RECOVERY_AS_BOOT |
| 222 | endif |
| 223 | ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE), true) |
| 224 | LOCAL_CFLAGS += -DBOARD_BUILD_SYSTEM_ROOT_IMAGE |
| 225 | endif |
bigbiff bigbiff | af32bb9 | 2018-12-18 18:39:53 -0500 | [diff] [blame] | 226 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 227 | #TWRP Build Flags |
bigbiff bigbiff | c7eee6f | 2014-09-02 18:59:01 -0400 | [diff] [blame] | 228 | ifeq ($(TW_EXCLUDE_MTP),) |
bigbiff bigbiff | c7eee6f | 2014-09-02 18:59:01 -0400 | [diff] [blame] | 229 | LOCAL_CFLAGS += -DTW_HAS_MTP |
| 230 | endif |
Ricardo Gomez | c9ecd44 | 2013-07-05 16:13:52 -0700 | [diff] [blame] | 231 | ifneq ($(TW_NO_SCREEN_TIMEOUT),) |
| 232 | LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT |
| 233 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 234 | ifeq ($(BOARD_HAS_NO_REAL_SDCARD), true) |
| 235 | LOCAL_CFLAGS += -DBOARD_HAS_NO_REAL_SDCARD |
| 236 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 237 | ifneq ($(RECOVERY_SDCARD_ON_DATA),) |
| 238 | LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA |
| 239 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 240 | ifneq ($(TW_INTERNAL_STORAGE_PATH),) |
| 241 | LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_PATH=$(TW_INTERNAL_STORAGE_PATH) |
| 242 | endif |
| 243 | ifneq ($(TW_INTERNAL_STORAGE_MOUNT_POINT),) |
| 244 | LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_MOUNT_POINT=$(TW_INTERNAL_STORAGE_MOUNT_POINT) |
| 245 | endif |
| 246 | ifneq ($(TW_EXTERNAL_STORAGE_PATH),) |
| 247 | LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_PATH=$(TW_EXTERNAL_STORAGE_PATH) |
| 248 | endif |
| 249 | ifneq ($(TW_EXTERNAL_STORAGE_MOUNT_POINT),) |
| 250 | LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_MOUNT_POINT=$(TW_EXTERNAL_STORAGE_MOUNT_POINT) |
| 251 | endif |
ChampionSwimmer | cf33e4d | 2013-02-03 13:59:22 +0530 | [diff] [blame] | 252 | ifeq ($(TW_HAS_NO_BOOT_PARTITION), true) |
| 253 | LOCAL_CFLAGS += -DTW_HAS_NO_BOOT_PARTITION |
| 254 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 255 | ifeq ($(TW_NO_REBOOT_BOOTLOADER), true) |
| 256 | LOCAL_CFLAGS += -DTW_NO_REBOOT_BOOTLOADER |
| 257 | endif |
| 258 | ifeq ($(TW_NO_REBOOT_RECOVERY), true) |
| 259 | LOCAL_CFLAGS += -DTW_NO_REBOOT_RECOVERY |
| 260 | endif |
| 261 | ifeq ($(TW_NO_BATT_PERCENT), true) |
| 262 | LOCAL_CFLAGS += -DTW_NO_BATT_PERCENT |
| 263 | endif |
Jenkins | 1710bf2 | 2014-10-02 20:22:21 -0400 | [diff] [blame] | 264 | ifeq ($(TW_NO_CPU_TEMP), true) |
| 265 | LOCAL_CFLAGS += -DTW_NO_CPU_TEMP |
| 266 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 267 | ifneq ($(TW_CUSTOM_POWER_BUTTON),) |
| 268 | LOCAL_CFLAGS += -DTW_CUSTOM_POWER_BUTTON=$(TW_CUSTOM_POWER_BUTTON) |
| 269 | endif |
| 270 | ifeq ($(TW_ALWAYS_RMRF), true) |
| 271 | LOCAL_CFLAGS += -DTW_ALWAYS_RMRF |
| 272 | endif |
| 273 | ifeq ($(TW_NEVER_UNMOUNT_SYSTEM), true) |
| 274 | LOCAL_CFLAGS += -DTW_NEVER_UNMOUNT_SYSTEM |
| 275 | endif |
| 276 | ifeq ($(TW_NO_USB_STORAGE), true) |
| 277 | LOCAL_CFLAGS += -DTW_NO_USB_STORAGE |
| 278 | endif |
| 279 | ifeq ($(TW_INCLUDE_INJECTTWRP), true) |
| 280 | LOCAL_CFLAGS += -DTW_INCLUDE_INJECTTWRP |
| 281 | endif |
| 282 | ifeq ($(TW_INCLUDE_BLOBPACK), true) |
| 283 | LOCAL_CFLAGS += -DTW_INCLUDE_BLOBPACK |
| 284 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 285 | ifneq ($(TARGET_USE_CUSTOM_LUN_FILE_PATH),) |
| 286 | LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(TARGET_USE_CUSTOM_LUN_FILE_PATH)\" |
| 287 | endif |
| 288 | ifneq ($(BOARD_UMS_LUNFILE),) |
| 289 | LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(BOARD_UMS_LUNFILE)\" |
| 290 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 291 | ifeq ($(TW_HAS_DOWNLOAD_MODE), true) |
| 292 | LOCAL_CFLAGS += -DTW_HAS_DOWNLOAD_MODE |
| 293 | endif |
mauronofrio | e9a49ef | 2018-10-03 13:38:16 +0200 | [diff] [blame] | 294 | ifeq ($(TW_HAS_EDL_MODE), true) |
| 295 | LOCAL_CFLAGS += -DTW_HAS_EDL_MODE |
| 296 | endif |
bigbiff bigbiff | 8794036 | 2013-03-09 09:58:50 -0500 | [diff] [blame] | 297 | ifeq ($(TW_NO_SCREEN_BLANK), true) |
| 298 | LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK |
| 299 | endif |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 300 | ifeq ($(TW_SDEXT_NO_EXT4), true) |
| 301 | LOCAL_CFLAGS += -DTW_SDEXT_NO_EXT4 |
| 302 | endif |
Dees_Troy | fdf5fcc | 2012-09-11 10:27:01 -0400 | [diff] [blame] | 303 | ifeq ($(TW_FORCE_CPUINFO_FOR_DEVICE_ID), true) |
| 304 | LOCAL_CFLAGS += -DTW_FORCE_CPUINFO_FOR_DEVICE_ID |
| 305 | endif |
Dees_Troy | 3f5c4e8 | 2013-02-01 15:16:59 +0000 | [diff] [blame] | 306 | ifeq ($(TW_NO_EXFAT_FUSE), true) |
| 307 | LOCAL_CFLAGS += -DTW_NO_EXFAT_FUSE |
| 308 | endif |
bigbiff bigbiff | 3ed778a | 2019-03-12 19:28:31 -0400 | [diff] [blame] | 309 | ifeq ($(TW_NO_HAPTICS), true) |
| 310 | LOCAL_CFLAGS += -DTW_NO_HAPTICS |
| 311 | endif |
bigbiff | 7992430 | 2021-05-02 20:06:09 -0400 | [diff] [blame] | 312 | ifneq ($(TW_ADDITIONAL_APEX_FILES),) |
| 313 | LOCAL_CFLAGS += -DTW_ADDITIONAL_APEX_FILES=$(TW_ADDITIONAL_APEX_FILES) |
| 314 | endif |
bigbiff | 22851b9 | 2021-09-01 16:46:57 -0400 | [diff] [blame] | 315 | ifneq ($(TW_LOAD_VENDOR_MODULES),) |
Captain Throwback | 00f0dcd | 2022-04-14 20:13:10 -0400 | [diff] [blame] | 316 | LOCAL_SRC_FILES += kernel_module_loader.cpp |
| 317 | LOCAL_C_INCLUDES += system/core/libmodprobe/include |
| 318 | LOCAL_STATIC_LIBRARIES += libmodprobe |
bigbiff | 22851b9 | 2021-09-01 16:46:57 -0400 | [diff] [blame] | 319 | LOCAL_CFLAGS += -DTW_LOAD_VENDOR_MODULES=$(TW_LOAD_VENDOR_MODULES) |
Captain Throwback | 5a98ce9 | 2023-08-18 10:54:41 -0400 | [diff] [blame] | 320 | ifeq ($(TW_LOAD_VENDOR_MODULES_EXCLUDE_GKI),true) |
| 321 | LOCAL_CFLAGS += -DTW_LOAD_VENDOR_MODULES_EXCLUDE_GKI |
| 322 | endif |
bigbiff | 22851b9 | 2021-09-01 16:46:57 -0400 | [diff] [blame] | 323 | endif |
Ethan Yonker | 253368a | 2014-11-25 15:00:52 -0600 | [diff] [blame] | 324 | ifeq ($(TW_INCLUDE_CRYPTO), true) |
Captain Throwback | ddb0a40 | 2020-11-01 12:52:21 -0500 | [diff] [blame] | 325 | LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO -DUSE_FSCRYPT -Wno-macro-redefined |
bigbiff | df53b6c | 2022-01-17 19:31:52 -0500 | [diff] [blame] | 326 | LOCAL_SHARED_LIBRARIES += libgpt_twrp |
bigbiff | a957f07 | 2021-03-07 18:20:29 -0500 | [diff] [blame] | 327 | LOCAL_C_INCLUDES += external/boringssl/src/include bootable/recovery/crypto |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 328 | TW_INCLUDE_CRYPTO_FBE := true |
| 329 | LOCAL_CFLAGS += -DTW_INCLUDE_FBE |
bigbiff | df53b6c | 2022-01-17 19:31:52 -0500 | [diff] [blame] | 330 | LOCAL_SHARED_LIBRARIES += android.frameworks.stats@1.0 android.hardware.authsecret@1.0 \ |
bigbiff | 7df8747 | 2022-09-24 16:45:03 -0400 | [diff] [blame] | 331 | android.security.authorization-ndk \ |
bigbiff | df53b6c | 2022-01-17 19:31:52 -0500 | [diff] [blame] | 332 | android.hardware.oemlock@1.0 libf2fs_sparseblock libbinder libbinder_ndk \ |
| 333 | libandroidicu.recovery \ |
| 334 | android.hardware.gatekeeper@1.0 \ |
| 335 | android.hardware.weaver@1.0 \ |
| 336 | android.frameworks.stats@1.0 \ |
bigbiff | 7df8747 | 2022-09-24 16:45:03 -0400 | [diff] [blame] | 337 | android.security.maintenance-ndk \ |
| 338 | android.system.keystore2-V1-ndk \ |
bigbiff | df53b6c | 2022-01-17 19:31:52 -0500 | [diff] [blame] | 339 | libkeyutils \ |
| 340 | liblog \ |
| 341 | libsqlite.recovery \ |
| 342 | libkeystoreinfo.recovery \ |
| 343 | libgatekeeper_aidl |
| 344 | |
| 345 | LOCAL_STATIC_LIBRARIES += libkeymint_support |
| 346 | |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 347 | LOCAL_CFLAGS += -DTW_INCLUDE_FBE_METADATA_DECRYPT |
me-cafebabe | 757105f | 2022-06-09 16:32:22 +0800 | [diff] [blame] | 348 | |
| 349 | ifeq ($(TARGET_HW_DISK_ENCRYPTION),true) |
| 350 | ifeq ($(TARGET_CRYPTFS_HW_PATH),) |
| 351 | LOCAL_C_INCLUDES += device/qcom/common/cryptfs_hw |
| 352 | else |
| 353 | LOCAL_C_INCLUDES += $(TARGET_CRYPTFS_HW_PATH) |
| 354 | endif |
| 355 | LOCAL_SHARED_LIBRARIES += libcryptfs_hw |
| 356 | endif |
Ethan Yonker | 4eca40d | 2014-11-11 14:52:28 -0600 | [diff] [blame] | 357 | endif |
D. Andrei Măceș | b29a5e2 | 2016-12-22 06:19:44 -0500 | [diff] [blame] | 358 | WITH_CRYPTO_UTILS := \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 359 | $(if $(wildcard system/core/libcrypto_utils/android_pubkey.c),true) |
Anatoly Smaznov | 10c11f6 | 2013-02-12 13:33:40 +0700 | [diff] [blame] | 360 | ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true) |
| 361 | LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID |
| 362 | endif |
lambdadroid | fc0b16d | 2017-08-04 17:16:53 +0200 | [diff] [blame] | 363 | ifeq ($(TW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID), true) |
| 364 | LOCAL_CFLAGS += -DTW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID |
| 365 | endif |
Dees_Troy | 2f9117a | 2013-02-17 19:52:09 -0600 | [diff] [blame] | 366 | ifneq ($(TW_BRIGHTNESS_PATH),) |
| 367 | LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=$(TW_BRIGHTNESS_PATH) |
| 368 | endif |
xNUTx | e85f02d | 2014-07-18 01:30:58 +0200 | [diff] [blame] | 369 | ifneq ($(TW_SECONDARY_BRIGHTNESS_PATH),) |
| 370 | LOCAL_CFLAGS += -DTW_SECONDARY_BRIGHTNESS_PATH=$(TW_SECONDARY_BRIGHTNESS_PATH) |
| 371 | endif |
Dees_Troy | 2f9117a | 2013-02-17 19:52:09 -0600 | [diff] [blame] | 372 | ifneq ($(TW_MAX_BRIGHTNESS),) |
| 373 | LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS) |
| 374 | endif |
Greg Wallace | 36ade45 | 2015-11-08 13:54:25 -0500 | [diff] [blame] | 375 | ifneq ($(TW_DEFAULT_BRIGHTNESS),) |
| 376 | LOCAL_CFLAGS += -DTW_DEFAULT_BRIGHTNESS=$(TW_DEFAULT_BRIGHTNESS) |
| 377 | endif |
Dees_Troy | f33b490 | 2013-03-01 00:51:39 +0000 | [diff] [blame] | 378 | ifneq ($(TW_CUSTOM_BATTERY_PATH),) |
| 379 | LOCAL_CFLAGS += -DTW_CUSTOM_BATTERY_PATH=$(TW_CUSTOM_BATTERY_PATH) |
| 380 | endif |
sekaiacg | 997ff73 | 2022-06-24 11:04:49 +0800 | [diff] [blame] | 381 | ifneq ($(TW_BATTERY_SYSFS_WAIT_SECONDS),) |
| 382 | LOCAL_CFLAGS += -DTW_BATTERY_SYSFS_WAIT_SECONDS=$(TW_BATTERY_SYSFS_WAIT_SECONDS) |
| 383 | else |
| 384 | LOCAL_CFLAGS += -DTW_BATTERY_SYSFS_WAIT_SECONDS=3 |
| 385 | endif |
Jenkins | 1710bf2 | 2014-10-02 20:22:21 -0400 | [diff] [blame] | 386 | ifneq ($(TW_CUSTOM_CPU_TEMP_PATH),) |
| 387 | LOCAL_CFLAGS += -DTW_CUSTOM_CPU_TEMP_PATH=$(TW_CUSTOM_CPU_TEMP_PATH) |
| 388 | endif |
bigbiff | e3742ef | 2021-08-15 17:24:58 -0400 | [diff] [blame] | 389 | ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS),) |
Dees_Troy | 83bd483 | 2013-05-04 12:39:56 +0000 | [diff] [blame] | 390 | LOCAL_SHARED_LIBRARIES += libopenaes |
| 391 | else |
| 392 | LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS |
| 393 | endif |
Vojtech Bocek | d0e38bc | 2014-02-03 23:36:57 +0100 | [diff] [blame] | 394 | ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),) |
Michael Bestas | 4a18558 | 2017-04-28 15:45:26 +0300 | [diff] [blame] | 395 | ifneq ($(filter msm8226 msm8x26 msm8610 msm8974 msm8x74 msm8084 msm8x84 apq8084 msm8909 msm8916 msm8992 msm8994 msm8952 msm8996 msm8937 msm8953 msm8998,$(TARGET_BOARD_PLATFORM)),) |
| 396 | LOCAL_CFLAGS += -DQCOM_RTC_FIX |
| 397 | else ifeq ($(TARGET_CPU_VARIANT),krait) |
Vojtech Bocek | d0e38bc | 2014-02-03 23:36:57 +0100 | [diff] [blame] | 398 | LOCAL_CFLAGS += -DQCOM_RTC_FIX |
| 399 | endif |
| 400 | else ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),true) |
| 401 | LOCAL_CFLAGS += -DQCOM_RTC_FIX |
| 402 | endif |
Matt Mower | 6883d73 | 2014-03-20 17:28:13 -0500 | [diff] [blame] | 403 | ifneq ($(TW_NO_LEGACY_PROPS),) |
| 404 | LOCAL_CFLAGS += -DTW_NO_LEGACY_PROPS |
| 405 | endif |
Dees Troy | 4159aed | 2014-02-28 17:24:43 +0000 | [diff] [blame] | 406 | ifneq ($(wildcard bionic/libc/include/sys/capability.h),) |
| 407 | LOCAL_CFLAGS += -DHAVE_CAPABILITIES |
| 408 | endif |
Matt Mower | ec009e8 | 2015-01-30 13:00:49 -0600 | [diff] [blame] | 409 | ifneq ($(TARGET_RECOVERY_INITRC),) |
| 410 | TW_EXCLUDE_DEFAULT_USB_INIT := true |
| 411 | endif |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 412 | LOCAL_CFLAGS += -DTW_USE_NEW_MINADBD |
Ethan Yonker | 74db157 | 2015-10-28 12:44:49 -0500 | [diff] [blame] | 413 | ifneq ($(TW_DEFAULT_LANGUAGE),) |
| 414 | LOCAL_CFLAGS += -DTW_DEFAULT_LANGUAGE=$(TW_DEFAULT_LANGUAGE) |
| 415 | else |
| 416 | LOCAL_CFLAGS += -DTW_DEFAULT_LANGUAGE=en |
| 417 | endif |
Captain Throwback | f74fc05 | 2022-01-19 13:25:54 -0500 | [diff] [blame] | 418 | ifneq ($(TW_QCOM_ATS_OFFSET),) |
| 419 | LOCAL_CFLAGS += -DTW_QCOM_ATS_OFFSET=$(TW_QCOM_ATS_OFFSET) |
| 420 | endif |
Phoenix591 | e444d11 | 2018-02-03 07:23:54 +0000 | [diff] [blame] | 421 | ifneq ($(TW_CLOCK_OFFSET),) |
| 422 | LOCAL_CFLAGS += -DTW_CLOCK_OFFSET=$(TW_CLOCK_OFFSET) |
| 423 | endif |
Chaosmaster | 461e39f | 2020-02-07 01:48:13 +0100 | [diff] [blame] | 424 | ifneq ($(TW_OVERRIDE_SYSTEM_PROPS),) |
| 425 | TW_INCLUDE_LIBRESETPROP := true |
| 426 | LOCAL_CFLAGS += -DTW_OVERRIDE_SYSTEM_PROPS=$(TW_OVERRIDE_SYSTEM_PROPS) |
| 427 | endif |
Captain Throwback | 1483a8e | 2022-01-03 09:52:06 -0500 | [diff] [blame] | 428 | ifneq ($(TW_OVERRIDE_PROPS_ADDITIONAL_PARTITIONS),) |
| 429 | LOCAL_CFLAGS += -DTW_OVERRIDE_PROPS_ADDITIONAL_PARTITIONS='"$(TW_OVERRIDE_PROPS_ADDITIONAL_PARTITIONS)"' |
| 430 | endif |
Chaosmaster | 461e39f | 2020-02-07 01:48:13 +0100 | [diff] [blame] | 431 | ifneq ($(TW_INCLUDE_LIBRESETPROP),) |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 432 | LOCAL_SHARED_LIBRARIES += libresetprop |
| 433 | LOCAL_C_INCLUDES += external/magisk-prebuilt/include |
| 434 | LOCAL_CFLAGS += -DTW_INCLUDE_LIBRESETPROP |
Chaosmaster | 461e39f | 2020-02-07 01:48:13 +0100 | [diff] [blame] | 435 | endif |
Captain Throwback | 16dd81b | 2021-02-12 19:32:36 -0500 | [diff] [blame] | 436 | ifeq ($(TW_EXCLUDE_NANO), true) |
| 437 | LOCAL_CFLAGS += -DTW_EXCLUDE_NANO |
| 438 | endif |
DarthJabba9 | 7cd3abb | 2021-11-28 01:09:44 +0530 | [diff] [blame] | 439 | ifneq ($(TARGET_OTA_ASSERT_DEVICE),) |
| 440 | LOCAL_CFLAGS += -DTARGET_OTA_ASSERT_DEVICE='"$(TARGET_OTA_ASSERT_DEVICE)"' |
| 441 | endif |
Darth9 | cc683e7 | 2022-08-09 12:54:40 +0100 | [diff] [blame] | 442 | ifneq ($(TW_BACKUP_EXCLUSIONS),) |
| 443 | LOCAL_CFLAGS += -DTW_BACKUP_EXCLUSIONS='"$(TW_BACKUP_EXCLUSIONS)"' |
| 444 | endif |
me-cafebabe | 97be432 | 2022-08-14 05:57:16 +0800 | [diff] [blame] | 445 | ifeq ($(TW_INCLUDE_FASTBOOTD), true) |
| 446 | LOCAL_CFLAGS += -DTW_INCLUDE_FASTBOOTD |
| 447 | endif |
Chaosmaster | 461e39f | 2020-02-07 01:48:13 +0100 | [diff] [blame] | 448 | |
bigbiff | a957f07 | 2021-03-07 18:20:29 -0500 | [diff] [blame] | 449 | LOCAL_C_INCLUDES += system/vold \ |
| 450 | |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 451 | TWRP_REQUIRED_MODULES += \ |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 452 | relink_libraries \ |
| 453 | relink_binaries \ |
bigbiff | 4740bca | 2022-07-18 15:55:03 -0400 | [diff] [blame] | 454 | relink_vendor_hw_binaries \ |
bigbiff | 7ba7500 | 2020-04-11 20:47:09 -0400 | [diff] [blame] | 455 | twrp_ramdisk \ |
bigbiff | c5012c5 | 2021-07-04 13:57:47 -0400 | [diff] [blame] | 456 | bc \ |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 457 | dump_image \ |
| 458 | erase_image \ |
| 459 | flash_image \ |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 460 | mke2fs.conf \ |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 461 | pigz \ |
| 462 | teamwin \ |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 463 | twrp \ |
Matt Mower | 18794c8 | 2015-11-11 16:22:45 -0600 | [diff] [blame] | 464 | fsck.fat \ |
| 465 | fatlabel \ |
| 466 | mkfs.fat \ |
HashBang | ed974bb | 2016-01-30 14:20:09 -0500 | [diff] [blame] | 467 | permissive.sh \ |
Ethan Yonker | f117962 | 2016-08-25 15:32:21 -0500 | [diff] [blame] | 468 | simg2img_twrp \ |
bigbiff | df8436b | 2020-08-30 16:22:34 -0400 | [diff] [blame] | 469 | libbootloader_message \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 470 | init.recovery.hlthchrg.rc \ |
bigbiff | 973167a | 2020-04-06 15:44:20 -0400 | [diff] [blame] | 471 | init.recovery.service.rc \ |
| 472 | init.recovery.ldconfig.rc \ |
bigbiff | 7ba7500 | 2020-04-11 20:47:09 -0400 | [diff] [blame] | 473 | awk \ |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 474 | toybox \ |
| 475 | toolbox \ |
bigbiff | df8436b | 2020-08-30 16:22:34 -0400 | [diff] [blame] | 476 | mkshrc_twrp \ |
Mohammad Afaneh | 3150f1e | 2020-10-16 00:45:03 +0300 | [diff] [blame] | 477 | plat_hwservice_contexts \ |
bigbiff | 1f9e484 | 2020-10-31 11:33:15 -0400 | [diff] [blame] | 478 | vendor_hwservice_contexts \ |
bigbiff | 7ed5106 | 2020-12-02 13:18:20 -0500 | [diff] [blame] | 479 | minadbd \ |
bigbiff | 91bd7a7 | 2021-01-03 17:33:01 -0500 | [diff] [blame] | 480 | twrpbu \ |
bigbiff | 98203ce | 2021-03-03 20:39:52 -0500 | [diff] [blame] | 481 | adbd_system_api_recovery \ |
Captain Throwback | 7f398f7 | 2020-12-30 21:46:17 -0500 | [diff] [blame] | 482 | me.twrp.twrpapp.apk \ |
bigbiff | d81833a | 2021-01-17 11:06:57 -0500 | [diff] [blame] | 483 | privapp-permissions-twrpapp.xml \ |
| 484 | adbd_system_api_recovery \ |
bigbiff | e6d833a | 2021-10-17 13:54:43 -0400 | [diff] [blame] | 485 | libsync.recovery \ |
Captain Throwback | 00f0dcd | 2022-04-14 20:13:10 -0400 | [diff] [blame] | 486 | libandroidicu.recovery |
bigbiff | 7ba7500 | 2020-04-11 20:47:09 -0400 | [diff] [blame] | 487 | |
Captain Throwback | 6443cef | 2021-01-30 12:26:25 -0500 | [diff] [blame] | 488 | ifneq ($(TW_EXCLUDE_TZDATA), true) |
| 489 | TWRP_REQUIRED_MODULES += \ |
| 490 | tzdata_twrp |
| 491 | endif |
| 492 | |
nebrassy | 5078965 | 2021-02-12 23:36:44 +0100 | [diff] [blame] | 493 | ifneq ($(TW_EXCLUDE_NANO), true) |
| 494 | TWRP_REQUIRED_MODULES += \ |
| 495 | nano_twrp \ |
| 496 | nano.rc |
| 497 | endif |
| 498 | |
DarthJabba9 | fba0cee | 2021-02-20 17:13:09 -0500 | [diff] [blame] | 499 | ifneq ($(TW_EXCLUDE_BASH), true) |
| 500 | ifneq ($(wildcard external/bash/.),) |
| 501 | TWRP_REQUIRED_MODULES += \ |
| 502 | bash_twrp |
| 503 | endif |
| 504 | endif |
| 505 | |
nebrassy | 05b5405 | 2021-02-24 19:02:42 +0100 | [diff] [blame] | 506 | ifeq ($(TW_INCLUDE_REPACKTOOLS), true) |
| 507 | TWRP_REQUIRED_MODULES += \ |
| 508 | magiskboot |
| 509 | endif |
| 510 | |
| 511 | ifeq ($(TW_INCLUDE_RESETPROP), true) |
| 512 | TWRP_REQUIRED_MODULES += \ |
| 513 | resetprop |
| 514 | endif |
nebrassy | 5078965 | 2021-02-12 23:36:44 +0100 | [diff] [blame] | 515 | |
bigbiff | 7ba7500 | 2020-04-11 20:47:09 -0400 | [diff] [blame] | 516 | TWRP_REQUIRED_MODULES += \ |
Captain Throwback | ddb0a40 | 2020-11-01 12:52:21 -0500 | [diff] [blame] | 517 | hwservicemanager \ |
| 518 | hwservicemanager.rc \ |
bigbiff | 7ba7500 | 2020-04-11 20:47:09 -0400 | [diff] [blame] | 519 | vndservicemanager \ |
Mohd Faraz | 29cab7f | 2021-04-17 11:35:09 +0200 | [diff] [blame] | 520 | vndservicemanager.rc |
| 521 | |
| 522 | ifneq ($(TW_INCLUDE_CRYPTO),) |
| 523 | TWRP_REQUIRED_MODULES += \ |
bigbiff | 7ba7500 | 2020-04-11 20:47:09 -0400 | [diff] [blame] | 524 | vold_prepare_subdirs \ |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 525 | task_recovery_profiles.json \ |
bigbiff | df53b6c | 2022-01-17 19:31:52 -0500 | [diff] [blame] | 526 | fscryptpolicyget.recovery \ |
| 527 | keystore_auth \ |
| 528 | keystore2 \ |
| 529 | android.system.keystore2-service.xml \ |
| 530 | keystore2.rc \ |
| 531 | plat_keystore2_key_contexts |
| 532 | |
Captain Throwback | ddb0a40 | 2020-11-01 12:52:21 -0500 | [diff] [blame] | 533 | ifneq ($(TW_INCLUDE_CRYPTO_FBE),) |
| 534 | TWRP_REQUIRED_MODULES += \ |
| 535 | plat_service_contexts \ |
| 536 | servicemanager \ |
| 537 | servicemanager.rc |
| 538 | endif |
bigbiff | 7ba7500 | 2020-04-11 20:47:09 -0400 | [diff] [blame] | 539 | endif |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 540 | |
bigbiff | 416fe3a | 2020-03-28 13:46:48 -0400 | [diff] [blame] | 541 | ifneq ($(wildcard external/zip/Android.mk),) |
| 542 | TWRP_REQUIRED_MODULES += zip |
| 543 | endif |
| 544 | ifneq ($(wildcard external/unzip/Android.mk),) |
| 545 | TWRP_REQUIRED_MODULES += unzip |
Ethan Yonker | bcc502c | 2014-11-10 11:22:10 -0600 | [diff] [blame] | 546 | endif |
Matt Mower | 8405761 | 2017-01-08 13:32:18 -0600 | [diff] [blame] | 547 | |
Matt Mower | 2017279 | 2014-11-14 10:54:03 -0600 | [diff] [blame] | 548 | ifneq ($(TW_NO_EXFAT), true) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 549 | TWRP_REQUIRED_MODULES += mkexfatfs fsckexfat |
Ethan Yonker | 34741d9 | 2016-02-06 13:22:45 -0600 | [diff] [blame] | 550 | ifneq ($(TW_NO_EXFAT_FUSE), true) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 551 | TWRP_REQUIRED_MODULES += exfat-fuse |
Ethan Yonker | 34741d9 | 2016-02-06 13:22:45 -0600 | [diff] [blame] | 552 | endif |
Matt Mower | 2017279 | 2014-11-14 10:54:03 -0600 | [diff] [blame] | 553 | endif |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 554 | ifeq ($(BOARD_HAS_NO_REAL_SDCARD),) |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 555 | TWRP_REQUIRED_MODULES += sgdisk |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 556 | endif |
Captain Throwback | 630fd66 | 2022-04-05 17:10:29 -0400 | [diff] [blame] | 557 | ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS),) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 558 | TWRP_REQUIRED_MODULES += openaes openaes_license |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 559 | endif |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 560 | ifeq ($(TW_INCLUDE_FB2PNG), true) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 561 | TWRP_REQUIRED_MODULES += fb2png |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 562 | endif |
| 563 | ifneq ($(TW_OEM_BUILD),true) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 564 | TWRP_REQUIRED_MODULES += orscmd |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 565 | endif |
| 566 | ifeq ($(BOARD_USES_BML_OVER_MTD),true) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 567 | TWRP_REQUIRED_MODULES += bml_over_mtd |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 568 | endif |
| 569 | ifeq ($(TW_INCLUDE_INJECTTWRP), true) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 570 | TWRP_REQUIRED_MODULES += injecttwrp |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 571 | endif |
Matt Mower | ec009e8 | 2015-01-30 13:00:49 -0600 | [diff] [blame] | 572 | ifneq ($(TW_EXCLUDE_DEFAULT_USB_INIT), true) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 573 | TWRP_REQUIRED_MODULES += init.recovery.usb.rc |
Matt Mower | ec009e8 | 2015-01-30 13:00:49 -0600 | [diff] [blame] | 574 | endif |
Captain Throwback | 1f12775 | 2016-01-19 17:30:20 -0500 | [diff] [blame] | 575 | ifeq ($(TWRP_INCLUDE_LOGCAT), true) |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 576 | TWRP_REQUIRED_MODULES += logcat event-log-tags |
Ethan Yonker | e5a288c | 2016-02-15 09:23:57 -0600 | [diff] [blame] | 577 | ifeq ($(TARGET_USES_LOGD), true) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 578 | TWRP_REQUIRED_MODULES += logd libsysutils libnl init.recovery.logd.rc |
Ethan Yonker | e5a288c | 2016-02-15 09:23:57 -0600 | [diff] [blame] | 579 | endif |
Captain Throwback | 1f12775 | 2016-01-19 17:30:20 -0500 | [diff] [blame] | 580 | endif |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 581 | # Allow devices to specify device-specific recovery dependencies |
| 582 | ifneq ($(TARGET_RECOVERY_DEVICE_MODULES),) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 583 | TWRP_REQUIRED_MODULES += $(TARGET_RECOVERY_DEVICE_MODULES) |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 584 | endif |
Ethan Yonker | b81d905 | 2015-07-09 13:20:53 -0500 | [diff] [blame] | 585 | ifeq ($(TW_INCLUDE_NTFS_3G),true) |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 586 | TWRP_REQUIRED_MODULES += \ |
Greg Wallace | b39e6c6 | 2015-12-29 00:55:26 -0500 | [diff] [blame] | 587 | mount.ntfs \ |
| 588 | fsck.ntfs \ |
| 589 | mkfs.ntfs |
Greg Wallace | b39e6c6 | 2015-12-29 00:55:26 -0500 | [diff] [blame] | 590 | endif |
Matt Mower | 5829491 | 2015-12-10 11:54:28 -0600 | [diff] [blame] | 591 | ifeq ($(TARGET_USERIMAGES_USE_F2FS), true) |
Captain Throwback | 8833868 | 2022-05-21 10:44:13 -0400 | [diff] [blame] | 592 | TWRP_REQUIRED_MODULES += sload_f2fs \ |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 593 | libfs_mgr \ |
| 594 | fs_mgr \ |
nebrassy | 86c09dc | 2022-02-06 16:48:41 +0100 | [diff] [blame] | 595 | liblz4 \ |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 596 | libinit |
Ethan Yonker | 9338282 | 2018-11-01 15:25:31 -0500 | [diff] [blame] | 597 | endif |
Captain Throwback | 00f0dcd | 2022-04-14 20:13:10 -0400 | [diff] [blame] | 598 | ifneq ($(TW_LOAD_VENDOR_MODULES),) |
| 599 | TWRP_REQUIRED_MODULES += libmodprobe |
| 600 | endif |
Captain Throwback | 73ab972 | 2022-08-03 16:47:54 -0400 | [diff] [blame] | 601 | ifeq ($(TW_INCLUDE_PYTHON),true) |
Captain Throwback | 1ef40fc | 2022-05-28 20:55:20 -0400 | [diff] [blame] | 602 | TWRP_REQUIRED_MODULES += python3_twrp |
| 603 | endif |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 604 | |
| 605 | TWRP_REQUIRED_MODULES += file_contexts_text |
| 606 | |
Daeho Jeong | 88cf074 | 2021-12-01 15:25:14 -0800 | [diff] [blame] | 607 | LOCAL_REQUIRED_MODULES += \ |
| 608 | mkfs.erofs.recovery \ |
| 609 | dump.erofs.recovery \ |
bigbiff | f5ddf35 | 2022-10-10 12:31:37 -0400 | [diff] [blame] | 610 | fsck.erofs.recovery \ |
| 611 | task_profiles.json.recovery |
Daeho Jeong | 88cf074 | 2021-12-01 15:25:14 -0800 | [diff] [blame] | 612 | |
Tianjie Xu | 2b1a464 | 2018-09-06 11:58:55 -0700 | [diff] [blame] | 613 | # On A/B devices recovery-persist reads the recovery related file from the persist storage and |
| 614 | # copies them into /data/misc/recovery. Then, for both A/B and non-A/B devices, recovery-persist |
| 615 | # parses the last_install file and reports the embedded update metrics. Also, the last_install file |
| 616 | # will be deteleted after the report. |
| 617 | LOCAL_REQUIRED_MODULES += recovery-persist |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 618 | ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),) |
| 619 | TWRP_REQUIRED_MODULES += recovery-persist recovery-refresh |
Matt Mower | 5829491 | 2015-12-10 11:54:28 -0600 | [diff] [blame] | 620 | endif |
Matt Mower | 031163b | 2014-11-01 15:13:03 -0500 | [diff] [blame] | 621 | |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 622 | LOCAL_REQUIRED_MODULES += $(TWRP_REQUIRED_MODULES) |
Mark Salyzyn | 13aca59 | 2016-03-09 14:58:16 -0800 | [diff] [blame] | 623 | |
The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 624 | include $(BUILD_EXECUTABLE) |
| 625 | |
Matt Mower | d821c96 | 2017-02-15 12:36:18 -0600 | [diff] [blame] | 626 | # Symlink for file_contexts |
| 627 | include $(CLEAR_VARS) |
| 628 | |
Captain Throwback | 3184b2f | 2017-03-07 12:07:40 -0500 | [diff] [blame] | 629 | LOCAL_MODULE := file_contexts_text |
Matt Mower | d821c96 | 2017-02-15 12:36:18 -0600 | [diff] [blame] | 630 | LOCAL_MODULE_TAGS := optional |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 631 | LOCAL_REQUIRED_MODULES := file_contexts.bin |
| 632 | |
Matt Mower | d821c96 | 2017-02-15 12:36:18 -0600 | [diff] [blame] | 633 | LOCAL_POST_INSTALL_CMD := \ |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 634 | $(hide) cp -f $(PRODUCT_OUT)/obj/ETC/file_contexts.bin_intermediates/file_contexts.concat.tmp $(TARGET_RECOVERY_ROOT_OUT)/file_contexts |
Matt Mower | d821c96 | 2017-02-15 12:36:18 -0600 | [diff] [blame] | 635 | |
bigbiff | 416fe3a | 2020-03-28 13:46:48 -0400 | [diff] [blame] | 636 | include $(BUILD_PHONY_PACKAGE) |
Dees_Troy | c04dcf7 | 2012-10-02 10:46:37 -0400 | [diff] [blame] | 637 | |
Mark Salyzyn | 13aca59 | 2016-03-09 14:58:16 -0800 | [diff] [blame] | 638 | # recovery-persist (system partition dynamic executable run after /data mounts) |
| 639 | # =============================== |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 640 | include $(CLEAR_VARS) |
| 641 | LOCAL_SRC_FILES := \ |
| 642 | recovery-persist.cpp |
| 643 | LOCAL_MODULE := recovery-persist |
bigbiff | 673c7ae | 2020-12-02 19:44:56 -0500 | [diff] [blame] | 644 | LOCAL_SHARED_LIBRARIES := liblog libbase |
| 645 | LOCAL_STATIC_LIBRARIES := libotautil librecovery_utils |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 646 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/otautil/include |
bigbiff | 673c7ae | 2020-12-02 19:44:56 -0500 | [diff] [blame] | 647 | LOCAL_C_INCLUDES += system/core/libstats/include |
| 648 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/recovery_utils/include |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 649 | LOCAL_CFLAGS := -Werror |
| 650 | LOCAL_INIT_RC := recovery-persist.rc |
| 651 | include $(BUILD_EXECUTABLE) |
Doug Zongker | 73ae31c | 2009-12-09 17:01:45 -0800 | [diff] [blame] | 652 | |
Mark Salyzyn | 13aca59 | 2016-03-09 14:58:16 -0800 | [diff] [blame] | 653 | # recovery-refresh (system partition dynamic executable run at init) |
| 654 | # =============================== |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 655 | include $(CLEAR_VARS) |
| 656 | LOCAL_SRC_FILES := \ |
| 657 | recovery-refresh.cpp |
| 658 | LOCAL_MODULE := recovery-refresh |
| 659 | LOCAL_SHARED_LIBRARIES := liblog libbase |
bigbiff | 673c7ae | 2020-12-02 19:44:56 -0500 | [diff] [blame] | 660 | LOCAL_STATIC_LIBRARIES := libotautil librecovery_utils |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 661 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/otautil/include |
bigbiff | 673c7ae | 2020-12-02 19:44:56 -0500 | [diff] [blame] | 662 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/recovery_utils/include |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 663 | LOCAL_CFLAGS := -Werror |
| 664 | LOCAL_INIT_RC := recovery-refresh.rc |
| 665 | include $(BUILD_EXECUTABLE) |
Tao Bao | 42c45e2 | 2018-07-31 09:37:12 -0700 | [diff] [blame] | 666 | |
Elliott Hughes | 63a3192 | 2016-06-09 17:41:22 -0700 | [diff] [blame] | 667 | # libmounts (static library) |
| 668 | # =============================== |
| 669 | include $(CLEAR_VARS) |
| 670 | LOCAL_SRC_FILES := mounts.cpp |
Tao Bao | 5f85d1f | 2017-03-28 21:12:36 -0700 | [diff] [blame] | 671 | LOCAL_CFLAGS := \ |
| 672 | -Wall \ |
| 673 | -Werror |
Elliott Hughes | 63a3192 | 2016-06-09 17:41:22 -0700 | [diff] [blame] | 674 | LOCAL_MODULE := libmounts |
Tao Bao | 5f85d1f | 2017-03-28 21:12:36 -0700 | [diff] [blame] | 675 | LOCAL_STATIC_LIBRARIES := libbase |
Elliott Hughes | 63a3192 | 2016-06-09 17:41:22 -0700 | [diff] [blame] | 676 | include $(BUILD_STATIC_LIBRARY) |
| 677 | |
Tao Bao | 62e0bc7 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 678 | # librecovery (static library) |
| 679 | # =============================== |
| 680 | include $(CLEAR_VARS) |
| 681 | LOCAL_SRC_FILES := \ |
| 682 | install.cpp |
Tao Bao | b24510c | 2017-04-20 17:54:27 -0700 | [diff] [blame] | 683 | LOCAL_CFLAGS := -Wall -Werror |
Tao Bao | 62e0bc7 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 684 | LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) |
Tao Bao | 25dbe17 | 2017-04-12 23:52:20 -0700 | [diff] [blame] | 685 | |
| 686 | ifeq ($(AB_OTA_UPDATER),true) |
| 687 | LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 |
| 688 | endif |
| 689 | |
Tao Bao | 62e0bc7 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 690 | LOCAL_MODULE := librecovery |
| 691 | LOCAL_STATIC_LIBRARIES := \ |
| 692 | libminui \ |
Tao Bao | cfe53c2 | 2017-10-03 14:37:21 -0700 | [diff] [blame] | 693 | libotautil \ |
bigbiff | 7ba7500 | 2020-04-11 20:47:09 -0400 | [diff] [blame] | 694 | libvintf \ |
Tao Bao | 62e0bc7 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 695 | libcrypto_utils \ |
nebrassy | bf9d225 | 2021-11-14 23:26:29 +0100 | [diff] [blame] | 696 | libcrypto_static \ |
Elliott Hughes | e1bb7a5 | 2017-06-28 08:00:17 -0700 | [diff] [blame] | 697 | libbase \ |
| 698 | libziparchive \ |
Tao Bao | 62e0bc7 | 2017-04-10 16:55:57 -0700 | [diff] [blame] | 699 | |
| 700 | include $(BUILD_STATIC_LIBRARY) |
| 701 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 702 | commands_recovery_local_path := $(LOCAL_PATH) |
Ethan Yonker | ecbd3e8 | 2017-12-14 14:43:59 -0600 | [diff] [blame] | 703 | |
Yabin Cui | 2f272c0 | 2016-06-24 18:22:02 -0700 | [diff] [blame] | 704 | include \ |
bigbiff | df8436b | 2020-08-30 16:22:34 -0400 | [diff] [blame] | 705 | $(commands_TWRP_local_path)/updater/Android.mk |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 706 | |
bigbiff | 7ed5106 | 2020-12-02 13:18:20 -0500 | [diff] [blame] | 707 | include $(commands_TWRP_local_path)/mtp/ffs/Android.mk \ |
bigbiff | ad58e1b | 2020-07-06 20:24:34 -0400 | [diff] [blame] | 708 | $(commands_TWRP_local_path)/minui/Android.mk |
Ethan Yonker | c798c9c | 2015-10-09 11:15:26 -0500 | [diff] [blame] | 709 | |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 710 | #includes for TWRP |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 711 | include $(commands_TWRP_local_path)/injecttwrp/Android.mk \ |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 712 | $(commands_TWRP_local_path)/mmcutils/Android.mk \ |
| 713 | $(commands_TWRP_local_path)/bmlutils/Android.mk \ |
| 714 | $(commands_TWRP_local_path)/prebuilt/Android.mk \ |
| 715 | $(commands_TWRP_local_path)/mtdutils/Android.mk \ |
| 716 | $(commands_TWRP_local_path)/flashutils/Android.mk \ |
| 717 | $(commands_TWRP_local_path)/pigz/Android.mk \ |
| 718 | $(commands_TWRP_local_path)/libtar/Android.mk \ |
| 719 | $(commands_TWRP_local_path)/libcrecovery/Android.mk \ |
| 720 | $(commands_TWRP_local_path)/libblkid/Android.mk \ |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 721 | $(commands_TWRP_local_path)/openaes/Android.mk \ |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 722 | $(commands_TWRP_local_path)/twrpTarMain/Android.mk \ |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 723 | $(commands_TWRP_local_path)/minzip/Android.mk \ |
| 724 | $(commands_TWRP_local_path)/dosfstools/Android.mk \ |
| 725 | $(commands_TWRP_local_path)/etc/Android.mk \ |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 726 | $(commands_TWRP_local_path)/simg2img/Android.mk \ |
| 727 | $(commands_TWRP_local_path)/adbbu/Android.mk \ |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 728 | $(commands_TWRP_local_path)/twrpDigest/Android.mk \ |
| 729 | $(commands_TWRP_local_path)/attr/Android.mk |
Ethan Yonker | bcc502c | 2014-11-10 11:22:10 -0600 | [diff] [blame] | 730 | |
mauronofrio | 6d3bf89 | 2019-10-26 19:47:55 +0200 | [diff] [blame] | 731 | ifneq ($(TW_OZIP_DECRYPT_KEY),) |
| 732 | TWRP_REQUIRED_MODULES += ozip_decrypt |
| 733 | include $(commands_TWRP_local_path)/ozip_decrypt/Android.mk |
| 734 | endif |
| 735 | |
Ethan Yonker | 253368a | 2014-11-25 15:00:52 -0600 | [diff] [blame] | 736 | ifeq ($(TW_INCLUDE_CRYPTO), true) |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 737 | include $(commands_TWRP_local_path)/crypto/scrypt/Android.mk |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 738 | include $(commands_TWRP_local_path)/gpt/Android.mk |
Ethan Yonker | 4eca40d | 2014-11-11 14:52:28 -0600 | [diff] [blame] | 739 | endif |
Vojtech Bocek | 7cc278b | 2013-02-24 01:40:19 +0100 | [diff] [blame] | 740 | ifeq ($(BUILD_ID), GINGERBREAD) |
| 741 | TW_NO_EXFAT := true |
| 742 | endif |
Dees_Troy | b05ddee | 2013-01-28 20:24:50 +0000 | [diff] [blame] | 743 | ifneq ($(TW_NO_EXFAT), true) |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 744 | include $(commands_TWRP_local_path)/exfat/mkfs/Android.mk \ |
| 745 | $(commands_TWRP_local_path)/exfat/fsck/Android.mk \ |
| 746 | $(commands_TWRP_local_path)/fuse/Android.mk \ |
| 747 | $(commands_TWRP_local_path)/exfat/libexfat/Android.mk |
Ethan Yonker | 34741d9 | 2016-02-06 13:22:45 -0600 | [diff] [blame] | 748 | ifneq ($(TW_NO_EXFAT_FUSE), true) |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 749 | include $(commands_TWRP_local_path)/exfat/fuse/Android.mk |
Ethan Yonker | 34741d9 | 2016-02-06 13:22:45 -0600 | [diff] [blame] | 750 | endif |
Captain Throwback | 6a1acf2 | 2014-09-18 12:46:35 -0400 | [diff] [blame] | 751 | endif |
Ethan Yonker | 03a42f6 | 2014-08-08 11:03:51 -0500 | [diff] [blame] | 752 | ifneq ($(TW_OEM_BUILD),true) |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 753 | include $(commands_TWRP_local_path)/orscmd/Android.mk |
Ethan Yonker | 03a42f6 | 2014-08-08 11:03:51 -0500 | [diff] [blame] | 754 | endif |
bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 755 | |
Talustus | 3019a91 | 2013-04-06 11:50:07 +0200 | [diff] [blame] | 756 | # FB2PNG |
| 757 | ifeq ($(TW_INCLUDE_FB2PNG), true) |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 758 | include $(commands_TWRP_local_path)/fb2png/Android.mk |
Talustus | 3019a91 | 2013-04-06 11:50:07 +0200 | [diff] [blame] | 759 | endif |
Matt Mower | 55c75ca | 2014-08-31 11:30:15 -0500 | [diff] [blame] | 760 | |
Matt Mower | 55c75ca | 2014-08-31 11:30:15 -0500 | [diff] [blame] | 761 | endif |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 762 | |
| 763 | commands_TWRP_local_path := |