blob: d79d89b3089e6ac006dc90439670b7b08051cd85 [file] [log] [blame]
Alex Deymod5561a52015-09-03 23:17:52 -07001#
2# Copyright (C) 2015 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Daniel Cardenas0c37e312017-11-06 12:01:33 -080017ifneq ($(TARGET_BUILD_PDK),true)
18
Alex Deymod5561a52015-09-03 23:17:52 -070019LOCAL_PATH := $(my-dir)
20
Alex Deymo78a954f2016-01-21 20:32:40 -080021# Default values for the USE flags. Override these USE flags from your product
22# by setting BRILLO_USE_* values. Note that we define local variables like
23# local_use_* to prevent leaking our default setting for other packages.
24local_use_binder := $(if $(BRILLO_USE_BINDER),$(BRILLO_USE_BINDER),1)
Alex Deymo78a954f2016-01-21 20:32:40 -080025local_use_hwid_override := \
26 $(if $(BRILLO_USE_HWID_OVERRIDE),$(BRILLO_USE_HWID_OVERRIDE),0)
27local_use_mtd := $(if $(BRILLO_USE_MTD),$(BRILLO_USE_MTD),0)
Amin Hassanie94ece52017-08-01 15:03:08 -070028local_use_chrome_network_proxy := 0
29local_use_chrome_kiosk_app := 0
Alex Deymo787dc412015-10-29 11:39:20 -070030
Alex Deymo49d64452016-10-31 16:56:58 -070031# IoT devices use Omaha for updates.
32local_use_omaha := $(if $(filter true,$(PRODUCT_IOT)),1,0)
33
Alex Deymoc372ab62015-10-29 00:43:26 -070034ue_common_cflags := \
Alex Deymo78a954f2016-01-21 20:32:40 -080035 -DUSE_BINDER=$(local_use_binder) \
Amin Hassanie94ece52017-08-01 15:03:08 -070036 -DUSE_CHROME_NETWORK_PROXY=$(local_use_chrome_network_proxy) \
37 -DUSE_CHROME_KIOSK_APP=$(local_use_chrome_kiosk_app) \
Alex Deymo78a954f2016-01-21 20:32:40 -080038 -DUSE_HWID_OVERRIDE=$(local_use_hwid_override) \
39 -DUSE_MTD=$(local_use_mtd) \
Sen Jiang192a86a2016-05-19 17:21:24 -070040 -DUSE_OMAHA=$(local_use_omaha) \
Alex Deymoc372ab62015-10-29 00:43:26 -070041 -D_FILE_OFFSET_BITS=64 \
42 -D_POSIX_C_SOURCE=199309L \
43 -Wa,--noexecstack \
44 -Wall \
45 -Werror \
46 -Wextra \
47 -Wformat=2 \
48 -Wno-psabi \
49 -Wno-unused-parameter \
50 -ffunction-sections \
51 -fstack-protector-strong \
52 -fvisibility=hidden
53ue_common_cppflags := \
54 -Wnon-virtual-dtor \
Elliott Hughes063863b2016-10-10 13:37:53 -070055 -fno-strict-aliasing
Alex Deymoc372ab62015-10-29 00:43:26 -070056ue_common_ldflags := \
57 -Wl,--gc-sections
58ue_common_c_includes := \
59 $(LOCAL_PATH)/client_library/include \
Alex Deymoc372ab62015-10-29 00:43:26 -070060 system
61ue_common_shared_libraries := \
Alex Deymoc372ab62015-10-29 00:43:26 -070062 libbrillo-stream \
Alex Deymo44348e02016-07-29 16:22:26 -070063 libbrillo \
Alex Deymo4218b7e2015-11-17 21:14:42 -030064 libchrome
Dan Albert6cacaf52016-08-11 13:05:40 -070065ue_common_static_libraries := \
66 libgtest_prod \
Alex Deymod5561a52015-09-03 23:17:52 -070067
Alex Deymod5561a52015-09-03 23:17:52 -070068# update_metadata-protos (type: static_library)
69# ========================================================
70# Protobufs.
Alex Deymoc372ab62015-10-29 00:43:26 -070071ue_update_metadata_protos_exported_static_libraries := \
72 update_metadata-protos
73ue_update_metadata_protos_exported_shared_libraries := \
Alex Vakulenkoab5bd662015-12-21 12:24:45 -080074 libprotobuf-cpp-lite
Alex Deymoc372ab62015-10-29 00:43:26 -070075
Alex Deymo05e0e382015-12-07 20:18:16 -080076ue_update_metadata_protos_src_files := \
77 update_metadata.proto
78
79# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -070080include $(CLEAR_VARS)
81LOCAL_MODULE := update_metadata-protos
82LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Ying Wangdbd17112015-12-17 11:59:09 -080083LOCAL_IS_HOST_MODULE := true
Alex Deymod5561a52015-09-03 23:17:52 -070084generated_sources_dir := $(call local-generated-sources-dir)
Alex Deymoc372ab62015-10-29 00:43:26 -070085LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system
Alex Deymo05e0e382015-12-07 20:18:16 -080086LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files)
Chih-Hung Hsieh908da192017-10-20 15:14:48 -070087LOCAL_CFLAGS := -Wall -Werror
Alex Deymo05e0e382015-12-07 20:18:16 -080088include $(BUILD_HOST_STATIC_LIBRARY)
89
90# Build for the target.
91include $(CLEAR_VARS)
92LOCAL_MODULE := update_metadata-protos
93LOCAL_MODULE_CLASS := STATIC_LIBRARIES
94generated_sources_dir := $(call local-generated-sources-dir)
95LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system
96LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files)
Chih-Hung Hsieh908da192017-10-20 15:14:48 -070097LOCAL_CFLAGS := -Wall -Werror
Alex Deymod5561a52015-09-03 23:17:52 -070098include $(BUILD_STATIC_LIBRARY)
99
Alex Deymo39910dc2015-11-09 17:04:30 -0800100# libpayload_consumer (type: static_library)
Alex Deymod5561a52015-09-03 23:17:52 -0700101# ========================================================
Alex Deymo39910dc2015-11-09 17:04:30 -0800102# The payload application component and common dependencies.
Alex Deymo39910dc2015-11-09 17:04:30 -0800103ue_libpayload_consumer_exported_static_libraries := \
104 update_metadata-protos \
Steven Moreland0571c802017-05-12 14:10:55 -0700105 libxz \
Alex Deymo39910dc2015-11-09 17:04:30 -0800106 libbz \
Sen Jiang26dfa322016-05-10 15:31:46 -0700107 libbspatch \
Tianjie Xu13df6002017-10-28 22:05:20 -0700108 libbrotli \
Amin Hassani02855c22017-09-06 22:34:50 -0700109 libpuffpatch \
Alex Deymo39910dc2015-11-09 17:04:30 -0800110 $(ue_update_metadata_protos_exported_static_libraries)
111ue_libpayload_consumer_exported_shared_libraries := \
Dan Willemsen097288e2016-07-21 14:16:29 -0700112 libcrypto \
Alex Deymo39910dc2015-11-09 17:04:30 -0800113 $(ue_update_metadata_protos_exported_shared_libraries)
114
Alex Deymo05e0e382015-12-07 20:18:16 -0800115ue_libpayload_consumer_src_files := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800116 common/action_processor.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800117 common/boot_control_stub.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800118 common/clock.cc \
119 common/constants.cc \
Alex Deymoab0d9762016-02-02 10:52:56 -0800120 common/cpu_limiter.cc \
Alex Deymoe88e9fe2016-02-03 16:38:00 -0800121 common/error_code_utils.cc \
Alex Deymod6ece532016-06-21 17:00:05 -0700122 common/file_fetcher.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800123 common/hash_calculator.cc \
124 common/http_common.cc \
125 common/http_fetcher.cc \
126 common/hwid_override.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800127 common/multi_range_http_fetcher.cc \
128 common/platform_constants_android.cc \
129 common/prefs.cc \
130 common/subprocess.cc \
131 common/terminator.cc \
132 common/utils.cc \
133 payload_consumer/bzip_extent_writer.cc \
Amin Hassaniacd7be82017-08-25 15:32:13 -0700134 payload_consumer/cached_file_descriptor.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800135 payload_consumer/delta_performer.cc \
136 payload_consumer/download_action.cc \
Amin Hassaniee6d9a12017-08-31 14:09:15 -0700137 payload_consumer/extent_reader.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800138 payload_consumer/extent_writer.cc \
139 payload_consumer/file_descriptor.cc \
Alex Deymoa48f6302016-11-04 15:49:53 -0700140 payload_consumer/file_descriptor_utils.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800141 payload_consumer/file_writer.cc \
142 payload_consumer/filesystem_verifier_action.cc \
143 payload_consumer/install_plan.cc \
HÃ¥kan Kvist4e13cf42018-01-23 12:57:55 +0100144 payload_consumer/mount_history.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800145 payload_consumer/payload_constants.cc \
146 payload_consumer/payload_verifier.cc \
147 payload_consumer/postinstall_runner_action.cc \
148 payload_consumer/xz_extent_writer.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800149
150ifeq ($(HOST_OS),linux)
151# Build for the host.
152include $(CLEAR_VARS)
153LOCAL_MODULE := libpayload_consumer
154LOCAL_MODULE_CLASS := STATIC_LIBRARIES
155LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800156LOCAL_CFLAGS := $(ue_common_cflags)
157LOCAL_CPPFLAGS := $(ue_common_cppflags)
158LOCAL_LDFLAGS := $(ue_common_ldflags)
159LOCAL_C_INCLUDES := \
Sen Jiangdcbc0ae2016-03-18 15:33:19 -0700160 $(ue_common_c_includes)
Alex Deymo05e0e382015-12-07 20:18:16 -0800161LOCAL_STATIC_LIBRARIES := \
162 update_metadata-protos \
Dan Albert6cacaf52016-08-11 13:05:40 -0700163 $(ue_common_static_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800164 $(ue_libpayload_consumer_exported_static_libraries) \
165 $(ue_update_metadata_protos_exported_static_libraries)
166LOCAL_SHARED_LIBRARIES := \
167 $(ue_common_shared_libraries) \
168 $(ue_libpayload_consumer_exported_shared_libraries) \
169 $(ue_update_metadata_protos_exported_shared_libraries)
170LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files)
171include $(BUILD_HOST_STATIC_LIBRARY)
172endif # HOST_OS == linux
173
174# Build for the target.
175include $(CLEAR_VARS)
176LOCAL_MODULE := libpayload_consumer
177LOCAL_MODULE_CLASS := STATIC_LIBRARIES
178LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800179LOCAL_CFLAGS := $(ue_common_cflags)
180LOCAL_CPPFLAGS := $(ue_common_cppflags)
181LOCAL_LDFLAGS := $(ue_common_ldflags)
182LOCAL_C_INCLUDES := \
Sen Jiangdcbc0ae2016-03-18 15:33:19 -0700183 $(ue_common_c_includes)
Alex Deymo05e0e382015-12-07 20:18:16 -0800184LOCAL_STATIC_LIBRARIES := \
185 update_metadata-protos \
Dan Albert6cacaf52016-08-11 13:05:40 -0700186 $(ue_common_static_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800187 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
188 $(ue_update_metadata_protos_exported_static_libraries)
189LOCAL_SHARED_LIBRARIES := \
190 $(ue_common_shared_libraries) \
191 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
192 $(ue_update_metadata_protos_exported_shared_libraries)
193LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files)
Alex Deymo39910dc2015-11-09 17:04:30 -0800194include $(BUILD_STATIC_LIBRARY)
195
Connor O'Briencee6ad92016-11-21 13:53:52 -0800196# libupdate_engine_boot_control (type: static_library)
197# ========================================================
198# A BootControl class implementation using Android's HIDL boot_control HAL.
199ue_libupdate_engine_boot_control_exported_static_libraries := \
200 update_metadata-protos \
201 $(ue_update_metadata_protos_exported_static_libraries)
202
203ue_libupdate_engine_boot_control_exported_shared_libraries := \
204 libhwbinder \
Connor O'Brien25cea5e2016-11-28 12:44:10 -0800205 libhidlbase \
Connor O'Briencee6ad92016-11-21 13:53:52 -0800206 libutils \
207 android.hardware.boot@1.0 \
208 $(ue_update_metadata_protos_exported_shared_libraries)
209
210include $(CLEAR_VARS)
211LOCAL_MODULE := libupdate_engine_boot_control
212LOCAL_MODULE_CLASS := STATIC_LIBRARIES
213LOCAL_CPP_EXTENSION := .cc
Connor O'Briencee6ad92016-11-21 13:53:52 -0800214LOCAL_CFLAGS := $(ue_common_cflags)
215LOCAL_CPPFLAGS := $(ue_common_cppflags)
216LOCAL_LDFLAGS := $(ue_common_ldflags)
217LOCAL_C_INCLUDES := \
218 $(ue_common_c_includes) \
219 bootable/recovery
220LOCAL_STATIC_LIBRARIES := \
221 $(ue_common_static_libraries) \
222 $(ue_libupdate_engine_boot_control_exported_static_libraries)
223LOCAL_SHARED_LIBRARIES := \
224 $(ue_common_shared_libraries) \
225 $(ue_libupdate_engine_boot_control_exported_shared_libraries)
226LOCAL_SRC_FILES := \
227 boot_control_android.cc
228include $(BUILD_STATIC_LIBRARY)
229
Sen Jiang192a86a2016-05-19 17:21:24 -0700230ifeq ($(local_use_omaha),1)
Alex Deymo4218b7e2015-11-17 21:14:42 -0300231
Alex Deymo39910dc2015-11-09 17:04:30 -0800232# libupdate_engine (type: static_library)
233# ========================================================
234# The main daemon static_library with all the code used to check for updates
235# with Omaha and expose a DBus daemon.
236ue_libupdate_engine_exported_c_includes := \
Alex Deymob09305e2015-12-02 16:09:13 -0300237 external/cros/system_api/dbus
Alex Deymoc372ab62015-10-29 00:43:26 -0700238ue_libupdate_engine_exported_static_libraries := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800239 libpayload_consumer \
Alex Deymod5561a52015-09-03 23:17:52 -0700240 update_metadata-protos \
David Zeuthen753fadc2015-09-15 16:34:09 -0400241 libbz \
Alex Deymoc372ab62015-10-29 00:43:26 -0700242 libfs_mgr \
bowgotsai763e17c2017-01-24 16:59:57 +0800243 libbase \
bowgotsaicd67f912017-01-27 14:50:26 +0800244 liblog \
Alex Deymo39910dc2015-11-09 17:04:30 -0800245 $(ue_libpayload_consumer_exported_static_libraries) \
Connor O'Briencee6ad92016-11-21 13:53:52 -0800246 $(ue_update_metadata_protos_exported_static_libraries) \
247 libupdate_engine_boot_control \
248 $(ue_libupdate_engine_boot_control_exported_static_libraries)
Alex Deymoc372ab62015-10-29 00:43:26 -0700249ue_libupdate_engine_exported_shared_libraries := \
Alex Deymod5561a52015-09-03 23:17:52 -0700250 libmetrics \
Alex Deymod5561a52015-09-03 23:17:52 -0700251 libexpat \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700252 libbrillo-policy \
Alex Deymo14c0da82016-07-20 16:45:45 -0700253 libcurl \
Alex Deymoc372ab62015-10-29 00:43:26 -0700254 libcutils \
Alex Deymo14c0da82016-07-20 16:45:45 -0700255 libssl \
Alex Deymo39910dc2015-11-09 17:04:30 -0800256 $(ue_libpayload_consumer_exported_shared_libraries) \
Connor O'Briencee6ad92016-11-21 13:53:52 -0800257 $(ue_update_metadata_protos_exported_shared_libraries) \
258 $(ue_libupdate_engine_boot_control_exported_shared_libraries)
Alex Deymoc0037902016-01-23 17:29:02 -0800259ifeq ($(local_use_binder),1)
260ue_libupdate_engine_exported_shared_libraries += \
261 libbinder \
262 libbinderwrapper \
263 libbrillo-binder \
264 libutils
265endif # local_use_binder == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700266
267include $(CLEAR_VARS)
268LOCAL_MODULE := libupdate_engine
269LOCAL_MODULE_CLASS := STATIC_LIBRARIES
270LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700271LOCAL_EXPORT_C_INCLUDE_DIRS := $(ue_libupdate_engine_exported_c_includes)
272LOCAL_CFLAGS := $(ue_common_cflags)
273LOCAL_CPPFLAGS := $(ue_common_cppflags)
274LOCAL_LDFLAGS := $(ue_common_ldflags)
275LOCAL_C_INCLUDES := \
276 $(ue_common_c_includes) \
Alex Deymofb905d92016-06-03 19:26:58 -0700277 $(ue_libupdate_engine_exported_c_includes) \
278 bootable/recovery
Alex Deymoc372ab62015-10-29 00:43:26 -0700279LOCAL_STATIC_LIBRARIES := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800280 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700281 update_metadata-protos \
Dan Albert6cacaf52016-08-11 13:05:40 -0700282 $(ue_common_static_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800283 $(ue_libupdate_engine_exported_static_libraries:-host=) \
284 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700285 $(ue_update_metadata_protos_exported_static_libraries)
286LOCAL_SHARED_LIBRARIES := \
287 $(ue_common_shared_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800288 $(ue_libupdate_engine_exported_shared_libraries:-host=) \
289 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700290 $(ue_update_metadata_protos_exported_shared_libraries)
Alex Deymod5561a52015-09-03 23:17:52 -0700291LOCAL_SRC_FILES := \
Alex Deymo14c0da82016-07-20 16:45:45 -0700292 certificate_checker.cc \
Alex Deymo78a954f2016-01-21 20:32:40 -0800293 common_service.cc \
Sen Jianga7c4de22017-03-02 15:53:54 -0800294 connection_manager_android.cc \
Sen Jiang255e22b2016-05-20 16:15:29 -0700295 connection_utils.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700296 daemon.cc \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800297 hardware_android.cc \
Alex Deymo85616652015-10-15 18:48:31 -0700298 image_properties_android.cc \
Alex Deymo14c0da82016-07-20 16:45:45 -0700299 libcurl_http_fetcher.cc \
Tianjie Xu098f7022017-08-24 21:37:16 -0700300 metrics_reporter_omaha.cc \
Alex Deymo38429cf2015-11-11 18:27:22 -0800301 metrics_utils.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700302 omaha_request_action.cc \
303 omaha_request_params.cc \
304 omaha_response_handler_action.cc \
Alex Deymob3fa53b2016-04-18 19:57:58 -0700305 omaha_utils.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700306 p2p_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700307 payload_state.cc \
Sen Jiangb8c6a8f2016-06-07 17:33:17 -0700308 power_manager_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700309 proxy_resolver.cc \
310 real_system_state.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700311 update_attempter.cc \
Aaron Wood56d8ab32017-09-22 15:56:18 -0700312 update_manager/android_things_policy.cc \
Aaron Woodbf5a2522017-10-04 10:58:36 -0700313 update_manager/api_restricted_downloads_policy_impl.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700314 update_manager/boxed_value.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700315 update_manager/default_policy.cc \
Aaron Wood56d8ab32017-09-22 15:56:18 -0700316 update_manager/enough_slots_ab_updates_policy_impl.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700317 update_manager/evaluation_context.cc \
Aaron Wood56d8ab32017-09-22 15:56:18 -0700318 update_manager/interactive_update_policy_impl.cc \
319 update_manager/next_update_check_policy_impl.cc \
320 update_manager/official_build_check_policy_impl.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700321 update_manager/policy.cc \
322 update_manager/real_config_provider.cc \
323 update_manager/real_device_policy_provider.cc \
324 update_manager/real_random_provider.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700325 update_manager/real_system_provider.cc \
326 update_manager/real_time_provider.cc \
327 update_manager/real_updater_provider.cc \
328 update_manager/state_factory.cc \
329 update_manager/update_manager.cc \
Alex Deymof7ead812015-10-23 17:37:27 -0700330 update_status_utils.cc \
Alex Deymodc066f12017-03-27 13:01:29 -0700331 utils_android.cc
Alex Deymo78a954f2016-01-21 20:32:40 -0800332ifeq ($(local_use_binder),1)
Casey Dahlina93cd532016-01-14 16:55:11 -0800333LOCAL_AIDL_INCLUDES += $(LOCAL_PATH)/binder_bindings
Casey Dahlina93cd532016-01-14 16:55:11 -0800334LOCAL_SRC_FILES += \
335 binder_bindings/android/brillo/IUpdateEngine.aidl \
336 binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl \
Alex Deymofa78f142016-01-26 21:36:16 -0800337 binder_service_brillo.cc \
Casey Dahlina93cd532016-01-14 16:55:11 -0800338 parcelable_update_engine_status.cc
Alex Deymo78a954f2016-01-21 20:32:40 -0800339endif # local_use_binder == 1
Amin Hassanie94ece52017-08-01 15:03:08 -0700340ifeq ($(local_use_chrome_network_proxy),1)
Alex Deymo0cd976d2016-02-11 18:45:01 -0800341LOCAL_SRC_FILES += \
342 chrome_browser_proxy_resolver.cc
Amin Hassanie94ece52017-08-01 15:03:08 -0700343endif # local_use_chrome_network_proxy == 1
Alex Deymod5561a52015-09-03 23:17:52 -0700344include $(BUILD_STATIC_LIBRARY)
345
Sen Jiang192a86a2016-05-19 17:21:24 -0700346else # local_use_omaha == 1
Alex Deymofa78f142016-01-26 21:36:16 -0800347
348ifneq ($(local_use_binder),1)
349$(error USE_BINDER is disabled but is required in non-Brillo devices.)
350endif # local_use_binder == 1
351
352# libupdate_engine_android (type: static_library)
353# ========================================================
354# The main daemon static_library used in Android (non-Brillo). This only has a
355# loop to apply payloads provided by the upper layer via a Binder interface.
356ue_libupdate_engine_android_exported_static_libraries := \
357 libpayload_consumer \
Alex Deymo5e3ea272016-01-28 13:42:23 -0800358 libfs_mgr \
bowgotsai763e17c2017-01-24 16:59:57 +0800359 libbase \
bowgotsaicd67f912017-01-27 14:50:26 +0800360 liblog \
Connor O'Briencee6ad92016-11-21 13:53:52 -0800361 $(ue_libpayload_consumer_exported_static_libraries) \
362 libupdate_engine_boot_control \
363 $(ue_libupdate_engine_boot_control_exported_static_libraries)
Alex Deymofa78f142016-01-26 21:36:16 -0800364ue_libupdate_engine_android_exported_shared_libraries := \
365 $(ue_libpayload_consumer_exported_shared_libraries) \
Connor O'Briencee6ad92016-11-21 13:53:52 -0800366 $(ue_libupdate_engine_boot_control_exported_shared_libraries) \
Alex Deymob8437be2016-12-09 16:28:12 -0800367 libandroid_net \
Alex Deymofa78f142016-01-26 21:36:16 -0800368 libbinder \
369 libbinderwrapper \
370 libbrillo-binder \
Alex Deymo5e3ea272016-01-28 13:42:23 -0800371 libcutils \
Alex Deymo14c0da82016-07-20 16:45:45 -0700372 libcurl \
Tianjie Xu1b661142017-09-28 14:03:42 -0700373 libmetricslogger \
Alex Deymo14c0da82016-07-20 16:45:45 -0700374 libssl \
Alex Deymofa78f142016-01-26 21:36:16 -0800375 libutils
376
377include $(CLEAR_VARS)
378LOCAL_MODULE := libupdate_engine_android
379LOCAL_MODULE_CLASS := STATIC_LIBRARIES
380LOCAL_CPP_EXTENSION := .cc
Alex Deymofa78f142016-01-26 21:36:16 -0800381LOCAL_CFLAGS := $(ue_common_cflags)
382LOCAL_CPPFLAGS := $(ue_common_cppflags)
383LOCAL_LDFLAGS := $(ue_common_ldflags)
Alex Deymofb905d92016-06-03 19:26:58 -0700384LOCAL_C_INCLUDES := \
385 $(ue_common_c_includes) \
386 bootable/recovery
Alex Deymo3b678db2016-02-09 11:50:06 -0800387#TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
388# out of the DBus interface.
389LOCAL_C_INCLUDES += \
390 external/cros/system_api/dbus
Alex Deymofa78f142016-01-26 21:36:16 -0800391LOCAL_STATIC_LIBRARIES := \
Dan Albert6cacaf52016-08-11 13:05:40 -0700392 $(ue_common_static_libraries) \
Alex Deymofa78f142016-01-26 21:36:16 -0800393 $(ue_libupdate_engine_android_exported_static_libraries:-host=)
394LOCAL_SHARED_LIBRARIES += \
395 $(ue_common_shared_libraries) \
396 $(ue_libupdate_engine_android_exported_shared_libraries:-host=)
397LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
398LOCAL_SRC_FILES += \
399 binder_bindings/android/os/IUpdateEngine.aidl \
400 binder_bindings/android/os/IUpdateEngineCallback.aidl \
401 binder_service_android.cc \
Alex Deymo14c0da82016-07-20 16:45:45 -0700402 certificate_checker.cc \
Alex Deymofa78f142016-01-26 21:36:16 -0800403 daemon.cc \
Alex Deymo5e3ea272016-01-28 13:42:23 -0800404 daemon_state_android.cc \
405 hardware_android.cc \
Alex Deymo14c0da82016-07-20 16:45:45 -0700406 libcurl_http_fetcher.cc \
Tianjie Xu1b661142017-09-28 14:03:42 -0700407 metrics_reporter_android.cc \
408 metrics_utils.cc \
Alex Deymo87792ea2016-07-25 15:40:36 -0700409 network_selector_android.cc \
Alex Deymo5e3ea272016-01-28 13:42:23 -0800410 proxy_resolver.cc \
Alex Deymo3b678db2016-02-09 11:50:06 -0800411 update_attempter_android.cc \
Alex Deymofb905d92016-06-03 19:26:58 -0700412 update_status_utils.cc \
413 utils_android.cc
Alex Deymofa78f142016-01-26 21:36:16 -0800414include $(BUILD_STATIC_LIBRARY)
415
Sen Jiang192a86a2016-05-19 17:21:24 -0700416endif # local_use_omaha == 1
Alex Deymo4218b7e2015-11-17 21:14:42 -0300417
Alex Deymod5561a52015-09-03 23:17:52 -0700418# update_engine (type: executable)
419# ========================================================
420# update_engine daemon.
421include $(CLEAR_VARS)
422LOCAL_MODULE := update_engine
423LOCAL_MODULE_CLASS := EXECUTABLES
Sen Jiang56092772015-11-23 14:41:00 -0800424LOCAL_REQUIRED_MODULES := \
Alex Deymoab494462015-11-30 17:07:36 -0300425 cacerts_google
Alex Deymoc372ab62015-10-29 00:43:26 -0700426LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700427LOCAL_CFLAGS := $(ue_common_cflags)
428LOCAL_CPPFLAGS := $(ue_common_cppflags)
429LOCAL_LDFLAGS := $(ue_common_ldflags)
430LOCAL_C_INCLUDES := \
Alex Deymo4218b7e2015-11-17 21:14:42 -0300431 $(ue_common_c_includes)
Alex Deymoe97b39c2016-01-20 13:22:17 -0800432LOCAL_SHARED_LIBRARIES := \
433 $(ue_common_shared_libraries)
Dan Albert6cacaf52016-08-11 13:05:40 -0700434LOCAL_STATIC_LIBRARIES := \
435 $(ue_common_static_libraries)
Alex Deymoe97b39c2016-01-20 13:22:17 -0800436LOCAL_SRC_FILES := \
437 main.cc
Alex Deymo4218b7e2015-11-17 21:14:42 -0300438
Sen Jiang192a86a2016-05-19 17:21:24 -0700439ifeq ($(local_use_omaha),1)
Alex Deymo4218b7e2015-11-17 21:14:42 -0300440LOCAL_C_INCLUDES += \
Alex Deymoc372ab62015-10-29 00:43:26 -0700441 $(ue_libupdate_engine_exported_c_includes)
Dan Albert6cacaf52016-08-11 13:05:40 -0700442LOCAL_STATIC_LIBRARIES += \
Alex Deymod5561a52015-09-03 23:17:52 -0700443 libupdate_engine \
Alex Deymo05e0e382015-12-07 20:18:16 -0800444 $(ue_libupdate_engine_exported_static_libraries:-host=)
Alex Deymoe97b39c2016-01-20 13:22:17 -0800445LOCAL_SHARED_LIBRARIES += \
Alex Deymo05e0e382015-12-07 20:18:16 -0800446 $(ue_libupdate_engine_exported_shared_libraries:-host=)
Sen Jiang192a86a2016-05-19 17:21:24 -0700447else # local_use_omaha == 1
Dan Albert6cacaf52016-08-11 13:05:40 -0700448LOCAL_STATIC_LIBRARIES += \
Alex Deymofa78f142016-01-26 21:36:16 -0800449 libupdate_engine_android \
450 $(ue_libupdate_engine_android_exported_static_libraries:-host=)
Alex Deymoe97b39c2016-01-20 13:22:17 -0800451LOCAL_SHARED_LIBRARIES += \
Alex Deymofa78f142016-01-26 21:36:16 -0800452 $(ue_libupdate_engine_android_exported_shared_libraries:-host=)
Sen Jiang192a86a2016-05-19 17:21:24 -0700453endif # local_use_omaha == 1
Casey Dahlina93cd532016-01-14 16:55:11 -0800454
Gilad Arnold70141f22015-09-17 09:06:30 -0700455LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700456include $(BUILD_EXECUTABLE)
457
Alex Deymo03a4de72016-07-20 16:08:23 -0700458# update_engine_sideload (type: executable)
459# ========================================================
460# A static binary equivalent to update_engine daemon that installs an update
461# from a local file directly instead of running in the background.
462include $(CLEAR_VARS)
463LOCAL_MODULE := update_engine_sideload
Alex Deymo44348e02016-07-29 16:22:26 -0700464LOCAL_FORCE_STATIC_EXECUTABLE := true
465LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
Alex Deymo03a4de72016-07-20 16:08:23 -0700466LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymo03a4de72016-07-20 16:08:23 -0700467LOCAL_CPP_EXTENSION := .cc
Alex Deymo14c0da82016-07-20 16:45:45 -0700468LOCAL_CFLAGS := \
469 $(ue_common_cflags) \
470 -D_UE_SIDELOAD
Alex Deymo03a4de72016-07-20 16:08:23 -0700471LOCAL_CPPFLAGS := $(ue_common_cppflags)
472LOCAL_LDFLAGS := $(ue_common_ldflags)
473LOCAL_C_INCLUDES := \
474 $(ue_common_c_includes) \
475 bootable/recovery
476#TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
477# out of the DBus interface.
478LOCAL_C_INCLUDES += \
479 external/cros/system_api/dbus
480LOCAL_SRC_FILES := \
Connor O'Briencee6ad92016-11-21 13:53:52 -0800481 boot_control_recovery.cc \
Alex Deymo03a4de72016-07-20 16:08:23 -0700482 hardware_android.cc \
Tianjie Xud4c5deb2017-10-24 11:17:03 -0700483 metrics_reporter_stub.cc \
Tianjie Xu1b661142017-09-28 14:03:42 -0700484 metrics_utils.cc \
Alex Deymo03a4de72016-07-20 16:08:23 -0700485 network_selector_stub.cc \
486 proxy_resolver.cc \
487 sideload_main.cc \
488 update_attempter_android.cc \
489 update_status_utils.cc \
490 utils_android.cc
491LOCAL_STATIC_LIBRARIES := \
492 libfs_mgr \
bowgotsai763e17c2017-01-24 16:59:57 +0800493 libbase \
bowgotsaicd67f912017-01-27 14:50:26 +0800494 liblog \
Alex Deymo03a4de72016-07-20 16:08:23 -0700495 libpayload_consumer \
496 update_metadata-protos \
Dan Albert6cacaf52016-08-11 13:05:40 -0700497 $(ue_common_static_libraries) \
Alex Deymo03a4de72016-07-20 16:08:23 -0700498 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
499 $(ue_update_metadata_protos_exported_static_libraries)
Alex Deymo44348e02016-07-29 16:22:26 -0700500# We add the static versions of the shared libraries since we are forcing this
501# binary to be a static binary, so we also need to include all the static
502# library dependencies of these static libraries.
503LOCAL_STATIC_LIBRARIES += \
Alex Deymo03a4de72016-07-20 16:08:23 -0700504 $(ue_common_shared_libraries) \
Tom Cherry012aa5b2017-10-10 14:45:09 -0700505 libbase \
Dimitry Ivanove9ae98c2016-09-24 22:35:07 -0700506 liblog \
Alex Deymo03a4de72016-07-20 16:08:23 -0700507 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
Alex Deymo44348e02016-07-29 16:22:26 -0700508 $(ue_update_metadata_protos_exported_shared_libraries) \
509 libevent \
510 libmodpb64 \
511 libgtest_prod
Alex Deymo44348e02016-07-29 16:22:26 -0700512
513ifeq ($(strip $(PRODUCT_STATIC_BOOT_CONTROL_HAL)),)
514# No static boot_control HAL defined, so no sideload support. We use a fake
515# boot_control HAL to allow compiling update_engine_sideload for test purposes.
516ifeq ($(strip $(AB_OTA_UPDATER)),true)
517$(warning No PRODUCT_STATIC_BOOT_CONTROL_HAL configured but AB_OTA_UPDATER is \
518true, no update sideload support.)
519endif # AB_OTA_UPDATER == true
520LOCAL_SRC_FILES += \
521 boot_control_recovery_stub.cc
522else # PRODUCT_STATIC_BOOT_CONTROL_HAL != ""
523LOCAL_STATIC_LIBRARIES += \
524 $(PRODUCT_STATIC_BOOT_CONTROL_HAL)
525endif # PRODUCT_STATIC_BOOT_CONTROL_HAL != ""
526
Alex Deymo03a4de72016-07-20 16:08:23 -0700527include $(BUILD_EXECUTABLE)
528
Alex Deymoa96ddc12016-02-10 15:59:03 -0800529# libupdate_engine_client (type: shared_library)
530# ========================================================
531include $(CLEAR_VARS)
532LOCAL_MODULE := libupdate_engine_client
533LOCAL_CFLAGS := \
534 -Wall \
535 -Werror \
536 -Wno-unused-parameter \
Alex Deymoa96ddc12016-02-10 15:59:03 -0800537 -DUSE_BINDER=$(local_use_binder)
Alex Deymoa96ddc12016-02-10 15:59:03 -0800538LOCAL_CPP_EXTENSION := .cc
539# TODO(deymo): Remove "external/cros/system_api/dbus" when dbus is not used.
540LOCAL_C_INCLUDES := \
541 $(LOCAL_PATH)/client_library/include \
542 external/cros/system_api/dbus \
Dan Albert6cacaf52016-08-11 13:05:40 -0700543 system
Alex Deymoa96ddc12016-02-10 15:59:03 -0800544LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include
545LOCAL_SHARED_LIBRARIES := \
546 libchrome \
547 libbrillo
548LOCAL_SRC_FILES := \
549 client_library/client.cc \
550 update_status_utils.cc
551
Sen Jianga7c4de22017-03-02 15:53:54 -0800552# We only support binder IPC mechanism in Android.
Alex Deymoa96ddc12016-02-10 15:59:03 -0800553ifeq ($(local_use_binder),1)
554LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
555LOCAL_SHARED_LIBRARIES += \
556 libbinder \
557 libbrillo-binder \
558 libutils
559LOCAL_SRC_FILES += \
560 binder_bindings/android/brillo/IUpdateEngine.aidl \
561 binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl \
562 client_library/client_binder.cc \
563 parcelable_update_engine_status.cc
Alex Deymoa96ddc12016-02-10 15:59:03 -0800564endif # local_use_binder == 1
565
566include $(BUILD_SHARED_LIBRARY)
567
Alex Deymod5561a52015-09-03 23:17:52 -0700568# update_engine_client (type: executable)
569# ========================================================
570# update_engine console client.
571include $(CLEAR_VARS)
572LOCAL_MODULE := update_engine_client
573LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700574LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700575LOCAL_CFLAGS := $(ue_common_cflags)
576LOCAL_CPPFLAGS := $(ue_common_cppflags)
577LOCAL_LDFLAGS := $(ue_common_ldflags)
Casey Dahlince90f442016-01-25 16:55:28 -0800578LOCAL_C_INCLUDES := $(ue_common_c_includes)
Alex Deymo5f528112016-01-27 23:32:36 -0800579LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries)
Dan Albert6cacaf52016-08-11 13:05:40 -0700580LOCAL_STATIC_LIBRARIES := $(ue_common_static_libraries)
Sen Jiang192a86a2016-05-19 17:21:24 -0700581ifeq ($(local_use_omaha),1)
Alex Deymo5f528112016-01-27 23:32:36 -0800582LOCAL_SHARED_LIBRARIES += \
Casey Dahline844c1a2015-12-16 14:30:58 -0800583 libupdate_engine_client
Alex Deymod5561a52015-09-03 23:17:52 -0700584LOCAL_SRC_FILES := \
Shuqian Zhao29971732016-02-05 11:29:32 -0800585 update_engine_client.cc \
Alex Deymob3fa53b2016-04-18 19:57:58 -0700586 common/error_code_utils.cc \
587 omaha_utils.cc
Sen Jiang192a86a2016-05-19 17:21:24 -0700588else # local_use_omaha == 1
Alex Deymo5f528112016-01-27 23:32:36 -0800589#TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
590# out of the DBus interface.
591LOCAL_C_INCLUDES += \
592 external/cros/system_api/dbus
593LOCAL_SHARED_LIBRARIES += \
594 libbinder \
Alex Deymo2130ee02016-02-02 18:35:50 -0800595 libbinderwrapper \
Alex Deymo5f528112016-01-27 23:32:36 -0800596 libbrillo-binder \
597 libutils
598LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
599LOCAL_SRC_FILES := \
600 binder_bindings/android/os/IUpdateEngine.aidl \
601 binder_bindings/android/os/IUpdateEngineCallback.aidl \
Alex Deymoe88e9fe2016-02-03 16:38:00 -0800602 common/error_code_utils.cc \
Alex Deymo5f528112016-01-27 23:32:36 -0800603 update_engine_client_android.cc \
604 update_status_utils.cc
Sen Jiang192a86a2016-05-19 17:21:24 -0700605endif # local_use_omaha == 1
Alex Deymod5561a52015-09-03 23:17:52 -0700606include $(BUILD_EXECUTABLE)
607
608# libpayload_generator (type: static_library)
609# ========================================================
610# server-side code. This is used for delta_generator and unittests but not
611# for any client code.
Alex Deymoc372ab62015-10-29 00:43:26 -0700612ue_libpayload_generator_exported_static_libraries := \
Amin Hassani71be9372017-08-04 14:25:20 -0700613 libbsdiff \
Sen Jiang806f53d2017-08-17 16:00:34 -0700614 libdivsufsort \
615 libdivsufsort64 \
Tianjie Xu13df6002017-10-28 22:05:20 -0700616 libbrotli \
Alex Deymo246bf212016-03-22 19:27:33 -0700617 liblzma \
Amin Hassani3cd4df12017-08-25 11:21:53 -0700618 libpayload_consumer \
619 libpuffdiff \
Tianjie Xu1a7bb2c2018-01-22 17:56:57 -0800620 libz \
Amin Hassani71be9372017-08-04 14:25:20 -0700621 update_metadata-protos \
Alex Deymob09305e2015-12-02 16:09:13 -0300622 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700623 $(ue_update_metadata_protos_exported_static_libraries)
624ue_libpayload_generator_exported_shared_libraries := \
Alex Deymo89f6d672017-01-13 17:26:52 -0800625 libext2fs \
Alex Deymob09305e2015-12-02 16:09:13 -0300626 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700627 $(ue_update_metadata_protos_exported_shared_libraries)
628
Alex Deymo05e0e382015-12-07 20:18:16 -0800629ue_libpayload_generator_src_files := \
Alex Deymod5561a52015-09-03 23:17:52 -0700630 payload_generator/ab_generator.cc \
631 payload_generator/annotated_operation.cc \
632 payload_generator/blob_file_writer.cc \
633 payload_generator/block_mapping.cc \
Alex Deymo0bc26112015-10-19 20:54:57 -0700634 payload_generator/bzip.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700635 payload_generator/cycle_breaker.cc \
Amin Hassani924183b2017-09-27 14:50:59 -0700636 payload_generator/deflate_utils.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700637 payload_generator/delta_diff_generator.cc \
638 payload_generator/delta_diff_utils.cc \
639 payload_generator/ext2_filesystem.cc \
640 payload_generator/extent_ranges.cc \
641 payload_generator/extent_utils.cc \
642 payload_generator/full_update_generator.cc \
643 payload_generator/graph_types.cc \
644 payload_generator/graph_utils.cc \
645 payload_generator/inplace_generator.cc \
Alex Deymo20bdc702016-12-07 21:07:11 -0800646 payload_generator/mapfile_filesystem.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700647 payload_generator/payload_file.cc \
648 payload_generator/payload_generation_config.cc \
649 payload_generator/payload_signer.cc \
650 payload_generator/raw_filesystem.cc \
Amin Hassanid7da8f42017-08-23 14:29:40 -0700651 payload_generator/squashfs_filesystem.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700652 payload_generator/tarjan.cc \
Alex Deymo246bf212016-03-22 19:27:33 -0700653 payload_generator/topological_sort.cc \
654 payload_generator/xz_android.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800655
656ifeq ($(HOST_OS),linux)
657# Build for the host.
658include $(CLEAR_VARS)
659LOCAL_MODULE := libpayload_generator
660LOCAL_MODULE_CLASS := STATIC_LIBRARIES
661LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800662LOCAL_CFLAGS := $(ue_common_cflags)
663LOCAL_CPPFLAGS := $(ue_common_cppflags)
664LOCAL_LDFLAGS := $(ue_common_ldflags)
665LOCAL_C_INCLUDES := $(ue_common_c_includes)
666LOCAL_STATIC_LIBRARIES := \
Amin Hassani71be9372017-08-04 14:25:20 -0700667 libbsdiff \
Sen Jiang806f53d2017-08-17 16:00:34 -0700668 libdivsufsort \
669 libdivsufsort64 \
Alex Deymo246bf212016-03-22 19:27:33 -0700670 liblzma \
Amin Hassani3cd4df12017-08-25 11:21:53 -0700671 libpayload_consumer \
672 libpuffdiff \
Amin Hassani71be9372017-08-04 14:25:20 -0700673 update_metadata-protos \
Dan Albert6cacaf52016-08-11 13:05:40 -0700674 $(ue_common_static_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800675 $(ue_libpayload_consumer_exported_static_libraries) \
676 $(ue_update_metadata_protos_exported_static_libraries)
677LOCAL_SHARED_LIBRARIES := \
678 $(ue_common_shared_libraries) \
679 $(ue_libpayload_generator_exported_shared_libraries) \
680 $(ue_libpayload_consumer_exported_shared_libraries) \
681 $(ue_update_metadata_protos_exported_shared_libraries)
682LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
683include $(BUILD_HOST_STATIC_LIBRARY)
684endif # HOST_OS == linux
685
686# Build for the target.
687include $(CLEAR_VARS)
688LOCAL_MODULE := libpayload_generator
689LOCAL_MODULE_CLASS := STATIC_LIBRARIES
690LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800691LOCAL_CFLAGS := $(ue_common_cflags)
692LOCAL_CPPFLAGS := $(ue_common_cppflags)
693LOCAL_LDFLAGS := $(ue_common_ldflags)
694LOCAL_C_INCLUDES := $(ue_common_c_includes)
695LOCAL_STATIC_LIBRARIES := \
Sen Jiang806f53d2017-08-17 16:00:34 -0700696 libbsdiff \
697 libdivsufsort \
698 libdivsufsort64 \
Alex Deymo05e0e382015-12-07 20:18:16 -0800699 libpayload_consumer \
700 update_metadata-protos \
Alex Deymo246bf212016-03-22 19:27:33 -0700701 liblzma \
Dan Albert6cacaf52016-08-11 13:05:40 -0700702 $(ue_common_static_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800703 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
704 $(ue_update_metadata_protos_exported_static_libraries)
705LOCAL_SHARED_LIBRARIES := \
706 $(ue_common_shared_libraries) \
707 $(ue_libpayload_generator_exported_shared_libraries:-host=) \
708 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
709 $(ue_update_metadata_protos_exported_shared_libraries)
710LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700711include $(BUILD_STATIC_LIBRARY)
712
713# delta_generator (type: executable)
714# ========================================================
715# server-side delta generator.
Alex Deymo05e0e382015-12-07 20:18:16 -0800716ue_delta_generator_src_files := \
717 payload_generator/generate_delta_main.cc
718
719ifeq ($(HOST_OS),linux)
720# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -0700721include $(CLEAR_VARS)
722LOCAL_MODULE := delta_generator
723LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700724LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700725LOCAL_CFLAGS := $(ue_common_cflags)
726LOCAL_CPPFLAGS := $(ue_common_cppflags)
727LOCAL_LDFLAGS := $(ue_common_ldflags)
Alex Deymob09305e2015-12-02 16:09:13 -0300728LOCAL_C_INCLUDES := $(ue_common_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700729LOCAL_STATIC_LIBRARIES := \
Alex Deymob09305e2015-12-02 16:09:13 -0300730 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700731 libpayload_generator \
Dan Albert6cacaf52016-08-11 13:05:40 -0700732 $(ue_common_static_libraries) \
Alex Deymob09305e2015-12-02 16:09:13 -0300733 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700734 $(ue_libpayload_generator_exported_static_libraries)
735LOCAL_SHARED_LIBRARIES := \
736 $(ue_common_shared_libraries) \
Alex Deymob09305e2015-12-02 16:09:13 -0300737 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700738 $(ue_libpayload_generator_exported_shared_libraries)
Alex Deymo05e0e382015-12-07 20:18:16 -0800739LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
740include $(BUILD_HOST_EXECUTABLE)
741endif # HOST_OS == linux
742
743# Build for the target.
744include $(CLEAR_VARS)
Sen Jiang5a216c12016-03-30 13:08:24 -0700745LOCAL_MODULE := ue_unittest_delta_generator
746LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests
747LOCAL_MODULE_STEM := delta_generator
Alex Deymo05e0e382015-12-07 20:18:16 -0800748LOCAL_MODULE_CLASS := EXECUTABLES
749LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800750LOCAL_CFLAGS := $(ue_common_cflags)
751LOCAL_CPPFLAGS := $(ue_common_cppflags)
752LOCAL_LDFLAGS := $(ue_common_ldflags)
753LOCAL_C_INCLUDES := $(ue_common_c_includes)
754LOCAL_STATIC_LIBRARIES := \
755 libpayload_consumer \
756 libpayload_generator \
Dan Albert6cacaf52016-08-11 13:05:40 -0700757 $(ue_common_static_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800758 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
759 $(ue_libpayload_generator_exported_static_libraries:-host=)
760LOCAL_SHARED_LIBRARIES := \
761 $(ue_common_shared_libraries) \
762 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
763 $(ue_libpayload_generator_exported_shared_libraries:-host=)
764LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700765include $(BUILD_EXECUTABLE)
766
Sen Jiang923886a2016-03-14 15:04:28 -0700767# Private and public keys for unittests.
768# ========================================================
769# Generate a module that installs a prebuilt private key and a module that
770# installs a public key generated from the private key.
771#
772# $(1): The path to the private key in pem format.
773define ue-unittest-keys
774 $(eval include $(CLEAR_VARS)) \
775 $(eval LOCAL_MODULE := ue_$(1).pem) \
776 $(eval LOCAL_MODULE_CLASS := ETC) \
Sen Jiang923886a2016-03-14 15:04:28 -0700777 $(eval LOCAL_SRC_FILES := $(1).pem) \
778 $(eval LOCAL_MODULE_PATH := \
779 $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests) \
780 $(eval LOCAL_MODULE_STEM := $(1).pem) \
781 $(eval include $(BUILD_PREBUILT)) \
782 \
783 $(eval include $(CLEAR_VARS)) \
784 $(eval LOCAL_MODULE := ue_$(1).pub.pem) \
785 $(eval LOCAL_MODULE_CLASS := ETC) \
Sen Jiang923886a2016-03-14 15:04:28 -0700786 $(eval LOCAL_MODULE_PATH := \
787 $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests) \
788 $(eval LOCAL_MODULE_STEM := $(1).pub.pem) \
789 $(eval include $(BUILD_SYSTEM)/base_rules.mk) \
790 $(eval $(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(1).pem ; \
791 openssl rsa -in $$< -pubout -out $$@)
792endef
793
794$(call ue-unittest-keys,unittest_key)
795$(call ue-unittest-keys,unittest_key2)
796
Alex Deymoc90be632016-02-17 19:25:20 -0800797# Sample images for unittests.
798# ========================================================
799# Generate a prebuilt module that installs a sample image from the compressed
800# sample_images.tar.bz2 file used by the unittests.
801#
802# $(1): The filename in the sample_images.tar.bz2
803define ue-unittest-sample-image
804 $(eval include $(CLEAR_VARS)) \
805 $(eval LOCAL_MODULE := ue_unittest_$(1)) \
806 $(eval LOCAL_MODULE_CLASS := EXECUTABLES) \
Alex Deymoc90be632016-02-17 19:25:20 -0800807 $(eval LOCAL_MODULE_PATH := \
808 $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests/gen) \
809 $(eval LOCAL_MODULE_STEM := $(1)) \
Alex Deymoa3553e42016-03-04 18:55:05 -0800810 $(eval include $(BUILD_SYSTEM)/base_rules.mk) \
811 $(eval $(LOCAL_BUILT_MODULE) : \
812 $(LOCAL_PATH)/sample_images/sample_images.tar.bz2 ; \
813 tar -jxf $$< -C $$(dir $$@) $$(notdir $$@) && touch $$@)
Alex Deymoc90be632016-02-17 19:25:20 -0800814endef
815
816$(call ue-unittest-sample-image,disk_ext2_1k.img)
817$(call ue-unittest-sample-image,disk_ext2_4k.img)
818$(call ue-unittest-sample-image,disk_ext2_4k_empty.img)
Alex Deymod15c5462016-03-09 18:11:12 -0800819$(call ue-unittest-sample-image,disk_ext2_unittest.img)
Alex Deymoc90be632016-02-17 19:25:20 -0800820
Sen Jiangee63c6e2016-03-30 14:01:02 -0700821# update_engine.conf
822# ========================================================
823include $(CLEAR_VARS)
824LOCAL_MODULE := ue_unittest_update_engine.conf
825LOCAL_MODULE_CLASS := ETC
826LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests
827LOCAL_MODULE_STEM := update_engine.conf
828LOCAL_SRC_FILES := update_engine.conf
829include $(BUILD_PREBUILT)
830
Alex Deymo80f70ff2016-02-10 16:08:11 -0800831# test_http_server (type: executable)
832# ========================================================
833# Test HTTP Server.
834include $(CLEAR_VARS)
835LOCAL_MODULE := test_http_server
Alex Deymodc873fa2016-03-03 22:32:47 -0800836LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests
Alex Deymo80f70ff2016-02-10 16:08:11 -0800837LOCAL_MODULE_CLASS := EXECUTABLES
838LOCAL_CPP_EXTENSION := .cc
Alex Deymo80f70ff2016-02-10 16:08:11 -0800839LOCAL_CFLAGS := $(ue_common_cflags)
840LOCAL_CPPFLAGS := $(ue_common_cppflags)
841LOCAL_LDFLAGS := $(ue_common_ldflags)
842LOCAL_C_INCLUDES := $(ue_common_c_includes)
843LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries)
Dan Albert6cacaf52016-08-11 13:05:40 -0700844LOCAL_STATIC_LIBRARIES := $(ue_common_static_libraries)
Alex Deymo80f70ff2016-02-10 16:08:11 -0800845LOCAL_SRC_FILES := \
846 common/http_common.cc \
847 test_http_server.cc
Alex Deymodc873fa2016-03-03 22:32:47 -0800848include $(BUILD_EXECUTABLE)
Alex Deymo80f70ff2016-02-10 16:08:11 -0800849
Alex Deymo279d5722016-04-07 16:22:13 -0700850# test_subprocess (type: executable)
851# ========================================================
852# Test helper subprocess program.
853include $(CLEAR_VARS)
854LOCAL_MODULE := test_subprocess
Alex Deymo279d5722016-04-07 16:22:13 -0700855LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests
856LOCAL_MODULE_CLASS := EXECUTABLES
857LOCAL_CPP_EXTENSION := .cc
Alex Deymo279d5722016-04-07 16:22:13 -0700858LOCAL_CFLAGS := $(ue_common_cflags)
859LOCAL_CPPFLAGS := $(ue_common_cppflags)
860LOCAL_LDFLAGS := $(ue_common_ldflags)
861LOCAL_C_INCLUDES := $(ue_common_c_includes)
862LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries)
Dan Albert6cacaf52016-08-11 13:05:40 -0700863LOCAL_STATIC_LIBRARIES := $(ue_common_static_libraries)
Alex Deymo279d5722016-04-07 16:22:13 -0700864LOCAL_SRC_FILES := test_subprocess.cc
865include $(BUILD_EXECUTABLE)
866
Alex Deymo80f70ff2016-02-10 16:08:11 -0800867# update_engine_unittests (type: executable)
868# ========================================================
869# Main unittest file.
870include $(CLEAR_VARS)
871LOCAL_MODULE := update_engine_unittests
Alex Deymoc90be632016-02-17 19:25:20 -0800872LOCAL_REQUIRED_MODULES := \
Alex Deymo279d5722016-04-07 16:22:13 -0700873 test_http_server \
874 test_subprocess \
Sen Jiang5a216c12016-03-30 13:08:24 -0700875 ue_unittest_delta_generator \
Alex Deymoc90be632016-02-17 19:25:20 -0800876 ue_unittest_disk_ext2_1k.img \
877 ue_unittest_disk_ext2_4k.img \
878 ue_unittest_disk_ext2_4k_empty.img \
Sen Jiang923886a2016-03-14 15:04:28 -0700879 ue_unittest_disk_ext2_unittest.img \
880 ue_unittest_key.pem \
881 ue_unittest_key.pub.pem \
882 ue_unittest_key2.pem \
Sen Jiange0d04282016-03-01 14:22:52 -0800883 ue_unittest_key2.pub.pem \
Sen Jianga0507112017-10-06 15:18:46 -0700884 ue_unittest_update_engine.conf
Alex Deymo80f70ff2016-02-10 16:08:11 -0800885LOCAL_CPP_EXTENSION := .cc
Alex Deymo80f70ff2016-02-10 16:08:11 -0800886LOCAL_CFLAGS := $(ue_common_cflags)
887LOCAL_CPPFLAGS := $(ue_common_cppflags)
888LOCAL_LDFLAGS := $(ue_common_ldflags)
889LOCAL_C_INCLUDES := \
890 $(ue_common_c_includes) \
891 $(ue_libupdate_engine_exported_c_includes)
892LOCAL_STATIC_LIBRARIES := \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800893 libpayload_generator \
894 libbrillo-test-helpers \
895 libgmock \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800896 libchrome_test_helpers \
Dan Albert6cacaf52016-08-11 13:05:40 -0700897 $(ue_common_static_libraries) \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800898 $(ue_libpayload_generator_exported_static_libraries:-host=)
899LOCAL_SHARED_LIBRARIES := \
900 $(ue_common_shared_libraries) \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800901 $(ue_libpayload_generator_exported_shared_libraries:-host=)
902LOCAL_SRC_FILES := \
Alex Deymo14c0da82016-07-20 16:45:45 -0700903 certificate_checker_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800904 common/action_pipe_unittest.cc \
905 common/action_processor_unittest.cc \
906 common/action_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800907 common/cpu_limiter_unittest.cc \
908 common/fake_prefs.cc \
Alex Deymo2c131bb2016-05-26 16:43:13 -0700909 common/file_fetcher_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800910 common/hash_calculator_unittest.cc \
911 common/http_fetcher_unittest.cc \
912 common/hwid_override_unittest.cc \
913 common/mock_http_fetcher.cc \
914 common/prefs_unittest.cc \
915 common/subprocess_unittest.cc \
916 common/terminator_unittest.cc \
917 common/test_utils.cc \
918 common/utils_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800919 payload_consumer/bzip_extent_writer_unittest.cc \
Amin Hassaniacd7be82017-08-25 15:32:13 -0700920 payload_consumer/cached_file_descriptor_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800921 payload_consumer/delta_performer_integration_test.cc \
922 payload_consumer/delta_performer_unittest.cc \
Amin Hassaniee6d9a12017-08-31 14:09:15 -0700923 payload_consumer/extent_reader_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800924 payload_consumer/extent_writer_unittest.cc \
Alex Deymoa48f6302016-11-04 15:49:53 -0700925 payload_consumer/fake_file_descriptor.cc \
926 payload_consumer/file_descriptor_utils_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800927 payload_consumer/file_writer_unittest.cc \
928 payload_consumer/filesystem_verifier_action_unittest.cc \
929 payload_consumer/postinstall_runner_action_unittest.cc \
930 payload_consumer/xz_extent_writer_unittest.cc \
931 payload_generator/ab_generator_unittest.cc \
932 payload_generator/blob_file_writer_unittest.cc \
933 payload_generator/block_mapping_unittest.cc \
934 payload_generator/cycle_breaker_unittest.cc \
Amin Hassani924183b2017-09-27 14:50:59 -0700935 payload_generator/deflate_utils_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800936 payload_generator/delta_diff_utils_unittest.cc \
937 payload_generator/ext2_filesystem_unittest.cc \
938 payload_generator/extent_ranges_unittest.cc \
939 payload_generator/extent_utils_unittest.cc \
940 payload_generator/fake_filesystem.cc \
941 payload_generator/full_update_generator_unittest.cc \
942 payload_generator/graph_utils_unittest.cc \
943 payload_generator/inplace_generator_unittest.cc \
Alex Deymo20bdc702016-12-07 21:07:11 -0800944 payload_generator/mapfile_filesystem_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800945 payload_generator/payload_file_unittest.cc \
946 payload_generator/payload_generation_config_unittest.cc \
947 payload_generator/payload_signer_unittest.cc \
Amin Hassanid7da8f42017-08-23 14:29:40 -0700948 payload_generator/squashfs_filesystem_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800949 payload_generator/tarjan_unittest.cc \
950 payload_generator/topological_sort_unittest.cc \
951 payload_generator/zip_unittest.cc \
Alex Deymo35821942017-02-05 04:36:02 +0000952 proxy_resolver_unittest.cc \
Sen Jiang24ab6c02016-06-22 16:26:47 -0700953 testrunner.cc
954ifeq ($(local_use_omaha),1)
955LOCAL_C_INCLUDES += \
956 $(ue_libupdate_engine_exported_c_includes)
957LOCAL_STATIC_LIBRARIES += \
958 libupdate_engine \
959 $(ue_libupdate_engine_exported_static_libraries:-host=)
960LOCAL_SHARED_LIBRARIES += \
961 $(ue_libupdate_engine_exported_shared_libraries:-host=)
962LOCAL_SRC_FILES += \
963 common_service_unittest.cc \
964 fake_system_state.cc \
Sen Jiangb56fe9f2017-06-16 15:19:35 -0700965 image_properties_android_unittest.cc \
Tianjie Xu98333a82017-09-22 21:29:29 -0700966 metrics_reporter_omaha_unittest.cc \
Sen Jiang24ab6c02016-06-22 16:26:47 -0700967 metrics_utils_unittest.cc \
968 omaha_request_action_unittest.cc \
969 omaha_request_params_unittest.cc \
970 omaha_response_handler_action_unittest.cc \
971 omaha_utils_unittest.cc \
972 p2p_manager_unittest.cc \
973 payload_consumer/download_action_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800974 payload_state_unittest.cc \
Aaron Wood7f92e2b2017-08-28 14:51:21 -0700975 parcelable_update_engine_status_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800976 update_attempter_unittest.cc \
Aaron Wood56d8ab32017-09-22 15:56:18 -0700977 update_manager/android_things_policy_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800978 update_manager/boxed_value_unittest.cc \
Aaron Wood56d8ab32017-09-22 15:56:18 -0700979 update_manager/chromeos_policy.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800980 update_manager/chromeos_policy_unittest.cc \
981 update_manager/evaluation_context_unittest.cc \
982 update_manager/generic_variables_unittest.cc \
Aaron Wood56d8ab32017-09-22 15:56:18 -0700983 update_manager/next_update_check_policy_impl_unittest.cc \
984 update_manager/policy_test_utils.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800985 update_manager/prng_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800986 update_manager/real_device_policy_provider_unittest.cc \
987 update_manager/real_random_provider_unittest.cc \
Alex Deymo80f70ff2016-02-10 16:08:11 -0800988 update_manager/real_system_provider_unittest.cc \
989 update_manager/real_time_provider_unittest.cc \
990 update_manager/real_updater_provider_unittest.cc \
991 update_manager/umtest_utils.cc \
992 update_manager/update_manager_unittest.cc \
Sen Jiang24ab6c02016-06-22 16:26:47 -0700993 update_manager/variable_unittest.cc
994else # local_use_omaha == 1
995LOCAL_STATIC_LIBRARIES += \
996 libupdate_engine_android \
997 $(ue_libupdate_engine_android_exported_static_libraries:-host=)
998LOCAL_SHARED_LIBRARIES += \
999 $(ue_libupdate_engine_android_exported_shared_libraries:-host=)
Tianjie Xu90aaa102017-10-10 17:39:03 -07001000LOCAL_SRC_FILES += \
1001 update_attempter_android_unittest.cc
Sen Jiang24ab6c02016-06-22 16:26:47 -07001002endif # local_use_omaha == 1
Alex Deymo80f70ff2016-02-10 16:08:11 -08001003include $(BUILD_NATIVE_TEST)
Alex Deymo80f70ff2016-02-10 16:08:11 -08001004
Gaurav Shah263614f2015-09-24 14:20:38 -07001005# Update payload signing public key.
1006# ========================================================
Alex Deymo78850aa2017-04-05 04:25:36 -07001007ifeq ($(PRODUCT_IOT),true)
Gaurav Shah263614f2015-09-24 14:20:38 -07001008include $(CLEAR_VARS)
1009LOCAL_MODULE := brillo-update-payload-key
1010LOCAL_MODULE_CLASS := ETC
1011LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
1012LOCAL_MODULE_STEM := update-payload-key.pub.pem
1013LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
1014LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
1015include $(BUILD_PREBUILT)
Alex Deymo78850aa2017-04-05 04:25:36 -07001016endif # PRODUCT_IOT
Tao Bao042f8a12016-01-07 16:52:14 -08001017
1018# Brillo update payload generation script
1019# ========================================================
1020ifeq ($(HOST_OS),linux)
1021include $(CLEAR_VARS)
1022LOCAL_SRC_FILES := scripts/brillo_update_payload
1023LOCAL_MODULE := brillo_update_payload
1024LOCAL_MODULE_CLASS := EXECUTABLES
1025LOCAL_IS_HOST_MODULE := true
1026LOCAL_MODULE_TAGS := optional
1027LOCAL_REQUIRED_MODULES := \
1028 delta_generator \
Sen Jiangdb537c12017-09-20 14:53:05 -07001029 shflags \
1030 simg2img
Tao Bao042f8a12016-01-07 16:52:14 -08001031include $(BUILD_PREBUILT)
1032endif # HOST_OS == linux
Daniel Cardenas0c37e312017-11-06 12:01:33 -08001033
1034endif # ifneq ($(TARGET_BUILD_PDK),true)