blob: 4debbbece9a2611651085f62a133c8f8b8799df4 [file] [log] [blame]
Tom Cherryc9f53532019-11-04 10:30:36 -08001// Copyright 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Bob Badourd69ad692021-02-16 19:02:14 -080015package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
Tom Cherryc9f53532019-11-04 10:30:36 -080019prebuilt_etc {
Po-yao Chang6fe93672023-08-10 17:03:34 +080020 name: "init.boringssl.zygote64_32.rc",
21 src: "init.boringssl.zygote64_32.rc",
22 sub_dir: "init/hw",
23 symlinks: [
24 "init.boringssl.zygote32.rc",
25 "init.boringssl.no_zygote.rc",
26 ],
27}
28
29prebuilt_etc {
30 name: "init.boringssl.zygote64.rc",
31 src: "init.boringssl.zygote64.rc",
32 sub_dir: "init/hw",
33}
34
35prebuilt_etc {
Tom Cherryc9f53532019-11-04 10:30:36 -080036 name: "init.rc",
37 src: "init.rc",
38 sub_dir: "init/hw",
Yunkai Lim9292f742023-07-26 06:21:30 +000039 required: [
40 "fsverity_init",
41 "platform-bootclasspath",
Po-yao Chang6fe93672023-08-10 17:03:34 +080042 "init.boringssl.zygote64.rc",
43 "init.boringssl.zygote64_32.rc",
Yunkai Lim9292f742023-07-26 06:21:30 +000044 ],
Tom Cherryc9f53532019-11-04 10:30:36 -080045}
46
47prebuilt_etc {
48 name: "ueventd.rc",
49 src: "ueventd.rc",
Jihoon Kangf9b38f92024-12-06 23:53:38 +000050}
51
52prebuilt_etc {
53 name: "ueventd.rc.recovery",
54 src: "ueventd.rc",
55 recovery: true,
Tom Cherryc9f53532019-11-04 10:30:36 -080056}
Kiyoung Kim235ae0d2020-10-21 11:08:12 +090057
Justin Yun807ab252024-09-12 18:28:50 +090058filegroup {
59 name: "system_linker_config_json_file",
60 srcs: ["etc/linker.config.json"],
61}
62
Kiyoung Kim235ae0d2020-10-21 11:08:12 +090063// TODO(b/147210213) Generate list of libraries during build and fill in at build time
64linker_config {
65 name: "system_linker_config",
Justin Yun807ab252024-09-12 18:28:50 +090066 src: ":system_linker_config_json_file",
Kiyoung Kim344b46a2020-11-16 10:49:24 +090067 installable: false,
Kiyoung Kim235ae0d2020-10-21 11:08:12 +090068}
Jooyung Han489cea12021-04-15 05:18:21 +090069
70// TODO(b/185211376) Scope the native APIs that microdroid will provide to the app payload
71prebuilt_etc {
72 name: "public.libraries.android.txt",
73 src: "etc/public.libraries.android.txt",
74 filename: "public.libraries.txt",
Kiyoung Kimed92eab2024-05-29 17:19:04 +090075 no_full_install: true,
Inseob Kim2e200582021-06-11 12:58:53 +090076}
77
78// adb_debug.prop in debug ramdisk
79prebuilt_root {
80 name: "adb_debug.prop",
81 src: "adb_debug.prop",
82 debug_ramdisk: true,
83}
Jeongik Cha36520042024-01-24 16:33:43 +090084
85prebuilt_etc {
86 name: "init.zygote64.rc",
87 src: "init.zygote64.rc",
88 sub_dir: "init/hw",
89}
90
91prebuilt_etc {
92 name: "init.zygote32.rc",
93 src: "init.zygote32.rc",
94 sub_dir: "init/hw",
95}
96
97prebuilt_etc {
98 name: "init.zygote64_32.rc",
99 src: "init.zygote64_32.rc",
100 sub_dir: "init/hw",
101}
102
103prebuilt_etc {
104 name: "init.usb.rc",
105 src: "init.usb.rc",
106 sub_dir: "init/hw",
107}
108
109prebuilt_etc {
110 name: "init.usb.configfs.rc",
111 src: "init.usb.configfs.rc",
112 sub_dir: "init/hw",
113}
Inseob Kimf1ddc622024-04-17 18:30:19 +0900114
115prebuilt_etc {
116 name: "etc_hosts",
117 src: "etc/hosts",
118 filename: "hosts",
119}
Inseob Kim4113b652024-04-19 16:17:14 +0900120
121prebuilt_etc {
122 name: "init-debug.rc",
123 src: "init-debug.rc",
124 sub_dir: "init",
125}
Kiyoung Kimef637fd2024-05-03 16:09:43 +0900126
Nelson Lib335f4d2024-07-17 10:16:39 +0800127prebuilt_etc {
128 name: "asan.options",
129 src: "asan.options",
130}
131
132sh_binary {
133 name: "asan_extract",
134 src: "asan_extract.sh",
135 init_rc: ["asan_extract.rc"],
136 // We need bzip2 on device for extraction.
137 required: ["bzip2"],
138}
139
Kiyoung Kimef637fd2024-05-03 16:09:43 +0900140llndk_libraries_txt {
141 name: "llndk.libraries.txt",
142}
Kiyoung Kim5bec4e02024-05-07 14:54:20 +0900143
144sanitizer_libraries_txt {
145 name: "sanitizer.libraries.txt",
Nelson Lib335f4d2024-07-17 10:16:39 +0800146}
Inseob Kimb7fa3352024-07-30 16:32:20 +0900147
148EXPORT_GLOBAL_ASAN_OPTIONS = select(soong_config_variable("ANDROID", "ASAN_ENABLED"), {
149 true: "export ASAN_OPTIONS include=/system/asan.options",
150 default: "",
151})
152
153EXPORT_GLOBAL_HWASAN_OPTIONS = select(soong_config_variable("ANDROID", "HWASAN_ENABLED"), {
154 true: "export HWASAN_OPTIONS heap_history_size=1023,stack_history_size=512,export_memory_stats=0,max_malloc_fill_size=131072,malloc_fill_byte=0",
155 default: "",
156})
157
158EXPORT_GLOBAL_GCOV_OPTIONS = select(soong_config_variable("ANDROID", "GCOV_COVERAGE"), {
159 true: "export GCOV_PREFIX /data/misc/trace",
160 default: "",
161})
162
163EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS = select((soong_config_variable("ANDROID", "CLANG_COVERAGE"), soong_config_variable("ANDROID", "CLANG_COVERAGE_CONTINUOUS_MODE")), {
164 (true, true): "export LLVM_PROFILE_FILE /data/misc/trace/clang%c-%20m.profraw",
165 (true, default): "export LLVM_PROFILE_FILE /data/misc/trace/clang-%20m.profraw",
166 (default, default): "",
167})
168
169EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE = select(soong_config_variable("ANDROID", "SCUDO_ALLOCATION_RING_BUFFER_SIZE"), {
170 "": "",
171 any @ size: "export SCUDO_ALLOCATION_RING_BUFFER_SIZE " + size,
172 default: "",
173})
174
175genrule {
176 name: "init.environ.rc.gen",
177 srcs: ["init.environ.rc.in"],
178 out: ["init.environ.rc"],
179 cmd: "cp -f $(in) $(out) && " +
Inseob Kim3ce6cb92024-07-31 13:10:48 +0900180 "echo ' " + EXPORT_GLOBAL_ASAN_OPTIONS + "' >> $(out) && " +
181 "echo ' " + EXPORT_GLOBAL_GCOV_OPTIONS + "' >> $(out) && " +
182 "echo ' " + EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS + "' >> $(out) && " +
183 "echo ' " + EXPORT_GLOBAL_HWASAN_OPTIONS + "' >> $(out) && " +
184 "echo ' " + EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE + "' >> $(out)",
Inseob Kimb7fa3352024-07-30 16:32:20 +0900185}
186
187prebuilt_root {
188 name: "init.environ.rc-soong",
189 src: ":init.environ.rc.gen",
190 filename: "init.environ.rc",
191 install_in_root: true,
192 no_full_install: true,
193 required: select((soong_config_variable("ANDROID", "ASAN_ENABLED"), soong_config_variable("ANDROID", "SANITIZE_TARGET_SYSTEM_ENABLED")), {
194 (true, true): [
195 "asan.options",
196 "asan_extract",
197 ],
198 (true, default): ["asan.options"],
199 (default, default): [],
200 }),
201}
Nelson Li560cb932024-08-14 15:29:36 +0800202
203filegroup {
204 name: "ramdisk_node_list",
205 srcs: ["ramdisk_node_list"],
206 export_to_make_var: "RAMDISK_NODE_LIST",
207}