blob: 1e7b48b3112d52fe28e7754d9539a35649839434 [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",
50 recovery_available: true,
51}
Kiyoung Kim235ae0d2020-10-21 11:08:12 +090052
53// TODO(b/147210213) Generate list of libraries during build and fill in at build time
54linker_config {
55 name: "system_linker_config",
56 src: "etc/linker.config.json",
Kiyoung Kim344b46a2020-11-16 10:49:24 +090057 installable: false,
Kiyoung Kim235ae0d2020-10-21 11:08:12 +090058}
Jooyung Han489cea12021-04-15 05:18:21 +090059
60// TODO(b/185211376) Scope the native APIs that microdroid will provide to the app payload
61prebuilt_etc {
62 name: "public.libraries.android.txt",
63 src: "etc/public.libraries.android.txt",
64 filename: "public.libraries.txt",
Kiyoung Kimed92eab2024-05-29 17:19:04 +090065 no_full_install: true,
Inseob Kim2e200582021-06-11 12:58:53 +090066}
67
68// adb_debug.prop in debug ramdisk
69prebuilt_root {
70 name: "adb_debug.prop",
71 src: "adb_debug.prop",
72 debug_ramdisk: true,
73}
Jeongik Cha36520042024-01-24 16:33:43 +090074
75prebuilt_etc {
76 name: "init.zygote64.rc",
77 src: "init.zygote64.rc",
78 sub_dir: "init/hw",
79}
80
81prebuilt_etc {
82 name: "init.zygote32.rc",
83 src: "init.zygote32.rc",
84 sub_dir: "init/hw",
85}
86
87prebuilt_etc {
88 name: "init.zygote64_32.rc",
89 src: "init.zygote64_32.rc",
90 sub_dir: "init/hw",
91}
92
93prebuilt_etc {
94 name: "init.usb.rc",
95 src: "init.usb.rc",
96 sub_dir: "init/hw",
97}
98
99prebuilt_etc {
100 name: "init.usb.configfs.rc",
101 src: "init.usb.configfs.rc",
102 sub_dir: "init/hw",
103}
Inseob Kimf1ddc622024-04-17 18:30:19 +0900104
105prebuilt_etc {
106 name: "etc_hosts",
107 src: "etc/hosts",
108 filename: "hosts",
109}
Inseob Kim4113b652024-04-19 16:17:14 +0900110
111prebuilt_etc {
112 name: "init-debug.rc",
113 src: "init-debug.rc",
114 sub_dir: "init",
115}
Kiyoung Kimef637fd2024-05-03 16:09:43 +0900116
Nelson Lib335f4d2024-07-17 10:16:39 +0800117prebuilt_etc {
118 name: "asan.options",
119 src: "asan.options",
120}
121
122sh_binary {
123 name: "asan_extract",
124 src: "asan_extract.sh",
125 init_rc: ["asan_extract.rc"],
126 // We need bzip2 on device for extraction.
127 required: ["bzip2"],
128}
129
Kiyoung Kimef637fd2024-05-03 16:09:43 +0900130llndk_libraries_txt {
131 name: "llndk.libraries.txt",
132}
Kiyoung Kim5bec4e02024-05-07 14:54:20 +0900133
134sanitizer_libraries_txt {
135 name: "sanitizer.libraries.txt",
Nelson Lib335f4d2024-07-17 10:16:39 +0800136}
Inseob Kimb7fa3352024-07-30 16:32:20 +0900137
138EXPORT_GLOBAL_ASAN_OPTIONS = select(soong_config_variable("ANDROID", "ASAN_ENABLED"), {
139 true: "export ASAN_OPTIONS include=/system/asan.options",
140 default: "",
141})
142
143EXPORT_GLOBAL_HWASAN_OPTIONS = select(soong_config_variable("ANDROID", "HWASAN_ENABLED"), {
144 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",
145 default: "",
146})
147
148EXPORT_GLOBAL_GCOV_OPTIONS = select(soong_config_variable("ANDROID", "GCOV_COVERAGE"), {
149 true: "export GCOV_PREFIX /data/misc/trace",
150 default: "",
151})
152
153EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS = select((soong_config_variable("ANDROID", "CLANG_COVERAGE"), soong_config_variable("ANDROID", "CLANG_COVERAGE_CONTINUOUS_MODE")), {
154 (true, true): "export LLVM_PROFILE_FILE /data/misc/trace/clang%c-%20m.profraw",
155 (true, default): "export LLVM_PROFILE_FILE /data/misc/trace/clang-%20m.profraw",
156 (default, default): "",
157})
158
159EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE = select(soong_config_variable("ANDROID", "SCUDO_ALLOCATION_RING_BUFFER_SIZE"), {
160 "": "",
161 any @ size: "export SCUDO_ALLOCATION_RING_BUFFER_SIZE " + size,
162 default: "",
163})
164
165genrule {
166 name: "init.environ.rc.gen",
167 srcs: ["init.environ.rc.in"],
168 out: ["init.environ.rc"],
169 cmd: "cp -f $(in) $(out) && " +
Inseob Kim3ce6cb92024-07-31 13:10:48 +0900170 "echo ' " + EXPORT_GLOBAL_ASAN_OPTIONS + "' >> $(out) && " +
171 "echo ' " + EXPORT_GLOBAL_GCOV_OPTIONS + "' >> $(out) && " +
172 "echo ' " + EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS + "' >> $(out) && " +
173 "echo ' " + EXPORT_GLOBAL_HWASAN_OPTIONS + "' >> $(out) && " +
174 "echo ' " + EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE + "' >> $(out)",
Inseob Kimb7fa3352024-07-30 16:32:20 +0900175}
176
177prebuilt_root {
178 name: "init.environ.rc-soong",
179 src: ":init.environ.rc.gen",
180 filename: "init.environ.rc",
181 install_in_root: true,
182 no_full_install: true,
183 required: select((soong_config_variable("ANDROID", "ASAN_ENABLED"), soong_config_variable("ANDROID", "SANITIZE_TARGET_SYSTEM_ENABLED")), {
184 (true, true): [
185 "asan.options",
186 "asan_extract",
187 ],
188 (true, default): ["asan.options"],
189 (default, default): [],
190 }),
191}