blob: d9cadc2893d96076f94e503b4e8f289702762139 [file] [log] [blame]
Tom Cherry14fc0132017-05-09 17:11:57 -07001//
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
17cc_defaults {
18 name: "init_defaults",
19 cpp_std: "experimental",
20 sanitize: {
Tom Cherry2ffd65e2017-07-26 14:17:09 -070021 misc_undefined: ["signed-integer-overflow"],
Tom Cherry14fc0132017-05-09 17:11:57 -070022 },
Tom Cherry14fc0132017-05-09 17:11:57 -070023 cppflags: [
24 "-DLOG_UEVENTS=0",
25 "-Wall",
26 "-Wextra",
27 "-Wno-unused-parameter",
28 "-Werror",
29 "-DALLOW_LOCAL_PROP_OVERRIDE=0",
30 "-DALLOW_PERMISSIVE_SELINUX=0",
31 "-DREBOOT_BOOTLOADER_ON_PANIC=0",
32 "-DWORLD_WRITABLE_KMSG=0",
33 "-DDUMP_ON_UMOUNT_FAILURE=0",
34 "-DSHUTDOWN_ZERO_TIMEOUT=0",
35 ],
36 product_variables: {
37 debuggable: {
38 cppflags: [
39 "-UALLOW_LOCAL_PROP_OVERRIDE",
40 "-DALLOW_LOCAL_PROP_OVERRIDE=1",
41 "-UALLOW_PERMISSIVE_SELINUX",
42 "-DALLOW_PERMISSIVE_SELINUX=1",
43 "-UREBOOT_BOOTLOADER_ON_PANIC",
44 "-DREBOOT_BOOTLOADER_ON_PANIC=1",
45 "-UWORLD_WRITABLE_KMSG",
46 "-DWORLD_WRITABLE_KMSG=1",
47 "-UDUMP_ON_UMOUNT_FAILURE",
48 "-DDUMP_ON_UMOUNT_FAILURE=1",
49 ],
50 },
51 eng: {
52 cppflags: [
53 "-USHUTDOWN_ZERO_TIMEOUT",
54 "-DSHUTDOWN_ZERO_TIMEOUT=1",
55 ],
56 },
57 },
58}
59
60cc_library_static {
61 name: "libinit",
62 defaults: ["init_defaults"],
63 srcs: [
64 "action.cpp",
65 "capabilities.cpp",
66 "descriptors.cpp",
67 "devices.cpp",
Tom Cherryed506f72017-05-25 15:58:59 -070068 "firmware_handler.cpp",
Tom Cherry14fc0132017-05-09 17:11:57 -070069 "import_parser.cpp",
Tom Cherry14fc0132017-05-09 17:11:57 -070070 "log.cpp",
71 "parser.cpp",
72 "service.cpp",
Tom Cherry67dee622017-07-27 12:54:48 -070073 "tokenizer.cpp",
Tom Cherryed506f72017-05-25 15:58:59 -070074 "uevent_listener.cpp",
75 "ueventd_parser.cpp",
Tom Cherry14fc0132017-05-09 17:11:57 -070076 "util.cpp",
77 ],
78 whole_static_libs: ["libcap"],
79 static_libs: [
80 "libbase",
81 "libselinux",
82 "liblog",
83 "libprocessgroup",
84 ],
85}
86
87/*
88This is not yet ready, see the below TODOs for what is missing
89
90cc_binary {
91 // TODO: Missing,
92 //LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
93 //LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
94
95 name: "init",
96 defaults: ["init_defaults"],
Jin Qian00456972017-07-06 11:43:45 -070097 required: [
98 "e2fsdroid",
99 "mke2fs",
100 ],
Tom Cherry14fc0132017-05-09 17:11:57 -0700101 static_executable: true,
102 srcs: [
103 "bootchart.cpp",
104 "builtins.cpp",
105 "init.cpp",
106 "init_first_stage.cpp",
107 "keychords.cpp",
108 "property_service.cpp",
109 "reboot.cpp",
110 "signal_handler.cpp",
111 "ueventd.cpp",
112 "watchdogd.cpp",
113 ],
114 include_dirs: [
115 "system/core/mkbootimg"
116 ],
117 static_libs: [
118 "libinit",
119 "libbootloader_message",
120 "libfs_mgr",
121 "libfec",
122 "libfec_rs",
123 "libsquashfs_utils",
124 "liblogwrap",
125 "libext4_utils",
126 "libcutils",
127 "libbase",
128 "libc",
129 "libselinux",
130 "liblog",
131 "libcrypto_utils",
132 "libcrypto",
133 "libc++_static",
134 "libdl",
135 "libsparse",
136 "libz",
137 "libprocessgroup",
138 "libavb",
139 "libkeyutils",
140 ],
141 symlinks: [
142 "sbin/ueventd",
143 "sbin/watchdogd",
144 ],
145}
146*/
147
148// Tests
149// ------------------------------------------------------------------------------
150
151cc_test {
152 name: "init_tests",
153 defaults: ["init_defaults"],
154 srcs: [
155 "devices_test.cpp",
Tom Cherry14fc0132017-05-09 17:11:57 -0700156 "init_test.cpp",
157 "property_service_test.cpp",
158 "service_test.cpp",
Tom Cherryc2e181c2017-07-14 16:29:23 -0700159 "ueventd_test.cpp",
Tom Cherry14fc0132017-05-09 17:11:57 -0700160 "util_test.cpp",
161 ],
162 shared_libs: [
163 "libbase",
164 "libcutils",
Tom Cherry14fc0132017-05-09 17:11:57 -0700165 ],
Tom Cherry45a9d672017-08-09 17:09:04 -0700166 static_libs: [
167 "libinit",
168 "libselinux",
169 "libcrypto",
170 ],
Tom Cherry14fc0132017-05-09 17:11:57 -0700171}
172
173subdirs = ["*"]