Tom Cherry | c9f5353 | 2019-11-04 10:30:36 -0800 | [diff] [blame] | 1 | // 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 Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
Tom Cherry | c9f5353 | 2019-11-04 10:30:36 -0800 | [diff] [blame] | 19 | prebuilt_etc { |
Po-yao Chang | 6fe9367 | 2023-08-10 17:03:34 +0800 | [diff] [blame] | 20 | 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 | |
| 29 | prebuilt_etc { |
| 30 | name: "init.boringssl.zygote64.rc", |
| 31 | src: "init.boringssl.zygote64.rc", |
| 32 | sub_dir: "init/hw", |
| 33 | } |
| 34 | |
| 35 | prebuilt_etc { |
Tom Cherry | c9f5353 | 2019-11-04 10:30:36 -0800 | [diff] [blame] | 36 | name: "init.rc", |
| 37 | src: "init.rc", |
| 38 | sub_dir: "init/hw", |
Yunkai Lim | 9292f74 | 2023-07-26 06:21:30 +0000 | [diff] [blame] | 39 | required: [ |
| 40 | "fsverity_init", |
| 41 | "platform-bootclasspath", |
Po-yao Chang | 6fe9367 | 2023-08-10 17:03:34 +0800 | [diff] [blame] | 42 | "init.boringssl.zygote64.rc", |
| 43 | "init.boringssl.zygote64_32.rc", |
Yunkai Lim | 9292f74 | 2023-07-26 06:21:30 +0000 | [diff] [blame] | 44 | ], |
Tom Cherry | c9f5353 | 2019-11-04 10:30:36 -0800 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | prebuilt_etc { |
| 48 | name: "ueventd.rc", |
| 49 | src: "ueventd.rc", |
| 50 | recovery_available: true, |
| 51 | } |
Kiyoung Kim | 235ae0d | 2020-10-21 11:08:12 +0900 | [diff] [blame] | 52 | |
Justin Yun | 807ab25 | 2024-09-12 18:28:50 +0900 | [diff] [blame] | 53 | filegroup { |
| 54 | name: "system_linker_config_json_file", |
| 55 | srcs: ["etc/linker.config.json"], |
| 56 | } |
| 57 | |
Kiyoung Kim | 235ae0d | 2020-10-21 11:08:12 +0900 | [diff] [blame] | 58 | // TODO(b/147210213) Generate list of libraries during build and fill in at build time |
| 59 | linker_config { |
| 60 | name: "system_linker_config", |
Justin Yun | 807ab25 | 2024-09-12 18:28:50 +0900 | [diff] [blame] | 61 | src: ":system_linker_config_json_file", |
Kiyoung Kim | 344b46a | 2020-11-16 10:49:24 +0900 | [diff] [blame] | 62 | installable: false, |
Kiyoung Kim | 235ae0d | 2020-10-21 11:08:12 +0900 | [diff] [blame] | 63 | } |
Jooyung Han | 489cea1 | 2021-04-15 05:18:21 +0900 | [diff] [blame] | 64 | |
| 65 | // TODO(b/185211376) Scope the native APIs that microdroid will provide to the app payload |
| 66 | prebuilt_etc { |
| 67 | name: "public.libraries.android.txt", |
| 68 | src: "etc/public.libraries.android.txt", |
| 69 | filename: "public.libraries.txt", |
Kiyoung Kim | ed92eab | 2024-05-29 17:19:04 +0900 | [diff] [blame] | 70 | no_full_install: true, |
Inseob Kim | 2e20058 | 2021-06-11 12:58:53 +0900 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | // adb_debug.prop in debug ramdisk |
| 74 | prebuilt_root { |
| 75 | name: "adb_debug.prop", |
| 76 | src: "adb_debug.prop", |
| 77 | debug_ramdisk: true, |
| 78 | } |
Jeongik Cha | 3652004 | 2024-01-24 16:33:43 +0900 | [diff] [blame] | 79 | |
| 80 | prebuilt_etc { |
| 81 | name: "init.zygote64.rc", |
| 82 | src: "init.zygote64.rc", |
| 83 | sub_dir: "init/hw", |
| 84 | } |
| 85 | |
| 86 | prebuilt_etc { |
| 87 | name: "init.zygote32.rc", |
| 88 | src: "init.zygote32.rc", |
| 89 | sub_dir: "init/hw", |
| 90 | } |
| 91 | |
| 92 | prebuilt_etc { |
| 93 | name: "init.zygote64_32.rc", |
| 94 | src: "init.zygote64_32.rc", |
| 95 | sub_dir: "init/hw", |
| 96 | } |
| 97 | |
| 98 | prebuilt_etc { |
| 99 | name: "init.usb.rc", |
| 100 | src: "init.usb.rc", |
| 101 | sub_dir: "init/hw", |
| 102 | } |
| 103 | |
| 104 | prebuilt_etc { |
| 105 | name: "init.usb.configfs.rc", |
| 106 | src: "init.usb.configfs.rc", |
| 107 | sub_dir: "init/hw", |
| 108 | } |
Inseob Kim | f1ddc62 | 2024-04-17 18:30:19 +0900 | [diff] [blame] | 109 | |
| 110 | prebuilt_etc { |
| 111 | name: "etc_hosts", |
| 112 | src: "etc/hosts", |
| 113 | filename: "hosts", |
| 114 | } |
Inseob Kim | 4113b65 | 2024-04-19 16:17:14 +0900 | [diff] [blame] | 115 | |
| 116 | prebuilt_etc { |
| 117 | name: "init-debug.rc", |
| 118 | src: "init-debug.rc", |
| 119 | sub_dir: "init", |
| 120 | } |
Kiyoung Kim | ef637fd | 2024-05-03 16:09:43 +0900 | [diff] [blame] | 121 | |
Nelson Li | b335f4d | 2024-07-17 10:16:39 +0800 | [diff] [blame] | 122 | prebuilt_etc { |
| 123 | name: "asan.options", |
| 124 | src: "asan.options", |
| 125 | } |
| 126 | |
| 127 | sh_binary { |
| 128 | name: "asan_extract", |
| 129 | src: "asan_extract.sh", |
| 130 | init_rc: ["asan_extract.rc"], |
| 131 | // We need bzip2 on device for extraction. |
| 132 | required: ["bzip2"], |
| 133 | } |
| 134 | |
Kiyoung Kim | ef637fd | 2024-05-03 16:09:43 +0900 | [diff] [blame] | 135 | llndk_libraries_txt { |
| 136 | name: "llndk.libraries.txt", |
| 137 | } |
Kiyoung Kim | 5bec4e0 | 2024-05-07 14:54:20 +0900 | [diff] [blame] | 138 | |
| 139 | sanitizer_libraries_txt { |
| 140 | name: "sanitizer.libraries.txt", |
Nelson Li | b335f4d | 2024-07-17 10:16:39 +0800 | [diff] [blame] | 141 | } |
Inseob Kim | b7fa335 | 2024-07-30 16:32:20 +0900 | [diff] [blame] | 142 | |
| 143 | EXPORT_GLOBAL_ASAN_OPTIONS = select(soong_config_variable("ANDROID", "ASAN_ENABLED"), { |
| 144 | true: "export ASAN_OPTIONS include=/system/asan.options", |
| 145 | default: "", |
| 146 | }) |
| 147 | |
| 148 | EXPORT_GLOBAL_HWASAN_OPTIONS = select(soong_config_variable("ANDROID", "HWASAN_ENABLED"), { |
| 149 | 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", |
| 150 | default: "", |
| 151 | }) |
| 152 | |
| 153 | EXPORT_GLOBAL_GCOV_OPTIONS = select(soong_config_variable("ANDROID", "GCOV_COVERAGE"), { |
| 154 | true: "export GCOV_PREFIX /data/misc/trace", |
| 155 | default: "", |
| 156 | }) |
| 157 | |
| 158 | EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS = select((soong_config_variable("ANDROID", "CLANG_COVERAGE"), soong_config_variable("ANDROID", "CLANG_COVERAGE_CONTINUOUS_MODE")), { |
| 159 | (true, true): "export LLVM_PROFILE_FILE /data/misc/trace/clang%c-%20m.profraw", |
| 160 | (true, default): "export LLVM_PROFILE_FILE /data/misc/trace/clang-%20m.profraw", |
| 161 | (default, default): "", |
| 162 | }) |
| 163 | |
| 164 | EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE = select(soong_config_variable("ANDROID", "SCUDO_ALLOCATION_RING_BUFFER_SIZE"), { |
| 165 | "": "", |
| 166 | any @ size: "export SCUDO_ALLOCATION_RING_BUFFER_SIZE " + size, |
| 167 | default: "", |
| 168 | }) |
| 169 | |
| 170 | genrule { |
| 171 | name: "init.environ.rc.gen", |
| 172 | srcs: ["init.environ.rc.in"], |
| 173 | out: ["init.environ.rc"], |
| 174 | cmd: "cp -f $(in) $(out) && " + |
Inseob Kim | 3ce6cb9 | 2024-07-31 13:10:48 +0900 | [diff] [blame] | 175 | "echo ' " + EXPORT_GLOBAL_ASAN_OPTIONS + "' >> $(out) && " + |
| 176 | "echo ' " + EXPORT_GLOBAL_GCOV_OPTIONS + "' >> $(out) && " + |
| 177 | "echo ' " + EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS + "' >> $(out) && " + |
| 178 | "echo ' " + EXPORT_GLOBAL_HWASAN_OPTIONS + "' >> $(out) && " + |
| 179 | "echo ' " + EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE + "' >> $(out)", |
Inseob Kim | b7fa335 | 2024-07-30 16:32:20 +0900 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | prebuilt_root { |
| 183 | name: "init.environ.rc-soong", |
| 184 | src: ":init.environ.rc.gen", |
| 185 | filename: "init.environ.rc", |
| 186 | install_in_root: true, |
| 187 | no_full_install: true, |
| 188 | required: select((soong_config_variable("ANDROID", "ASAN_ENABLED"), soong_config_variable("ANDROID", "SANITIZE_TARGET_SYSTEM_ENABLED")), { |
| 189 | (true, true): [ |
| 190 | "asan.options", |
| 191 | "asan_extract", |
| 192 | ], |
| 193 | (true, default): ["asan.options"], |
| 194 | (default, default): [], |
| 195 | }), |
| 196 | } |
Nelson Li | 560cb93 | 2024-08-14 15:29:36 +0800 | [diff] [blame] | 197 | |
| 198 | filegroup { |
| 199 | name: "ramdisk_node_list", |
| 200 | srcs: ["ramdisk_node_list"], |
| 201 | export_to_make_var: "RAMDISK_NODE_LIST", |
| 202 | } |