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.
|
|
|
|
//
|
|
|
|
|
|
|
|
cc_defaults {
|
|
|
|
name: "init_defaults",
|
|
|
|
cpp_std: "experimental",
|
|
|
|
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",
|
|
|
|
"-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",
|
|
|
|
],
|
|
|
|
product_variables: {
|
|
|
|
debuggable: {
|
|
|
|
cppflags: [
|
|
|
|
"-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: [
|
|
|
|
"libbootloader_message",
|
|
|
|
"libfs_mgr",
|
|
|
|
"libfec",
|
|
|
|
"libfec_rs",
|
|
|
|
"libhidl-gen-utils",
|
|
|
|
"libsquashfs_utils",
|
|
|
|
"liblogwrap",
|
|
|
|
"libext4_utils",
|
|
|
|
"libseccomp_policy",
|
|
|
|
"libcrypto_utils",
|
|
|
|
"libsparse",
|
|
|
|
"libprocessgroup",
|
|
|
|
"libavb",
|
|
|
|
"libkeyutils",
|
|
|
|
"libprotobuf-cpp-lite",
|
|
|
|
"libpropertyinfoserializer",
|
|
|
|
"libpropertyinfoparser",
|
2018-06-01 12:26:42 +02:00
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libcutils",
|
|
|
|
"libbase",
|
|
|
|
"libc",
|
|
|
|
"liblog",
|
|
|
|
"libcrypto",
|
|
|
|
"libc++",
|
|
|
|
"libdl",
|
|
|
|
"libz",
|
2018-06-19 09:55:05 +02:00
|
|
|
"libselinux",
|
2018-01-19 23:25:48 +01:00
|
|
|
],
|
2017-05-10 02:11:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libinit",
|
|
|
|
defaults: ["init_defaults"],
|
|
|
|
srcs: [
|
|
|
|
"action.cpp",
|
2018-02-14 00:36:14 +01:00
|
|
|
"action_manager.cpp",
|
2018-02-14 00:25:29 +01:00
|
|
|
"action_parser.cpp",
|
2018-01-19 23:25:48 +01:00
|
|
|
"bootchart.cpp",
|
|
|
|
"builtins.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"capabilities.cpp",
|
|
|
|
"descriptors.cpp",
|
|
|
|
"devices.cpp",
|
2015-10-25 01:20:18 +02:00
|
|
|
"epoll.cpp",
|
2017-05-26 00:58:59 +02:00
|
|
|
"firmware_handler.cpp",
|
2018-07-21 00:18:04 +02:00
|
|
|
"first_stage_mount.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"import_parser.cpp",
|
2018-01-19 23:25:48 +01:00
|
|
|
"init.cpp",
|
|
|
|
"keychords.cpp",
|
2018-07-09 20:12:00 +02:00
|
|
|
"modalias_handler.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"parser.cpp",
|
2017-08-05 00:59:03 +02:00
|
|
|
"persistent_properties.cpp",
|
2017-09-16 00:44:04 +02:00
|
|
|
"persistent_properties.proto",
|
2017-08-10 02:13:21 +02:00
|
|
|
"property_service.cpp",
|
2017-12-11 10:40:07 +01:00
|
|
|
"property_type.cpp",
|
2018-01-19 23:25:48 +01:00
|
|
|
"reboot.cpp",
|
2017-08-10 21:22:44 +02:00
|
|
|
"security.cpp",
|
|
|
|
"selinux.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"service.cpp",
|
2018-01-19 23:25:48 +01:00
|
|
|
"sigchld_handler.cpp",
|
2017-09-13 00:58:47 +02:00
|
|
|
"subcontext.cpp",
|
|
|
|
"subcontext.proto",
|
2017-08-25 19:39:25 +02:00
|
|
|
"rlimit_parser.cpp",
|
2017-07-27 21:54:48 +02:00
|
|
|
"tokenizer.cpp",
|
2017-05-26 00:58:59 +02:00
|
|
|
"uevent_listener.cpp",
|
2018-01-19 23:25:48 +01:00
|
|
|
"ueventd.cpp",
|
2017-05-26 00:58:59 +02:00
|
|
|
"ueventd_parser.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"util.cpp",
|
|
|
|
],
|
|
|
|
whole_static_libs: ["libcap"],
|
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,
|
|
|
|
},
|
2017-05-10 02:11:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
This is not yet ready, see the below TODOs for what is missing
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
// TODO: Missing,
|
|
|
|
//LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
|
|
|
|
//LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
|
|
|
|
|
|
|
|
name: "init",
|
|
|
|
defaults: ["init_defaults"],
|
2017-07-06 20:43:45 +02:00
|
|
|
required: [
|
|
|
|
"e2fsdroid",
|
|
|
|
"mke2fs",
|
2017-11-29 04:26:34 +01:00
|
|
|
"sload_f2fs",
|
|
|
|
"make_f2fs",
|
2017-07-06 20:43:45 +02:00
|
|
|
],
|
2017-05-10 02:11:57 +02:00
|
|
|
static_executable: true,
|
2018-01-19 23:25:48 +01:00
|
|
|
srcs: ["main.cpp"],
|
2017-05-10 02:11:57 +02:00
|
|
|
symlinks: [
|
|
|
|
"sbin/ueventd",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Tests
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "init_tests",
|
|
|
|
defaults: ["init_defaults"],
|
|
|
|
srcs: [
|
|
|
|
"devices_test.cpp",
|
|
|
|
"init_test.cpp",
|
2018-05-15 20:19:43 +02:00
|
|
|
"keychords_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-03 21:54:07 +02:00
|
|
|
"result_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"],
|
2018-04-28 01:12:06 +02:00
|
|
|
test_suites: ["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
|
|
|
}
|
|
|
|
|
2018-02-14 01:50:08 +01:00
|
|
|
// Host Verifier
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "generated_stub_builtin_function_map",
|
|
|
|
out: ["generated_stub_builtin_function_map.h"],
|
|
|
|
srcs: ["builtins.cpp"],
|
2018-03-01 06:40:46 +01:00
|
|
|
cmd: "sed -n '/Builtin-function-map start/{:a;n;/Builtin-function-map end/q;p;ba}' $(in) | sed -e 's/do_[^}]*/do_stub/g' > $(out)",
|
2018-02-14 01:50:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "host_init_verifier",
|
|
|
|
host_supported: true,
|
|
|
|
cpp_std: "experimental",
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libselinux",
|
|
|
|
],
|
|
|
|
whole_static_libs: ["libcap"],
|
|
|
|
shared_libs: [
|
|
|
|
"libprotobuf-cpp-lite",
|
|
|
|
"libhidl-gen-utils",
|
|
|
|
"libprocessgroup",
|
|
|
|
"liblog",
|
|
|
|
"libcutils",
|
|
|
|
],
|
2018-06-21 00:49:48 +02:00
|
|
|
srcs: [
|
|
|
|
"action.cpp",
|
|
|
|
"action_manager.cpp",
|
|
|
|
"action_parser.cpp",
|
|
|
|
"capabilities.cpp",
|
|
|
|
"descriptors.cpp",
|
|
|
|
"epoll.cpp",
|
|
|
|
"keychords.cpp",
|
|
|
|
"import_parser.cpp",
|
|
|
|
"host_import_parser.cpp",
|
|
|
|
"host_init_verifier.cpp",
|
|
|
|
"host_init_stubs.cpp",
|
|
|
|
"parser.cpp",
|
|
|
|
"rlimit_parser.cpp",
|
|
|
|
"tokenizer.cpp",
|
|
|
|
"service.cpp",
|
|
|
|
"subcontext.cpp",
|
|
|
|
"subcontext.proto",
|
|
|
|
"util.cpp",
|
|
|
|
],
|
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",
|
|
|
|
"generated_android_ids"
|
|
|
|
],
|
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
|
|
|
}
|
|
|
|
|
2017-05-10 02:11:57 +02:00
|
|
|
subdirs = ["*"]
|