2017-05-10 02:11:57 +02:00
|
|
|
//
|
|
|
|
// Copyright (C) 2017 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
2021-02-17 04:02:14 +01:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["system_core_init_license"],
|
|
|
|
}
|
|
|
|
|
|
|
|
// Added automatically by a large-scale-change
|
|
|
|
// See: http://go/android-license-faq
|
|
|
|
license {
|
|
|
|
name: "system_core_init_license",
|
|
|
|
visibility: [":__subpackages__"],
|
|
|
|
license_kinds: [
|
|
|
|
"SPDX-license-identifier-Apache-2.0",
|
|
|
|
],
|
|
|
|
license_text: [
|
|
|
|
"NOTICE",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2020-02-06 20:56:58 +01:00
|
|
|
init_common_sources = [
|
|
|
|
"action.cpp",
|
|
|
|
"action_manager.cpp",
|
|
|
|
"action_parser.cpp",
|
|
|
|
"capabilities.cpp",
|
|
|
|
"epoll.cpp",
|
|
|
|
"import_parser.cpp",
|
|
|
|
"interface_utils.cpp",
|
|
|
|
"keychords.cpp",
|
|
|
|
"parser.cpp",
|
|
|
|
"property_type.cpp",
|
|
|
|
"rlimit_parser.cpp",
|
|
|
|
"service.cpp",
|
|
|
|
"service_list.cpp",
|
|
|
|
"service_parser.cpp",
|
|
|
|
"service_utils.cpp",
|
|
|
|
"subcontext.cpp",
|
|
|
|
"subcontext.proto",
|
|
|
|
"tokenizer.cpp",
|
|
|
|
"util.cpp",
|
|
|
|
]
|
|
|
|
init_device_sources = [
|
2020-03-21 03:38:28 +01:00
|
|
|
"block_dev_initializer.cpp",
|
2020-02-06 20:56:58 +01:00
|
|
|
"bootchart.cpp",
|
|
|
|
"builtins.cpp",
|
|
|
|
"devices.cpp",
|
|
|
|
"firmware_handler.cpp",
|
2019-11-01 21:58:02 +01:00
|
|
|
"first_stage_console.cpp",
|
2020-02-06 20:56:58 +01:00
|
|
|
"first_stage_init.cpp",
|
|
|
|
"first_stage_mount.cpp",
|
|
|
|
"fscrypt_init_extensions.cpp",
|
|
|
|
"init.cpp",
|
|
|
|
"lmkd_service.cpp",
|
|
|
|
"modalias_handler.cpp",
|
|
|
|
"mount_handler.cpp",
|
|
|
|
"mount_namespace.cpp",
|
|
|
|
"persistent_properties.cpp",
|
|
|
|
"persistent_properties.proto",
|
|
|
|
"property_service.cpp",
|
|
|
|
"property_service.proto",
|
|
|
|
"reboot.cpp",
|
|
|
|
"reboot_utils.cpp",
|
|
|
|
"security.cpp",
|
|
|
|
"selabel.cpp",
|
|
|
|
"selinux.cpp",
|
|
|
|
"sigchld_handler.cpp",
|
init: Add an selinux transition for snapuserd.
With compressed VAB updates, it is not possible to mount /system without
first running snapuserd, which is the userspace component to the dm-user
kernel module. This poses a problem because as soon as selinux
enforcement is enabled, snapuserd (running in a kernel context) does not
have access to read and decompress the underlying system partition.
To account for this, we split SelinuxInitialize into multiple steps:
First, sepolicy is read into an in-memory string.
Second, the device-mapper tables for all snapshots are rebuilt. This
flushes any pending reads and creates new dm-user devices. The original
kernel-privileged snapuserd is then killed.
Third, sepolicy is loaded from the in-memory string.
Fourth, we re-launch snapuserd and connect it to the newly created
dm-user devices. As part of this step we restorecon device-mapper
devices and /dev/block/by-name/super, since the new snapuserd is in a
limited context.
Finally, we set enforcing mode.
This sequence ensures that snapuserd has appropriate privileges with a
minimal number of permissive audits.
Bug: 173476209
Test: full OTA with VABC applies and boots
Change-Id: Ie4e0f5166b01c31a6f337afc26fc58b96217604e
2020-12-08 09:21:20 +01:00
|
|
|
"snapuserd_transition.cpp",
|
2020-02-06 20:56:58 +01:00
|
|
|
"switch_root.cpp",
|
|
|
|
"uevent_listener.cpp",
|
|
|
|
"ueventd.cpp",
|
|
|
|
"ueventd_parser.cpp",
|
|
|
|
]
|
|
|
|
init_host_sources = [
|
|
|
|
"check_builtins.cpp",
|
|
|
|
"host_import_parser.cpp",
|
|
|
|
"host_init_verifier.cpp",
|
|
|
|
]
|
|
|
|
|
2017-05-10 02:11:57 +02:00
|
|
|
cc_defaults {
|
|
|
|
name: "init_defaults",
|
|
|
|
sanitize: {
|
2017-07-26 23:17:09 +02:00
|
|
|
misc_undefined: ["signed-integer-overflow"],
|
2017-05-10 02:11:57 +02:00
|
|
|
},
|
2017-10-03 00:20:07 +02:00
|
|
|
cflags: [
|
2017-05-10 02:11:57 +02:00
|
|
|
"-DLOG_UEVENTS=0",
|
|
|
|
"-Wall",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-Werror",
|
init: handle property messages asynchronously #2
A previous change moved property_service into its own thread, since
there was otherwise a deadlock whenever a process called by init would
try to set a property. This new thread, however, would send a message
via a blocking socket to init for each property that it received,
since init may need to take action depending on which property it is.
Unfortunately, this means that the deadlock is still possible, the
only difference is the socket's buffer must be filled before init deadlocks.
This change, therefore, adds the following:
1) A lock for instructing init to reboot
2) A lock for waiting on properties
3) A lock for queueing new properties
A previous version of this change was reverted and added locks around
all service operations and allowed the property thread to spawn
services directly. This was complex due to the fact that this code
was not designed to be multi-threaded. It was reverted due to
apparent issues during reboot. This change keeps a queue of processes
pending control messages, which it will then handle in the future. It
is less flexible but safer.
Bug: 146877356
Bug: 148236233
Bug: 150863651
Bug: 151251827
Test: multiple reboot tests, safely restarting hwservicemanager
Change-Id: Ice773436e85d3bf636bb0a892f3f6002bdf996b6
2020-03-12 22:29:25 +01:00
|
|
|
"-Wthread-safety",
|
2019-05-22 00:50:39 +02:00
|
|
|
"-DALLOW_FIRST_STAGE_CONSOLE=0",
|
2017-05-10 02:11:57 +02:00
|
|
|
"-DALLOW_LOCAL_PROP_OVERRIDE=0",
|
|
|
|
"-DALLOW_PERMISSIVE_SELINUX=0",
|
|
|
|
"-DREBOOT_BOOTLOADER_ON_PANIC=0",
|
|
|
|
"-DWORLD_WRITABLE_KMSG=0",
|
|
|
|
"-DDUMP_ON_UMOUNT_FAILURE=0",
|
|
|
|
"-DSHUTDOWN_ZERO_TIMEOUT=0",
|
2020-02-20 19:50:00 +01:00
|
|
|
"-DINIT_FULL_SOURCES",
|
2017-05-10 02:11:57 +02:00
|
|
|
],
|
|
|
|
product_variables: {
|
|
|
|
debuggable: {
|
|
|
|
cppflags: [
|
2019-05-22 00:50:39 +02:00
|
|
|
"-UALLOW_FIRST_STAGE_CONSOLE",
|
|
|
|
"-DALLOW_FIRST_STAGE_CONSOLE=1",
|
2017-05-10 02:11:57 +02:00
|
|
|
"-UALLOW_LOCAL_PROP_OVERRIDE",
|
|
|
|
"-DALLOW_LOCAL_PROP_OVERRIDE=1",
|
|
|
|
"-UALLOW_PERMISSIVE_SELINUX",
|
|
|
|
"-DALLOW_PERMISSIVE_SELINUX=1",
|
|
|
|
"-UREBOOT_BOOTLOADER_ON_PANIC",
|
|
|
|
"-DREBOOT_BOOTLOADER_ON_PANIC=1",
|
|
|
|
"-UWORLD_WRITABLE_KMSG",
|
|
|
|
"-DWORLD_WRITABLE_KMSG=1",
|
|
|
|
"-UDUMP_ON_UMOUNT_FAILURE",
|
|
|
|
"-DDUMP_ON_UMOUNT_FAILURE=1",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
eng: {
|
|
|
|
cppflags: [
|
|
|
|
"-USHUTDOWN_ZERO_TIMEOUT",
|
|
|
|
"-DSHUTDOWN_ZERO_TIMEOUT=1",
|
|
|
|
],
|
|
|
|
},
|
2017-08-23 23:57:07 +02:00
|
|
|
uml: {
|
|
|
|
cppflags: ["-DUSER_MODE_LINUX"],
|
2018-02-17 02:58:14 +01:00
|
|
|
},
|
2017-05-10 02:11:57 +02:00
|
|
|
},
|
2018-01-19 23:25:48 +01:00
|
|
|
static_libs: [
|
|
|
|
"libavb",
|
2019-04-11 17:57:24 +02:00
|
|
|
"libc++fs",
|
2019-03-23 01:21:58 +01:00
|
|
|
"libcgrouprc_format",
|
2019-10-23 02:18:42 +02:00
|
|
|
"liblmkd_utils",
|
2019-04-16 02:43:02 +02:00
|
|
|
"libmodprobe",
|
2018-01-19 23:25:48 +01:00
|
|
|
"libprotobuf-cpp-lite",
|
|
|
|
"libpropertyinfoserializer",
|
|
|
|
"libpropertyinfoparser",
|
2020-09-22 01:34:25 +02:00
|
|
|
"libsnapshot_cow",
|
2019-10-10 01:24:03 +02:00
|
|
|
"libsnapshot_init",
|
2020-07-04 20:33:36 +02:00
|
|
|
"libxml2",
|
2019-12-07 16:25:15 +01:00
|
|
|
"lib_apex_manifest_proto_lite",
|
2020-04-16 20:05:16 +02:00
|
|
|
"update_metadata-protos",
|
2018-06-01 12:26:42 +02:00
|
|
|
],
|
|
|
|
shared_libs: [
|
2019-05-28 19:19:44 +02:00
|
|
|
"libbacktrace",
|
2018-06-01 12:26:42 +02:00
|
|
|
"libbase",
|
2018-07-26 07:35:45 +02:00
|
|
|
"libbootloader_message",
|
|
|
|
"libcutils",
|
2018-06-01 12:26:42 +02:00
|
|
|
"libdl",
|
2018-07-26 07:35:45 +02:00
|
|
|
"libext4_utils",
|
|
|
|
"libfs_mgr",
|
2019-01-04 03:16:56 +01:00
|
|
|
"libgsi",
|
2018-07-26 07:35:45 +02:00
|
|
|
"libhidl-gen-utils",
|
|
|
|
"libkeyutils",
|
|
|
|
"liblog",
|
|
|
|
"liblogwrap",
|
2018-11-06 23:12:05 +01:00
|
|
|
"liblp",
|
2018-12-21 20:41:50 +01:00
|
|
|
"libprocessgroup",
|
2019-03-06 00:47:16 +01:00
|
|
|
"libprocessgroup_setup",
|
2018-06-19 09:55:05 +02:00
|
|
|
"libselinux",
|
2018-09-04 06:29:14 +02:00
|
|
|
"libutils",
|
2018-01-19 23:25:48 +01:00
|
|
|
],
|
2018-12-26 09:34:39 +01:00
|
|
|
bootstrap: true,
|
2019-07-23 19:26:15 +02:00
|
|
|
visibility: [":__subpackages__"],
|
2017-05-10 02:11:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libinit",
|
2018-07-20 23:57:00 +02:00
|
|
|
recovery_available: true,
|
2019-07-23 19:26:15 +02:00
|
|
|
defaults: [
|
|
|
|
"init_defaults",
|
|
|
|
"selinux_policy_version",
|
|
|
|
],
|
2020-02-06 20:56:58 +01:00
|
|
|
srcs: init_common_sources + init_device_sources,
|
2020-07-04 20:33:36 +02:00
|
|
|
generated_sources: [
|
|
|
|
"apex-info-list",
|
|
|
|
],
|
2019-07-23 19:26:15 +02:00
|
|
|
whole_static_libs: [
|
|
|
|
"libcap",
|
|
|
|
"com.android.sysprop.apex",
|
2019-11-14 02:21:24 +01:00
|
|
|
"com.android.sysprop.init",
|
2019-07-23 19:26:15 +02:00
|
|
|
],
|
2018-03-29 03:45:35 +02:00
|
|
|
header_libs: ["bootimg_headers"],
|
2017-09-16 00:44:04 +02:00
|
|
|
proto: {
|
|
|
|
type: "lite",
|
|
|
|
export_proto_headers: true,
|
|
|
|
},
|
2018-09-04 06:29:14 +02:00
|
|
|
|
|
|
|
target: {
|
|
|
|
recovery: {
|
|
|
|
cflags: ["-DRECOVERY"],
|
2020-07-04 20:33:36 +02:00
|
|
|
exclude_static_libs: [
|
|
|
|
"libxml2",
|
|
|
|
],
|
|
|
|
exclude_generated_sources: [
|
|
|
|
"apex-info-list",
|
|
|
|
],
|
2019-07-23 19:26:15 +02:00
|
|
|
exclude_shared_libs: [
|
|
|
|
"libbinder",
|
|
|
|
"libutils",
|
|
|
|
],
|
2018-09-04 06:29:14 +02:00
|
|
|
},
|
|
|
|
},
|
2017-05-10 02:11:57 +02:00
|
|
|
}
|
|
|
|
|
2019-07-16 00:12:56 +02:00
|
|
|
phony {
|
|
|
|
name: "init",
|
|
|
|
required: [
|
|
|
|
"init_second_stage",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2017-05-10 02:11:57 +02:00
|
|
|
cc_binary {
|
2018-07-20 23:57:00 +02:00
|
|
|
name: "init_second_stage",
|
|
|
|
recovery_available: true,
|
|
|
|
stem: "init",
|
2017-05-10 02:11:57 +02:00
|
|
|
defaults: ["init_defaults"],
|
2018-07-20 23:57:00 +02:00
|
|
|
static_libs: ["libinit"],
|
2017-07-06 20:43:45 +02:00
|
|
|
required: [
|
|
|
|
"e2fsdroid",
|
2019-11-04 19:30:36 +01:00
|
|
|
"init.rc",
|
2017-07-06 20:43:45 +02:00
|
|
|
"mke2fs",
|
2017-11-29 04:26:34 +01:00
|
|
|
"sload_f2fs",
|
|
|
|
"make_f2fs",
|
2019-11-04 19:30:36 +01:00
|
|
|
"ueventd.rc",
|
2017-07-06 20:43:45 +02:00
|
|
|
],
|
2018-01-19 23:25:48 +01:00
|
|
|
srcs: ["main.cpp"],
|
2018-07-20 23:57:00 +02:00
|
|
|
symlinks: ["ueventd"],
|
2018-09-04 06:29:14 +02:00
|
|
|
target: {
|
|
|
|
recovery: {
|
|
|
|
cflags: ["-DRECOVERY"],
|
2020-07-04 20:33:36 +02:00
|
|
|
exclude_static_libs: [
|
|
|
|
"libxml2",
|
|
|
|
],
|
2019-07-23 19:26:15 +02:00
|
|
|
exclude_shared_libs: [
|
|
|
|
"libbinder",
|
|
|
|
"libutils",
|
|
|
|
],
|
2018-09-04 06:29:14 +02:00
|
|
|
},
|
|
|
|
},
|
2021-01-25 10:41:40 +01:00
|
|
|
visibility: ["//packages/modules/Virtualization/microdroid"],
|
2017-05-10 02:11:57 +02:00
|
|
|
}
|
|
|
|
|
2021-02-15 06:13:51 +01:00
|
|
|
// This currently is only for the VM usecase.
|
|
|
|
// TODO(jiyong): replace init_first_stage in Android.mk with this
|
|
|
|
cc_binary {
|
|
|
|
name: "init_first_stage_soong",
|
|
|
|
stem: "init_vendor",
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"block_dev_initializer.cpp",
|
|
|
|
"devices.cpp",
|
|
|
|
"first_stage_console.cpp",
|
|
|
|
"first_stage_init.cpp",
|
|
|
|
"first_stage_main.cpp",
|
|
|
|
"first_stage_mount.cpp",
|
|
|
|
"reboot_utils.cpp",
|
|
|
|
"selabel.cpp",
|
|
|
|
"selinux.cpp",
|
|
|
|
"service_utils.cpp",
|
|
|
|
"snapuserd_transition.cpp",
|
|
|
|
"switch_root.cpp",
|
|
|
|
"uevent_listener.cpp",
|
|
|
|
"util.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"libc++fs",
|
|
|
|
"libfs_avb",
|
|
|
|
"libfs_mgr",
|
|
|
|
"libfec",
|
|
|
|
"libfec_rs",
|
|
|
|
"libsquashfs_utils",
|
|
|
|
"liblogwrap",
|
|
|
|
"libext4_utils",
|
|
|
|
"libcrypto_utils",
|
|
|
|
"libsparse",
|
|
|
|
"libavb",
|
|
|
|
"libkeyutils",
|
|
|
|
"liblp",
|
|
|
|
"libcutils",
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
|
|
|
"libcrypto_static",
|
|
|
|
"libdl",
|
|
|
|
"libz",
|
|
|
|
"libselinux",
|
|
|
|
"libcap",
|
|
|
|
"libgsi",
|
|
|
|
"libcom.android.sysprop.apex",
|
|
|
|
"liblzma",
|
|
|
|
"libunwindstack_no_dex",
|
|
|
|
"libbacktrace_no_dex",
|
|
|
|
"libmodprobe",
|
|
|
|
"libext2_uuid",
|
|
|
|
"libprotobuf-cpp-lite",
|
|
|
|
"libsnapshot_cow",
|
|
|
|
"libsnapshot_init",
|
|
|
|
"update_metadata-protos",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_executable: true,
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-Werror",
|
|
|
|
"-DALLOW_FIRST_STAGE_CONSOLE=0",
|
|
|
|
"-DALLOW_LOCAL_PROP_OVERRIDE=0",
|
|
|
|
"-DALLOW_PERMISSIVE_SELINUX=0",
|
|
|
|
"-DREBOOT_BOOTLOADER_ON_PANIC=0",
|
|
|
|
"-DWORLD_WRITABLE_KMSG=0",
|
|
|
|
"-DDUMP_ON_UMOUNT_FAILURE=0",
|
|
|
|
"-DSHUTDOWN_ZERO_TIMEOUT=0",
|
|
|
|
"-DLOG_UEVENTS=0",
|
|
|
|
"-DSEPOLICY_VERSION=30", // TODO(jiyong): externalize the version number
|
|
|
|
],
|
|
|
|
|
|
|
|
product_variables: {
|
|
|
|
debuggable: {
|
|
|
|
cflags: [
|
|
|
|
"-UALLOW_FIRST_STAGE_CONSOLE",
|
|
|
|
"-DALLOW_FIRST_STAGE_CONSOLE=1",
|
|
|
|
|
|
|
|
"-UALLOW_LOCAL_PROP_OVERRIDE",
|
|
|
|
"-DALLOW_LOCAL_PROP_OVERRIDE=1",
|
|
|
|
|
|
|
|
"-UALLOW_PERMISSIVE_SELINUX",
|
|
|
|
"-DALLOW_PERMISSIVE_SELINUX=1",
|
|
|
|
|
|
|
|
"-UREBOOT_BOOTLOADER_ON_PANIC",
|
|
|
|
"-DREBOOT_BOOTLOADER_ON_PANIC=1",
|
|
|
|
|
|
|
|
"-UWORLD_WRITABLE_KMSG",
|
|
|
|
"-DWORLD_WRITABLE_KMSG=1",
|
|
|
|
|
|
|
|
"-UDUMP_ON_UMOUNT_FAILURE",
|
|
|
|
"-DDUMP_ON_UMOUNT_FAILURE=1",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
eng: {
|
|
|
|
cflags: [
|
|
|
|
"-USHUTDOWN_ZERO_TIMEOUT",
|
|
|
|
"-DSHUTDOWN_ZERO_TIMEOUT=1",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
sanitize: {
|
|
|
|
misc_undefined: ["signed-integer-overflow"],
|
|
|
|
hwaddress: false,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2017-05-10 02:11:57 +02:00
|
|
|
// Tests
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
cc_test {
|
2019-08-20 19:43:48 +02:00
|
|
|
name: "CtsInitTestCases",
|
2017-05-10 02:11:57 +02:00
|
|
|
defaults: ["init_defaults"],
|
2019-08-28 01:02:38 +02:00
|
|
|
require_root: true,
|
|
|
|
|
2019-08-20 19:43:48 +02:00
|
|
|
compile_multilib: "both",
|
|
|
|
multilib: {
|
|
|
|
lib32: {
|
|
|
|
suffix: "32",
|
|
|
|
},
|
|
|
|
lib64: {
|
|
|
|
suffix: "64",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2017-05-10 02:11:57 +02:00
|
|
|
srcs: [
|
|
|
|
"devices_test.cpp",
|
2019-08-08 01:02:28 +02:00
|
|
|
"firmware_handler_test.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"init_test.cpp",
|
2018-05-15 20:19:43 +02:00
|
|
|
"keychords_test.cpp",
|
2020-03-04 19:52:08 +01:00
|
|
|
"oneshot_on_test.cpp",
|
2017-08-05 00:59:03 +02:00
|
|
|
"persistent_properties_test.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"property_service_test.cpp",
|
2017-12-11 10:40:07 +01:00
|
|
|
"property_type_test.cpp",
|
2017-08-25 19:39:25 +02:00
|
|
|
"rlimit_parser_test.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"service_test.cpp",
|
2017-09-13 00:58:47 +02:00
|
|
|
"subcontext_test.cpp",
|
2018-06-26 22:56:34 +02:00
|
|
|
"tokenizer_test.cpp",
|
2018-07-18 00:28:16 +02:00
|
|
|
"ueventd_parser_test.cpp",
|
2017-07-15 01:29:23 +02:00
|
|
|
"ueventd_test.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"util_test.cpp",
|
|
|
|
],
|
2018-01-19 23:25:48 +01:00
|
|
|
static_libs: ["libinit"],
|
2019-08-20 19:43:48 +02:00
|
|
|
|
|
|
|
test_suites: [
|
|
|
|
"cts",
|
|
|
|
"device-tests",
|
|
|
|
],
|
2017-05-10 02:11:57 +02:00
|
|
|
}
|
|
|
|
|
2017-09-13 00:58:47 +02:00
|
|
|
cc_benchmark {
|
|
|
|
name: "init_benchmarks",
|
|
|
|
defaults: ["init_defaults"],
|
|
|
|
srcs: [
|
|
|
|
"subcontext_benchmark.cpp",
|
|
|
|
],
|
2018-01-19 23:25:48 +01:00
|
|
|
static_libs: ["libinit"],
|
2017-09-13 00:58:47 +02:00
|
|
|
}
|
|
|
|
|
2020-02-20 19:50:00 +01:00
|
|
|
cc_defaults {
|
|
|
|
name: "libinit_test_utils_libraries_defaults",
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libcutils",
|
|
|
|
"libselinux",
|
|
|
|
"libhidl-gen-utils",
|
|
|
|
"liblog",
|
|
|
|
"libprocessgroup",
|
|
|
|
"libprotobuf-cpp-lite",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libinit_test_utils",
|
|
|
|
defaults: ["libinit_test_utils_libraries_defaults"],
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
srcs: init_common_sources + [
|
|
|
|
"test_utils/service_utils.cpp",
|
|
|
|
],
|
|
|
|
whole_static_libs: [
|
|
|
|
"libcap",
|
|
|
|
],
|
|
|
|
export_include_dirs: ["test_utils/include"], // for tests
|
|
|
|
}
|
|
|
|
|
2018-02-14 01:50:08 +01:00
|
|
|
// Host Verifier
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "generated_stub_builtin_function_map",
|
2019-07-30 18:34:41 +02:00
|
|
|
tool_files: ["host_builtin_map.py"],
|
2018-02-14 01:50:08 +01:00
|
|
|
out: ["generated_stub_builtin_function_map.h"],
|
2019-08-03 00:13:50 +02:00
|
|
|
srcs: [
|
|
|
|
"builtins.cpp",
|
|
|
|
"check_builtins.cpp",
|
|
|
|
],
|
2019-07-30 18:34:41 +02:00
|
|
|
cmd: "$(location host_builtin_map.py) --builtins $(location builtins.cpp) --check_builtins $(location check_builtins.cpp) > $(out)",
|
2018-02-14 01:50:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "host_init_verifier",
|
|
|
|
host_supported: true,
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libselinux",
|
2019-11-09 02:54:27 +01:00
|
|
|
"libpropertyinfoserializer",
|
|
|
|
"libpropertyinfoparser",
|
2018-02-14 01:50:08 +01:00
|
|
|
],
|
|
|
|
whole_static_libs: ["libcap"],
|
|
|
|
shared_libs: [
|
2019-07-09 20:00:53 +02:00
|
|
|
"libcutils",
|
2018-02-14 01:50:08 +01:00
|
|
|
"libhidl-gen-utils",
|
2019-10-15 23:53:19 +02:00
|
|
|
"libhidlmetadata",
|
2018-02-14 01:50:08 +01:00
|
|
|
"liblog",
|
2019-07-09 20:00:53 +02:00
|
|
|
"libprocessgroup",
|
|
|
|
"libprotobuf-cpp-lite",
|
2018-02-14 01:50:08 +01:00
|
|
|
],
|
2020-02-06 20:56:58 +01:00
|
|
|
srcs: init_common_sources + init_host_sources,
|
2018-02-14 01:50:08 +01:00
|
|
|
proto: {
|
|
|
|
type: "lite",
|
|
|
|
},
|
2018-06-21 00:49:48 +02:00
|
|
|
generated_headers: [
|
|
|
|
"generated_stub_builtin_function_map",
|
2019-07-23 19:26:15 +02:00
|
|
|
"generated_android_ids",
|
2018-06-21 00:49:48 +02:00
|
|
|
],
|
2018-03-01 02:20:27 +01:00
|
|
|
target: {
|
2018-03-01 06:40:46 +01:00
|
|
|
android: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
2018-03-01 02:20:27 +01:00
|
|
|
darwin: {
|
2018-06-21 00:49:48 +02:00
|
|
|
enabled: false,
|
2018-03-01 02:20:27 +01:00
|
|
|
},
|
|
|
|
},
|
2018-02-14 01:50:08 +01:00
|
|
|
}
|