Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 1 | // Copyright (C) 2018 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 | |
| 15 | cc_defaults { |
| 16 | name: "recovery_defaults", |
| 17 | |
| 18 | cflags: [ |
Tao Bao | 818f938 | 2018-08-06 15:52:24 -0700 | [diff] [blame] | 19 | "-D_FILE_OFFSET_BITS=64", |
| 20 | |
| 21 | // Must be the same as RECOVERY_API_VERSION. |
| 22 | "-DRECOVERY_API_VERSION=3", |
| 23 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 24 | "-Wall", |
| 25 | "-Werror", |
| 26 | ], |
| 27 | } |
| 28 | |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 29 | cc_library_static { |
| 30 | name: "librecovery_fastboot", |
| 31 | recovery_available: true, |
| 32 | defaults: [ |
| 33 | "recovery_defaults", |
| 34 | ], |
| 35 | |
| 36 | srcs: [ |
| 37 | "fastboot/fastboot.cpp", |
| 38 | ], |
| 39 | |
| 40 | shared_libs: [ |
| 41 | "libbase", |
| 42 | "libbootloader_message", |
| 43 | "libcutils", |
| 44 | "liblog", |
Tianjie Xu | 8f39730 | 2018-08-20 13:40:47 -0700 | [diff] [blame] | 45 | "librecovery_ui", |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 46 | ], |
| 47 | |
| 48 | static_libs: [ |
| 49 | "librecovery_ui_default", |
| 50 | ], |
| 51 | } |
| 52 | |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 53 | cc_defaults { |
| 54 | name: "librecovery_defaults", |
| 55 | |
| 56 | defaults: [ |
| 57 | "recovery_defaults", |
| 58 | ], |
| 59 | |
| 60 | shared_libs: [ |
David Anderson | 89d2d05 | 2019-10-15 13:22:20 -0700 | [diff] [blame] | 61 | "android.hardware.boot@1.0", |
| 62 | "android.hardware.boot@1.1", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 63 | "libbase", |
| 64 | "libbootloader_message", |
| 65 | "libcrypto", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 66 | "libcutils", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 67 | "libfs_mgr", |
David Anderson | 89d2d05 | 2019-10-15 13:22:20 -0700 | [diff] [blame] | 68 | "liblp", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 69 | "liblog", |
David Anderson | 89d2d05 | 2019-10-15 13:22:20 -0700 | [diff] [blame] | 70 | "libprotobuf-cpp-lite", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 71 | "libziparchive", |
| 72 | ], |
| 73 | |
| 74 | static_libs: [ |
Tianjie Xu | cd8faf7 | 2019-08-06 12:32:05 -0700 | [diff] [blame] | 75 | "libc++fs", |
Tao Bao | 0deed33 | 2019-04-08 11:26:11 -0700 | [diff] [blame] | 76 | "libinstall", |
Hridya Valsaraju | 20c81b3 | 2018-07-27 22:09:12 -0700 | [diff] [blame] | 77 | "librecovery_fastboot", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 78 | "libminui", |
Tao Bao | e3f09a7 | 2019-10-01 11:55:36 -0700 | [diff] [blame] | 79 | "librecovery_utils", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 80 | "libotautil", |
David Anderson | 89d2d05 | 2019-10-15 13:22:20 -0700 | [diff] [blame] | 81 | "libsnapshot_nobinder", |
Yifan Hong | acf7d1b | 2020-04-16 11:04:10 -0700 | [diff] [blame] | 82 | "update_metadata-protos", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 83 | ], |
| 84 | } |
| 85 | |
| 86 | cc_library_static { |
| 87 | name: "librecovery", |
| 88 | recovery_available: true, |
| 89 | |
| 90 | defaults: [ |
| 91 | "librecovery_defaults", |
| 92 | ], |
| 93 | |
| 94 | srcs: [ |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 95 | "recovery.cpp", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 96 | ], |
| 97 | |
Tianjie Xu | 8f39730 | 2018-08-20 13:40:47 -0700 | [diff] [blame] | 98 | shared_libs: [ |
Tianjie Xu | cd8faf7 | 2019-08-06 12:32:05 -0700 | [diff] [blame] | 99 | "libfusesideload", |
Tianjie Xu | 8f39730 | 2018-08-20 13:40:47 -0700 | [diff] [blame] | 100 | "librecovery_ui", |
| 101 | ], |
xunchang | 37304f3 | 2019-03-12 12:40:14 -0700 | [diff] [blame] | 102 | } |
| 103 | |
Tom Cherry | bcd3f35 | 2019-11-04 15:17:17 -0800 | [diff] [blame] | 104 | prebuilt_etc { |
| 105 | name: "init_recovery.rc", |
| 106 | filename: "init.rc", |
| 107 | src: "etc/init.rc", |
| 108 | sub_dir: "init/hw", |
| 109 | recovery: true, |
| 110 | } |
| 111 | |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 112 | cc_binary { |
| 113 | name: "recovery", |
| 114 | recovery: true, |
| 115 | |
| 116 | defaults: [ |
xunchang | 2478885 | 2019-03-22 16:08:52 -0700 | [diff] [blame] | 117 | "libinstall_defaults", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 118 | "librecovery_defaults", |
Tao Bao | 832c9cd | 2019-09-27 23:32:00 -0700 | [diff] [blame] | 119 | "librecovery_utils_defaults", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 120 | ], |
| 121 | |
| 122 | srcs: [ |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 123 | "recovery_main.cpp", |
| 124 | ], |
| 125 | |
| 126 | shared_libs: [ |
| 127 | "librecovery_ui", |
| 128 | ], |
| 129 | |
| 130 | static_libs: [ |
| 131 | "librecovery", |
| 132 | "librecovery_ui_default", |
| 133 | ], |
| 134 | |
| 135 | required: [ |
| 136 | "e2fsdroid.recovery", |
Tom Cherry | bcd3f35 | 2019-11-04 15:17:17 -0800 | [diff] [blame] | 137 | "init_recovery.rc", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 138 | "librecovery_ui_ext", |
xunchang | 34690ce | 2019-04-05 16:16:07 -0700 | [diff] [blame] | 139 | "minadbd", |
Tao Bao | 7c074d9 | 2018-08-21 12:31:51 -0700 | [diff] [blame] | 140 | "mke2fs.conf.recovery", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 141 | "mke2fs.recovery", |
| 142 | "recovery_deps", |
Tom Cherry | bcd3f35 | 2019-11-04 15:17:17 -0800 | [diff] [blame] | 143 | "ueventd.rc.recovery", |
Tao Bao | 5fc72a1 | 2018-08-07 14:38:51 -0700 | [diff] [blame] | 144 | ], |
| 145 | } |
| 146 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 147 | // The dynamic executable that runs after /data mounts. |
| 148 | cc_binary { |
| 149 | name: "recovery-persist", |
| 150 | |
| 151 | defaults: [ |
| 152 | "recovery_defaults", |
| 153 | ], |
| 154 | |
| 155 | srcs: [ |
| 156 | "recovery-persist.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 157 | ], |
| 158 | |
| 159 | shared_libs: [ |
| 160 | "libbase", |
| 161 | "liblog", |
| 162 | ], |
| 163 | |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 164 | static_libs: [ |
Tao Bao | e3f09a7 | 2019-10-01 11:55:36 -0700 | [diff] [blame] | 165 | "librecovery_utils", |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 166 | ], |
| 167 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 168 | init_rc: [ |
| 169 | "recovery-persist.rc", |
| 170 | ], |
| 171 | } |
| 172 | |
| 173 | // The dynamic executable that runs at init. |
| 174 | cc_binary { |
| 175 | name: "recovery-refresh", |
| 176 | |
| 177 | defaults: [ |
| 178 | "recovery_defaults", |
| 179 | ], |
| 180 | |
| 181 | srcs: [ |
| 182 | "recovery-refresh.cpp", |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 183 | ], |
| 184 | |
| 185 | shared_libs: [ |
| 186 | "libbase", |
| 187 | "liblog", |
| 188 | ], |
| 189 | |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 190 | static_libs: [ |
Tao Bao | e3f09a7 | 2019-10-01 11:55:36 -0700 | [diff] [blame] | 191 | "librecovery_utils", |
Jerry Zhang | 152933a | 2018-05-02 16:56:00 -0700 | [diff] [blame] | 192 | ], |
| 193 | |
Tao Bao | d2f2ad6 | 2018-03-23 23:24:25 -0700 | [diff] [blame] | 194 | init_rc: [ |
| 195 | "recovery-refresh.rc", |
| 196 | ], |
| 197 | } |
Tao Bao | ef5e38f | 2018-07-24 15:34:39 -0700 | [diff] [blame] | 198 | |
| 199 | filegroup { |
| 200 | name: "res-testdata", |
| 201 | |
| 202 | srcs: [ |
| 203 | "res-*/images/*_text.png", |
| 204 | ], |
| 205 | } |