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",
|
|
|
|
"libcutils",
|
|
|
|
"libbase",
|
|
|
|
"libc",
|
|
|
|
"libseccomp_policy",
|
|
|
|
"libselinux",
|
|
|
|
"liblog",
|
|
|
|
"libcrypto_utils",
|
|
|
|
"libcrypto",
|
|
|
|
"libc++_static",
|
|
|
|
"libdl",
|
|
|
|
"libsparse",
|
|
|
|
"libz",
|
|
|
|
"libprocessgroup",
|
|
|
|
"libavb",
|
|
|
|
"libkeyutils",
|
|
|
|
"libprotobuf-cpp-lite",
|
|
|
|
"libpropertyinfoserializer",
|
|
|
|
"libpropertyinfoparser",
|
|
|
|
],
|
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",
|
2017-05-26 00:58:59 +02:00
|
|
|
"firmware_handler.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"import_parser.cpp",
|
2018-01-19 23:25:48 +01:00
|
|
|
"init.cpp",
|
|
|
|
"init_first_stage.cpp",
|
|
|
|
"keychords.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
"log.cpp",
|
|
|
|
"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",
|
2018-01-19 23:25:48 +01:00
|
|
|
"watchdogd.cpp",
|
2017-05-10 02:11:57 +02:00
|
|
|
],
|
|
|
|
whole_static_libs: ["libcap"],
|
2017-08-10 02:13:21 +02:00
|
|
|
include_dirs: [
|
|
|
|
"system/core/mkbootimg",
|
2017-05-10 02:11:57 +02:00
|
|
|
],
|
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",
|
|
|
|
"sbin/watchdogd",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Tests
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "init_tests",
|
|
|
|
defaults: ["init_defaults"],
|
2018-01-19 23:25:48 +01:00
|
|
|
static_executable: true,
|
2017-05-10 02:11:57 +02:00
|
|
|
srcs: [
|
|
|
|
"devices_test.cpp",
|
|
|
|
"init_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",
|
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"],
|
2017-05-10 02:11:57 +02:00
|
|
|
}
|
|
|
|
|
2017-09-13 00:58:47 +02:00
|
|
|
cc_benchmark {
|
|
|
|
name: "init_benchmarks",
|
2018-01-19 23:25:48 +01:00
|
|
|
static_executable: true,
|
2017-09-13 00:58:47 +02:00
|
|
|
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"],
|
|
|
|
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)"
|
|
|
|
}
|
|
|
|
|
|
|
|
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",
|
|
|
|
],
|
|
|
|
srcs: [
|
|
|
|
"action.cpp",
|
|
|
|
"action_manager.cpp",
|
|
|
|
"action_parser.cpp",
|
|
|
|
"capabilities.cpp",
|
|
|
|
"descriptors.cpp",
|
|
|
|
"import_parser.cpp",
|
|
|
|
"host_init_parser.cpp",
|
|
|
|
"host_init_stubs.cpp",
|
|
|
|
"parser.cpp",
|
|
|
|
"rlimit_parser.cpp",
|
|
|
|
"tokenizer.cpp",
|
|
|
|
"service.cpp",
|
|
|
|
"subcontext.cpp",
|
|
|
|
"subcontext.proto",
|
|
|
|
"util.cpp",
|
|
|
|
],
|
|
|
|
proto: {
|
|
|
|
type: "lite",
|
|
|
|
},
|
|
|
|
generated_headers: ["generated_stub_builtin_function_map"],
|
|
|
|
}
|
|
|
|
|
2017-05-10 02:11:57 +02:00
|
|
|
subdirs = ["*"]
|