Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2017 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 | |
Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame^] | 17 | package { |
| 18 | default_applicable_licenses: ["system_core_init_license"], |
| 19 | } |
| 20 | |
| 21 | // Added automatically by a large-scale-change |
| 22 | // See: http://go/android-license-faq |
| 23 | license { |
| 24 | name: "system_core_init_license", |
| 25 | visibility: [":__subpackages__"], |
| 26 | license_kinds: [ |
| 27 | "SPDX-license-identifier-Apache-2.0", |
| 28 | ], |
| 29 | license_text: [ |
| 30 | "NOTICE", |
| 31 | ], |
| 32 | } |
| 33 | |
Tom Cherry | 6619649 | 2020-02-06 11:56:58 -0800 | [diff] [blame] | 34 | init_common_sources = [ |
| 35 | "action.cpp", |
| 36 | "action_manager.cpp", |
| 37 | "action_parser.cpp", |
| 38 | "capabilities.cpp", |
| 39 | "epoll.cpp", |
| 40 | "import_parser.cpp", |
| 41 | "interface_utils.cpp", |
| 42 | "keychords.cpp", |
| 43 | "parser.cpp", |
| 44 | "property_type.cpp", |
| 45 | "rlimit_parser.cpp", |
| 46 | "service.cpp", |
| 47 | "service_list.cpp", |
| 48 | "service_parser.cpp", |
| 49 | "service_utils.cpp", |
| 50 | "subcontext.cpp", |
| 51 | "subcontext.proto", |
| 52 | "tokenizer.cpp", |
| 53 | "util.cpp", |
| 54 | ] |
| 55 | init_device_sources = [ |
David Anderson | 4117559 | 2020-03-20 19:38:28 -0700 | [diff] [blame] | 56 | "block_dev_initializer.cpp", |
Tom Cherry | 6619649 | 2020-02-06 11:56:58 -0800 | [diff] [blame] | 57 | "bootchart.cpp", |
| 58 | "builtins.cpp", |
| 59 | "devices.cpp", |
| 60 | "firmware_handler.cpp", |
Steve Muckle | a4bf2ce | 2019-11-01 13:58:02 -0700 | [diff] [blame] | 61 | "first_stage_console.cpp", |
Tom Cherry | 6619649 | 2020-02-06 11:56:58 -0800 | [diff] [blame] | 62 | "first_stage_init.cpp", |
| 63 | "first_stage_mount.cpp", |
| 64 | "fscrypt_init_extensions.cpp", |
| 65 | "init.cpp", |
| 66 | "lmkd_service.cpp", |
| 67 | "modalias_handler.cpp", |
| 68 | "mount_handler.cpp", |
| 69 | "mount_namespace.cpp", |
| 70 | "persistent_properties.cpp", |
| 71 | "persistent_properties.proto", |
| 72 | "property_service.cpp", |
| 73 | "property_service.proto", |
| 74 | "reboot.cpp", |
| 75 | "reboot_utils.cpp", |
| 76 | "security.cpp", |
| 77 | "selabel.cpp", |
| 78 | "selinux.cpp", |
| 79 | "sigchld_handler.cpp", |
David Anderson | 491e4da | 2020-12-08 00:21:20 -0800 | [diff] [blame] | 80 | "snapuserd_transition.cpp", |
Tom Cherry | 6619649 | 2020-02-06 11:56:58 -0800 | [diff] [blame] | 81 | "switch_root.cpp", |
| 82 | "uevent_listener.cpp", |
| 83 | "ueventd.cpp", |
| 84 | "ueventd_parser.cpp", |
| 85 | ] |
| 86 | init_host_sources = [ |
| 87 | "check_builtins.cpp", |
| 88 | "host_import_parser.cpp", |
| 89 | "host_init_verifier.cpp", |
| 90 | ] |
| 91 | |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 92 | cc_defaults { |
| 93 | name: "init_defaults", |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 94 | sanitize: { |
Tom Cherry | 2ffd65e | 2017-07-26 14:17:09 -0700 | [diff] [blame] | 95 | misc_undefined: ["signed-integer-overflow"], |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 96 | }, |
Chih-Hung Hsieh | 122352d | 2017-10-02 15:20:07 -0700 | [diff] [blame] | 97 | cflags: [ |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 98 | "-DLOG_UEVENTS=0", |
| 99 | "-Wall", |
| 100 | "-Wextra", |
| 101 | "-Wno-unused-parameter", |
| 102 | "-Werror", |
Tom Cherry | 802864c | 2020-03-12 14:29:25 -0700 | [diff] [blame] | 103 | "-Wthread-safety", |
Steve Muckle | d75f30a | 2019-05-21 15:50:39 -0700 | [diff] [blame] | 104 | "-DALLOW_FIRST_STAGE_CONSOLE=0", |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 105 | "-DALLOW_LOCAL_PROP_OVERRIDE=0", |
| 106 | "-DALLOW_PERMISSIVE_SELINUX=0", |
| 107 | "-DREBOOT_BOOTLOADER_ON_PANIC=0", |
| 108 | "-DWORLD_WRITABLE_KMSG=0", |
| 109 | "-DDUMP_ON_UMOUNT_FAILURE=0", |
| 110 | "-DSHUTDOWN_ZERO_TIMEOUT=0", |
Tom Cherry | a2f9136 | 2020-02-20 10:50:00 -0800 | [diff] [blame] | 111 | "-DINIT_FULL_SOURCES", |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 112 | ], |
| 113 | product_variables: { |
| 114 | debuggable: { |
| 115 | cppflags: [ |
Steve Muckle | d75f30a | 2019-05-21 15:50:39 -0700 | [diff] [blame] | 116 | "-UALLOW_FIRST_STAGE_CONSOLE", |
| 117 | "-DALLOW_FIRST_STAGE_CONSOLE=1", |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 118 | "-UALLOW_LOCAL_PROP_OVERRIDE", |
| 119 | "-DALLOW_LOCAL_PROP_OVERRIDE=1", |
| 120 | "-UALLOW_PERMISSIVE_SELINUX", |
| 121 | "-DALLOW_PERMISSIVE_SELINUX=1", |
| 122 | "-UREBOOT_BOOTLOADER_ON_PANIC", |
| 123 | "-DREBOOT_BOOTLOADER_ON_PANIC=1", |
| 124 | "-UWORLD_WRITABLE_KMSG", |
| 125 | "-DWORLD_WRITABLE_KMSG=1", |
| 126 | "-UDUMP_ON_UMOUNT_FAILURE", |
| 127 | "-DDUMP_ON_UMOUNT_FAILURE=1", |
| 128 | ], |
| 129 | }, |
| 130 | eng: { |
| 131 | cppflags: [ |
| 132 | "-USHUTDOWN_ZERO_TIMEOUT", |
| 133 | "-DSHUTDOWN_ZERO_TIMEOUT=1", |
| 134 | ], |
| 135 | }, |
Dmitry Shmidt | c3bc509 | 2017-08-23 14:57:07 -0700 | [diff] [blame] | 136 | uml: { |
| 137 | cppflags: ["-DUSER_MODE_LINUX"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 138 | }, |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 139 | }, |
Tom Cherry | 618d310 | 2018-01-19 14:25:48 -0800 | [diff] [blame] | 140 | static_libs: [ |
Tom Cherry | 618d310 | 2018-01-19 14:25:48 -0800 | [diff] [blame] | 141 | "libavb", |
Bowgo Tsai | 30afda7 | 2019-04-11 23:57:24 +0800 | [diff] [blame] | 142 | "libc++fs", |
Yifan Hong | d8ce1fb | 2019-03-22 17:21:58 -0700 | [diff] [blame] | 143 | "libcgrouprc_format", |
Suren Baghdasaryan | c29c2ba | 2019-10-22 17:18:42 -0700 | [diff] [blame] | 144 | "liblmkd_utils", |
Steve Muckle | 18b981e | 2019-04-15 17:43:02 -0700 | [diff] [blame] | 145 | "libmodprobe", |
Tom Cherry | 618d310 | 2018-01-19 14:25:48 -0800 | [diff] [blame] | 146 | "libprotobuf-cpp-lite", |
| 147 | "libpropertyinfoserializer", |
| 148 | "libpropertyinfoparser", |
David Anderson | aca0bea | 2020-09-21 16:34:25 -0700 | [diff] [blame] | 149 | "libsnapshot_cow", |
David Anderson | dfe6d07 | 2019-10-09 16:24:03 -0700 | [diff] [blame] | 150 | "libsnapshot_init", |
Jooyung Han | 1d951b7 | 2020-07-05 03:33:36 +0900 | [diff] [blame] | 151 | "libxml2", |
Jiyong Park | 648ae3a | 2019-12-08 00:25:15 +0900 | [diff] [blame] | 152 | "lib_apex_manifest_proto_lite", |
Yifan Hong | 66f0115 | 2020-04-16 11:05:16 -0700 | [diff] [blame] | 153 | "update_metadata-protos", |
Jiyong Park | 787322c | 2018-06-01 19:26:42 +0900 | [diff] [blame] | 154 | ], |
| 155 | shared_libs: [ |
Tom Cherry | 59656fb | 2019-05-28 10:19:44 -0700 | [diff] [blame] | 156 | "libbacktrace", |
Jiyong Park | 787322c | 2018-06-01 19:26:42 +0900 | [diff] [blame] | 157 | "libbase", |
Tao Bao | 66209ca | 2018-07-25 22:35:45 -0700 | [diff] [blame] | 158 | "libbootloader_message", |
| 159 | "libcutils", |
Jiyong Park | 787322c | 2018-06-01 19:26:42 +0900 | [diff] [blame] | 160 | "libdl", |
Tao Bao | 66209ca | 2018-07-25 22:35:45 -0700 | [diff] [blame] | 161 | "libext4_utils", |
| 162 | "libfs_mgr", |
David Anderson | 0e330f1 | 2019-01-03 18:16:56 -0800 | [diff] [blame] | 163 | "libgsi", |
Tao Bao | 66209ca | 2018-07-25 22:35:45 -0700 | [diff] [blame] | 164 | "libhidl-gen-utils", |
| 165 | "libkeyutils", |
| 166 | "liblog", |
| 167 | "liblogwrap", |
Tom Cherry | 7bfea3d | 2018-11-06 14:12:05 -0800 | [diff] [blame] | 168 | "liblp", |
Suren Baghdasaryan | 82b72a5 | 2018-12-21 11:41:50 -0800 | [diff] [blame] | 169 | "libprocessgroup", |
Yifan Hong | 6f9ce2e | 2019-03-05 15:47:16 -0800 | [diff] [blame] | 170 | "libprocessgroup_setup", |
Jiyong Park | 012171d | 2018-06-19 16:55:05 +0900 | [diff] [blame] | 171 | "libselinux", |
Martijn Coenen | 62e985a | 2018-09-04 06:29:14 +0200 | [diff] [blame] | 172 | "libutils", |
Tom Cherry | 618d310 | 2018-01-19 14:25:48 -0800 | [diff] [blame] | 173 | ], |
Jiyong Park | 93318d4 | 2018-12-26 17:34:39 +0900 | [diff] [blame] | 174 | bootstrap: true, |
Daniel Norman | 8082ba2 | 2019-07-23 10:26:15 -0700 | [diff] [blame] | 175 | visibility: [":__subpackages__"], |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | cc_library_static { |
| 179 | name: "libinit", |
Tom Cherry | 3143848 | 2018-07-20 14:57:00 -0700 | [diff] [blame] | 180 | recovery_available: true, |
Daniel Norman | 8082ba2 | 2019-07-23 10:26:15 -0700 | [diff] [blame] | 181 | defaults: [ |
| 182 | "init_defaults", |
| 183 | "selinux_policy_version", |
| 184 | ], |
Tom Cherry | 6619649 | 2020-02-06 11:56:58 -0800 | [diff] [blame] | 185 | srcs: init_common_sources + init_device_sources, |
Jooyung Han | 1d951b7 | 2020-07-05 03:33:36 +0900 | [diff] [blame] | 186 | generated_sources: [ |
| 187 | "apex-info-list", |
| 188 | ], |
Daniel Norman | 8082ba2 | 2019-07-23 10:26:15 -0700 | [diff] [blame] | 189 | whole_static_libs: [ |
| 190 | "libcap", |
| 191 | "com.android.sysprop.apex", |
Nikita Ioffe | 23dbd6d | 2019-11-14 01:21:24 +0000 | [diff] [blame] | 192 | "com.android.sysprop.init", |
Daniel Norman | 8082ba2 | 2019-07-23 10:26:15 -0700 | [diff] [blame] | 193 | ], |
Jayant Chowdhary | 478c7c1 | 2018-03-28 18:45:35 -0700 | [diff] [blame] | 194 | header_libs: ["bootimg_headers"], |
Tom Cherry | a97faba | 2017-09-15 15:44:04 -0700 | [diff] [blame] | 195 | proto: { |
| 196 | type: "lite", |
| 197 | export_proto_headers: true, |
| 198 | }, |
Martijn Coenen | 62e985a | 2018-09-04 06:29:14 +0200 | [diff] [blame] | 199 | |
| 200 | target: { |
| 201 | recovery: { |
| 202 | cflags: ["-DRECOVERY"], |
Jooyung Han | 1d951b7 | 2020-07-05 03:33:36 +0900 | [diff] [blame] | 203 | exclude_static_libs: [ |
| 204 | "libxml2", |
| 205 | ], |
| 206 | exclude_generated_sources: [ |
| 207 | "apex-info-list", |
| 208 | ], |
Daniel Norman | 8082ba2 | 2019-07-23 10:26:15 -0700 | [diff] [blame] | 209 | exclude_shared_libs: [ |
| 210 | "libbinder", |
| 211 | "libutils", |
| 212 | ], |
Martijn Coenen | 62e985a | 2018-09-04 06:29:14 +0200 | [diff] [blame] | 213 | }, |
| 214 | }, |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 215 | } |
| 216 | |
Steven Moreland | ceb36d0 | 2019-07-15 15:12:56 -0700 | [diff] [blame] | 217 | phony { |
| 218 | name: "init", |
| 219 | required: [ |
| 220 | "init_second_stage", |
| 221 | ], |
| 222 | } |
| 223 | |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 224 | cc_binary { |
Tom Cherry | 3143848 | 2018-07-20 14:57:00 -0700 | [diff] [blame] | 225 | name: "init_second_stage", |
| 226 | recovery_available: true, |
| 227 | stem: "init", |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 228 | defaults: ["init_defaults"], |
Tom Cherry | 3143848 | 2018-07-20 14:57:00 -0700 | [diff] [blame] | 229 | static_libs: ["libinit"], |
Jin Qian | 0045697 | 2017-07-06 11:43:45 -0700 | [diff] [blame] | 230 | required: [ |
| 231 | "e2fsdroid", |
Tom Cherry | c9f5353 | 2019-11-04 10:30:36 -0800 | [diff] [blame] | 232 | "init.rc", |
Jin Qian | 0045697 | 2017-07-06 11:43:45 -0700 | [diff] [blame] | 233 | "mke2fs", |
Jaegeuk Kim | 899ad55 | 2017-11-28 19:26:34 -0800 | [diff] [blame] | 234 | "sload_f2fs", |
| 235 | "make_f2fs", |
Tom Cherry | c9f5353 | 2019-11-04 10:30:36 -0800 | [diff] [blame] | 236 | "ueventd.rc", |
Jin Qian | 0045697 | 2017-07-06 11:43:45 -0700 | [diff] [blame] | 237 | ], |
Tom Cherry | 618d310 | 2018-01-19 14:25:48 -0800 | [diff] [blame] | 238 | srcs: ["main.cpp"], |
Tom Cherry | 3143848 | 2018-07-20 14:57:00 -0700 | [diff] [blame] | 239 | symlinks: ["ueventd"], |
Martijn Coenen | 62e985a | 2018-09-04 06:29:14 +0200 | [diff] [blame] | 240 | target: { |
| 241 | recovery: { |
| 242 | cflags: ["-DRECOVERY"], |
Jooyung Han | 1d951b7 | 2020-07-05 03:33:36 +0900 | [diff] [blame] | 243 | exclude_static_libs: [ |
| 244 | "libxml2", |
| 245 | ], |
Daniel Norman | 8082ba2 | 2019-07-23 10:26:15 -0700 | [diff] [blame] | 246 | exclude_shared_libs: [ |
| 247 | "libbinder", |
| 248 | "libutils", |
| 249 | ], |
Martijn Coenen | 62e985a | 2018-09-04 06:29:14 +0200 | [diff] [blame] | 250 | }, |
| 251 | }, |
Jiyong Park | 9035378 | 2021-01-25 18:41:40 +0900 | [diff] [blame] | 252 | visibility: ["//packages/modules/Virtualization/microdroid"], |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 253 | } |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 254 | |
Jiyong Park | 13eb053 | 2021-02-15 14:13:51 +0900 | [diff] [blame] | 255 | // This currently is only for the VM usecase. |
| 256 | // TODO(jiyong): replace init_first_stage in Android.mk with this |
| 257 | cc_binary { |
| 258 | name: "init_first_stage_soong", |
| 259 | stem: "init_vendor", |
| 260 | |
| 261 | srcs: [ |
| 262 | "block_dev_initializer.cpp", |
| 263 | "devices.cpp", |
| 264 | "first_stage_console.cpp", |
| 265 | "first_stage_init.cpp", |
| 266 | "first_stage_main.cpp", |
| 267 | "first_stage_mount.cpp", |
| 268 | "reboot_utils.cpp", |
| 269 | "selabel.cpp", |
| 270 | "selinux.cpp", |
| 271 | "service_utils.cpp", |
| 272 | "snapuserd_transition.cpp", |
| 273 | "switch_root.cpp", |
| 274 | "uevent_listener.cpp", |
| 275 | "util.cpp", |
| 276 | ], |
| 277 | |
| 278 | static_libs: [ |
| 279 | "libc++fs", |
| 280 | "libfs_avb", |
| 281 | "libfs_mgr", |
| 282 | "libfec", |
| 283 | "libfec_rs", |
| 284 | "libsquashfs_utils", |
| 285 | "liblogwrap", |
| 286 | "libext4_utils", |
| 287 | "libcrypto_utils", |
| 288 | "libsparse", |
| 289 | "libavb", |
| 290 | "libkeyutils", |
| 291 | "liblp", |
| 292 | "libcutils", |
| 293 | "libbase", |
| 294 | "liblog", |
| 295 | "libcrypto_static", |
| 296 | "libdl", |
| 297 | "libz", |
| 298 | "libselinux", |
| 299 | "libcap", |
| 300 | "libgsi", |
| 301 | "libcom.android.sysprop.apex", |
| 302 | "liblzma", |
| 303 | "libunwindstack_no_dex", |
| 304 | "libbacktrace_no_dex", |
| 305 | "libmodprobe", |
| 306 | "libext2_uuid", |
| 307 | "libprotobuf-cpp-lite", |
| 308 | "libsnapshot_cow", |
| 309 | "libsnapshot_init", |
| 310 | "update_metadata-protos", |
| 311 | ], |
| 312 | |
| 313 | static_executable: true, |
| 314 | |
| 315 | cflags: [ |
| 316 | "-Wall", |
| 317 | "-Wextra", |
| 318 | "-Wno-unused-parameter", |
| 319 | "-Werror", |
| 320 | "-DALLOW_FIRST_STAGE_CONSOLE=0", |
| 321 | "-DALLOW_LOCAL_PROP_OVERRIDE=0", |
| 322 | "-DALLOW_PERMISSIVE_SELINUX=0", |
| 323 | "-DREBOOT_BOOTLOADER_ON_PANIC=0", |
| 324 | "-DWORLD_WRITABLE_KMSG=0", |
| 325 | "-DDUMP_ON_UMOUNT_FAILURE=0", |
| 326 | "-DSHUTDOWN_ZERO_TIMEOUT=0", |
| 327 | "-DLOG_UEVENTS=0", |
| 328 | "-DSEPOLICY_VERSION=30", // TODO(jiyong): externalize the version number |
| 329 | ], |
| 330 | |
| 331 | product_variables: { |
| 332 | debuggable: { |
| 333 | cflags: [ |
| 334 | "-UALLOW_FIRST_STAGE_CONSOLE", |
| 335 | "-DALLOW_FIRST_STAGE_CONSOLE=1", |
| 336 | |
| 337 | "-UALLOW_LOCAL_PROP_OVERRIDE", |
| 338 | "-DALLOW_LOCAL_PROP_OVERRIDE=1", |
| 339 | |
| 340 | "-UALLOW_PERMISSIVE_SELINUX", |
| 341 | "-DALLOW_PERMISSIVE_SELINUX=1", |
| 342 | |
| 343 | "-UREBOOT_BOOTLOADER_ON_PANIC", |
| 344 | "-DREBOOT_BOOTLOADER_ON_PANIC=1", |
| 345 | |
| 346 | "-UWORLD_WRITABLE_KMSG", |
| 347 | "-DWORLD_WRITABLE_KMSG=1", |
| 348 | |
| 349 | "-UDUMP_ON_UMOUNT_FAILURE", |
| 350 | "-DDUMP_ON_UMOUNT_FAILURE=1", |
| 351 | ], |
| 352 | }, |
| 353 | |
| 354 | eng: { |
| 355 | cflags: [ |
| 356 | "-USHUTDOWN_ZERO_TIMEOUT", |
| 357 | "-DSHUTDOWN_ZERO_TIMEOUT=1", |
| 358 | ], |
| 359 | }, |
| 360 | }, |
| 361 | |
| 362 | sanitize: { |
| 363 | misc_undefined: ["signed-integer-overflow"], |
| 364 | hwaddress: false, |
| 365 | }, |
| 366 | } |
| 367 | |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 368 | // Tests |
| 369 | // ------------------------------------------------------------------------------ |
| 370 | |
| 371 | cc_test { |
Tom Cherry | 17b2be0 | 2019-08-20 10:43:48 -0700 | [diff] [blame] | 372 | name: "CtsInitTestCases", |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 373 | defaults: ["init_defaults"], |
Josh Gao | 6cad139 | 2019-08-27 16:02:38 -0700 | [diff] [blame] | 374 | require_root: true, |
| 375 | |
Tom Cherry | 17b2be0 | 2019-08-20 10:43:48 -0700 | [diff] [blame] | 376 | compile_multilib: "both", |
| 377 | multilib: { |
| 378 | lib32: { |
| 379 | suffix: "32", |
| 380 | }, |
| 381 | lib64: { |
| 382 | suffix: "64", |
| 383 | }, |
| 384 | }, |
| 385 | |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 386 | srcs: [ |
| 387 | "devices_test.cpp", |
Tom Cherry | dcb3d15 | 2019-08-07 16:02:28 -0700 | [diff] [blame] | 388 | "firmware_handler_test.cpp", |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 389 | "init_test.cpp", |
Mark Salyzyn | 75b901d | 2018-05-15 11:19:43 -0700 | [diff] [blame] | 390 | "keychords_test.cpp", |
Tom Cherry | bdbf504 | 2020-03-04 10:52:08 -0800 | [diff] [blame] | 391 | "oneshot_on_test.cpp", |
Tom Cherry | 16fad42 | 2017-08-04 15:59:03 -0700 | [diff] [blame] | 392 | "persistent_properties_test.cpp", |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 393 | "property_service_test.cpp", |
Tom Cherry | 927c5d5 | 2017-12-11 01:40:07 -0800 | [diff] [blame] | 394 | "property_type_test.cpp", |
Tom Cherry | 7ac013d | 2017-08-25 10:39:25 -0700 | [diff] [blame] | 395 | "rlimit_parser_test.cpp", |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 396 | "service_test.cpp", |
Tom Cherry | cb0f9bb | 2017-09-12 15:58:47 -0700 | [diff] [blame] | 397 | "subcontext_test.cpp", |
Tom Cherry | 2a5a4e7 | 2018-06-26 13:56:34 -0700 | [diff] [blame] | 398 | "tokenizer_test.cpp", |
Tom Cherry | 5f0198b | 2018-07-17 15:28:16 -0700 | [diff] [blame] | 399 | "ueventd_parser_test.cpp", |
Tom Cherry | c2e181c | 2017-07-14 16:29:23 -0700 | [diff] [blame] | 400 | "ueventd_test.cpp", |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 401 | "util_test.cpp", |
| 402 | ], |
Tom Cherry | 618d310 | 2018-01-19 14:25:48 -0800 | [diff] [blame] | 403 | static_libs: ["libinit"], |
Tom Cherry | 17b2be0 | 2019-08-20 10:43:48 -0700 | [diff] [blame] | 404 | |
| 405 | test_suites: [ |
| 406 | "cts", |
| 407 | "device-tests", |
Tom Cherry | 17b2be0 | 2019-08-20 10:43:48 -0700 | [diff] [blame] | 408 | ], |
Tom Cherry | 14fc013 | 2017-05-09 17:11:57 -0700 | [diff] [blame] | 409 | } |
| 410 | |
Tom Cherry | cb0f9bb | 2017-09-12 15:58:47 -0700 | [diff] [blame] | 411 | cc_benchmark { |
| 412 | name: "init_benchmarks", |
| 413 | defaults: ["init_defaults"], |
| 414 | srcs: [ |
| 415 | "subcontext_benchmark.cpp", |
| 416 | ], |
Tom Cherry | 618d310 | 2018-01-19 14:25:48 -0800 | [diff] [blame] | 417 | static_libs: ["libinit"], |
Tom Cherry | cb0f9bb | 2017-09-12 15:58:47 -0700 | [diff] [blame] | 418 | } |
| 419 | |
Tom Cherry | a2f9136 | 2020-02-20 10:50:00 -0800 | [diff] [blame] | 420 | cc_defaults { |
| 421 | name: "libinit_test_utils_libraries_defaults", |
| 422 | shared_libs: [ |
| 423 | "libbase", |
| 424 | "libcutils", |
| 425 | "libselinux", |
| 426 | "libhidl-gen-utils", |
| 427 | "liblog", |
| 428 | "libprocessgroup", |
| 429 | "libprotobuf-cpp-lite", |
| 430 | ], |
| 431 | } |
| 432 | |
| 433 | cc_library_static { |
| 434 | name: "libinit_test_utils", |
| 435 | defaults: ["libinit_test_utils_libraries_defaults"], |
| 436 | cflags: [ |
| 437 | "-Wall", |
| 438 | "-Wextra", |
| 439 | "-Wno-unused-parameter", |
| 440 | "-Werror", |
| 441 | ], |
| 442 | srcs: init_common_sources + [ |
| 443 | "test_utils/service_utils.cpp", |
| 444 | ], |
| 445 | whole_static_libs: [ |
| 446 | "libcap", |
| 447 | ], |
| 448 | export_include_dirs: ["test_utils/include"], // for tests |
| 449 | } |
| 450 | |
Tom Cherry | de6bd50 | 2018-02-13 16:50:08 -0800 | [diff] [blame] | 451 | // Host Verifier |
| 452 | // ------------------------------------------------------------------------------ |
| 453 | |
| 454 | genrule { |
| 455 | name: "generated_stub_builtin_function_map", |
Tom Cherry | 4772f1d | 2019-07-30 09:34:41 -0700 | [diff] [blame] | 456 | tool_files: ["host_builtin_map.py"], |
Tom Cherry | de6bd50 | 2018-02-13 16:50:08 -0800 | [diff] [blame] | 457 | out: ["generated_stub_builtin_function_map.h"], |
Daniel Norman | d2533c3 | 2019-08-02 15:13:50 -0700 | [diff] [blame] | 458 | srcs: [ |
| 459 | "builtins.cpp", |
| 460 | "check_builtins.cpp", |
| 461 | ], |
Tom Cherry | 4772f1d | 2019-07-30 09:34:41 -0700 | [diff] [blame] | 462 | cmd: "$(location host_builtin_map.py) --builtins $(location builtins.cpp) --check_builtins $(location check_builtins.cpp) > $(out)", |
Tom Cherry | de6bd50 | 2018-02-13 16:50:08 -0800 | [diff] [blame] | 463 | } |
| 464 | |
| 465 | cc_binary { |
| 466 | name: "host_init_verifier", |
| 467 | host_supported: true, |
Tom Cherry | de6bd50 | 2018-02-13 16:50:08 -0800 | [diff] [blame] | 468 | cflags: [ |
| 469 | "-Wall", |
| 470 | "-Wextra", |
| 471 | "-Wno-unused-parameter", |
| 472 | "-Werror", |
| 473 | ], |
| 474 | static_libs: [ |
| 475 | "libbase", |
| 476 | "libselinux", |
Tom Cherry | b5f2ec0 | 2019-11-08 17:54:27 -0800 | [diff] [blame] | 477 | "libpropertyinfoserializer", |
| 478 | "libpropertyinfoparser", |
Tom Cherry | de6bd50 | 2018-02-13 16:50:08 -0800 | [diff] [blame] | 479 | ], |
| 480 | whole_static_libs: ["libcap"], |
| 481 | shared_libs: [ |
Tom Cherry | de6bd50 | 2018-02-13 16:50:08 -0800 | [diff] [blame] | 482 | "libcutils", |
Daniel Norman | 3f42a76 | 2019-07-09 11:00:53 -0700 | [diff] [blame] | 483 | "libhidl-gen-utils", |
Steven Moreland | 422a758 | 2019-10-15 14:53:19 -0700 | [diff] [blame] | 484 | "libhidlmetadata", |
Daniel Norman | 3f42a76 | 2019-07-09 11:00:53 -0700 | [diff] [blame] | 485 | "liblog", |
| 486 | "libprocessgroup", |
| 487 | "libprotobuf-cpp-lite", |
Tom Cherry | de6bd50 | 2018-02-13 16:50:08 -0800 | [diff] [blame] | 488 | ], |
Tom Cherry | 6619649 | 2020-02-06 11:56:58 -0800 | [diff] [blame] | 489 | srcs: init_common_sources + init_host_sources, |
Tom Cherry | de6bd50 | 2018-02-13 16:50:08 -0800 | [diff] [blame] | 490 | proto: { |
| 491 | type: "lite", |
| 492 | }, |
Yifan Hong | 3c4aa11 | 2018-06-20 22:49:48 +0000 | [diff] [blame] | 493 | generated_headers: [ |
| 494 | "generated_stub_builtin_function_map", |
Daniel Norman | 8082ba2 | 2019-07-23 10:26:15 -0700 | [diff] [blame] | 495 | "generated_android_ids", |
Yifan Hong | 3c4aa11 | 2018-06-20 22:49:48 +0000 | [diff] [blame] | 496 | ], |
Tom Cherry | 96ff0fe | 2018-02-28 17:20:27 -0800 | [diff] [blame] | 497 | target: { |
Tom Cherry | 547f731 | 2018-02-28 21:40:46 -0800 | [diff] [blame] | 498 | android: { |
| 499 | enabled: false, |
| 500 | }, |
Tom Cherry | 96ff0fe | 2018-02-28 17:20:27 -0800 | [diff] [blame] | 501 | darwin: { |
Yifan Hong | 3c4aa11 | 2018-06-20 22:49:48 +0000 | [diff] [blame] | 502 | enabled: false, |
Tom Cherry | 96ff0fe | 2018-02-28 17:20:27 -0800 | [diff] [blame] | 503 | }, |
| 504 | }, |
Tom Cherry | de6bd50 | 2018-02-13 16:50:08 -0800 | [diff] [blame] | 505 | } |