Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -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 | |
Bob Badour | 601ebb4 | 2021-02-03 23:07:40 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["system_sepolicy_license"], |
| 17 | } |
| 18 | |
| 19 | // Added automatically by a large-scale-change that took the approach of |
| 20 | // 'apply every license found to every target'. While this makes sure we respect |
| 21 | // every license restriction, it may not be entirely correct. |
| 22 | // |
| 23 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 24 | // |
| 25 | // Please consider splitting the single license below into multiple licenses, |
| 26 | // taking care not to lose any license_kind information, and overriding the |
| 27 | // default license using the 'licenses: [...]' property on targets as needed. |
| 28 | // |
| 29 | // For unused files, consider creating a 'filegroup' with "//visibility:private" |
| 30 | // to attach the license to, and including a comment whether the files may be |
| 31 | // used in the current project. |
| 32 | // http://go/android-license-faq |
| 33 | license { |
| 34 | name: "system_sepolicy_license", |
| 35 | visibility: [":__subpackages__"], |
| 36 | license_kinds: [ |
| 37 | "SPDX-license-identifier-Apache-2.0", |
| 38 | "legacy_unencumbered", |
| 39 | ], |
| 40 | license_text: [ |
| 41 | "NOTICE", |
| 42 | ], |
| 43 | } |
| 44 | |
Jeff Vander Stoep | ecd288f | 2019-02-15 12:18:15 -0800 | [diff] [blame] | 45 | cc_defaults { name: "selinux_policy_version", cflags: ["-DSEPOLICY_VERSION=30"], } |
| 46 | |
Tri Vo | 84e247a | 2018-03-25 20:03:58 -0700 | [diff] [blame] | 47 | se_filegroup { |
| 48 | name: "26.0.board.compat.map", |
| 49 | srcs: [ |
| 50 | "compat/26.0/26.0.cil", |
| 51 | ], |
| 52 | } |
| 53 | |
| 54 | se_filegroup { |
| 55 | name: "27.0.board.compat.map", |
| 56 | srcs: [ |
| 57 | "compat/27.0/27.0.cil", |
| 58 | ], |
| 59 | } |
| 60 | |
Jae Shin | 1fa9634 | 2018-07-11 18:30:44 +0900 | [diff] [blame] | 61 | se_filegroup { |
| 62 | name: "28.0.board.compat.map", |
| 63 | srcs: [ |
| 64 | "compat/28.0/28.0.cil", |
| 65 | ], |
| 66 | } |
| 67 | |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 68 | se_filegroup { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 69 | name: "29.0.board.compat.map", |
| 70 | srcs: [ |
| 71 | "compat/29.0/29.0.cil", |
| 72 | ], |
| 73 | } |
| 74 | |
| 75 | se_filegroup { |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 76 | name: "30.0.board.compat.map", |
| 77 | srcs: [ |
| 78 | "compat/30.0/30.0.cil", |
| 79 | ], |
| 80 | } |
| 81 | |
| 82 | se_filegroup { |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 83 | name: "26.0.board.ignore.map", |
| 84 | srcs: [ |
| 85 | "compat/26.0/26.0.ignore.cil", |
| 86 | ], |
| 87 | } |
| 88 | |
| 89 | se_filegroup { |
| 90 | name: "27.0.board.ignore.map", |
| 91 | srcs: [ |
| 92 | "compat/27.0/27.0.ignore.cil", |
| 93 | ], |
| 94 | } |
| 95 | |
| 96 | se_filegroup { |
| 97 | name: "28.0.board.ignore.map", |
| 98 | srcs: [ |
| 99 | "compat/28.0/28.0.ignore.cil", |
| 100 | ], |
| 101 | } |
| 102 | |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 103 | se_filegroup { |
| 104 | name: "29.0.board.ignore.map", |
| 105 | srcs: [ |
| 106 | "compat/29.0/29.0.ignore.cil", |
| 107 | ], |
| 108 | } |
| 109 | |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 110 | se_filegroup { |
| 111 | name: "30.0.board.ignore.map", |
| 112 | srcs: [ |
| 113 | "compat/30.0/30.0.ignore.cil", |
| 114 | ], |
| 115 | } |
| 116 | |
Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -0700 | [diff] [blame] | 117 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 118 | name: "plat_26.0.cil", |
| 119 | stem: "26.0.cil", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 120 | bottom_half: [":26.0.board.compat.map"], |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 121 | top_half: "plat_27.0.cil", |
Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -0700 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 125 | name: "plat_27.0.cil", |
| 126 | stem: "27.0.cil", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 127 | bottom_half: [":27.0.board.compat.map"], |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 128 | top_half: "plat_28.0.cil", |
Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -0700 | [diff] [blame] | 129 | } |
Jae Shin | 1fa9634 | 2018-07-11 18:30:44 +0900 | [diff] [blame] | 130 | |
| 131 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 132 | name: "plat_28.0.cil", |
| 133 | stem: "28.0.cil", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 134 | bottom_half: [":28.0.board.compat.map"], |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 135 | top_half: "plat_29.0.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 139 | name: "plat_29.0.cil", |
| 140 | stem: "29.0.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 141 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 142 | top_half: "plat_30.0.cil", |
| 143 | } |
| 144 | |
| 145 | se_cil_compat_map { |
| 146 | name: "plat_30.0.cil", |
| 147 | stem: "30.0.cil", |
| 148 | bottom_half: [":30.0.board.compat.map"], |
| 149 | // top_half: "plat_31.0.cil", |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | se_cil_compat_map { |
| 153 | name: "system_ext_26.0.cil", |
| 154 | stem: "26.0.cil", |
| 155 | bottom_half: [":26.0.board.compat.map"], |
| 156 | top_half: "system_ext_27.0.cil", |
| 157 | system_ext_specific: true, |
| 158 | } |
| 159 | |
| 160 | se_cil_compat_map { |
| 161 | name: "system_ext_27.0.cil", |
| 162 | stem: "27.0.cil", |
| 163 | bottom_half: [":27.0.board.compat.map"], |
| 164 | top_half: "system_ext_28.0.cil", |
| 165 | system_ext_specific: true, |
| 166 | } |
| 167 | |
| 168 | se_cil_compat_map { |
| 169 | name: "system_ext_28.0.cil", |
| 170 | stem: "28.0.cil", |
| 171 | bottom_half: [":28.0.board.compat.map"], |
| 172 | top_half: "system_ext_29.0.cil", |
| 173 | system_ext_specific: true, |
| 174 | } |
| 175 | |
| 176 | se_cil_compat_map { |
| 177 | name: "system_ext_29.0.cil", |
| 178 | stem: "29.0.cil", |
| 179 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 180 | top_half: "system_ext_30.0.cil", |
| 181 | system_ext_specific: true, |
| 182 | } |
| 183 | |
| 184 | se_cil_compat_map { |
| 185 | name: "system_ext_30.0.cil", |
| 186 | stem: "30.0.cil", |
| 187 | bottom_half: [":30.0.board.compat.map"], |
| 188 | // top_half: "system_ext_31.0.cil", |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 189 | system_ext_specific: true, |
| 190 | } |
| 191 | |
| 192 | se_cil_compat_map { |
| 193 | name: "product_26.0.cil", |
| 194 | stem: "26.0.cil", |
| 195 | bottom_half: [":26.0.board.compat.map"], |
| 196 | top_half: "product_27.0.cil", |
| 197 | product_specific: true, |
| 198 | } |
| 199 | |
| 200 | se_cil_compat_map { |
| 201 | name: "product_27.0.cil", |
| 202 | stem: "27.0.cil", |
| 203 | bottom_half: [":27.0.board.compat.map"], |
| 204 | top_half: "product_28.0.cil", |
| 205 | product_specific: true, |
| 206 | } |
| 207 | |
| 208 | se_cil_compat_map { |
| 209 | name: "product_28.0.cil", |
| 210 | stem: "28.0.cil", |
| 211 | bottom_half: [":28.0.board.compat.map"], |
| 212 | top_half: "product_29.0.cil", |
| 213 | product_specific: true, |
| 214 | } |
| 215 | |
| 216 | se_cil_compat_map { |
| 217 | name: "product_29.0.cil", |
| 218 | stem: "29.0.cil", |
| 219 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 220 | top_half: "product_30.0.cil", |
| 221 | product_specific: true, |
| 222 | } |
| 223 | |
| 224 | se_cil_compat_map { |
| 225 | name: "product_30.0.cil", |
| 226 | stem: "30.0.cil", |
| 227 | bottom_half: [":30.0.board.compat.map"], |
| 228 | // top_half: "product_31.0.cil", |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 229 | product_specific: true, |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | se_cil_compat_map { |
| 233 | name: "26.0.ignore.cil", |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 234 | bottom_half: [":26.0.board.ignore.map"], |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 235 | top_half: "27.0.ignore.cil", |
| 236 | } |
| 237 | |
| 238 | se_cil_compat_map { |
| 239 | name: "27.0.ignore.cil", |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 240 | bottom_half: [":27.0.board.ignore.map"], |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 241 | top_half: "28.0.ignore.cil", |
| 242 | } |
| 243 | |
| 244 | se_cil_compat_map { |
| 245 | name: "28.0.ignore.cil", |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 246 | bottom_half: [":28.0.board.ignore.map"], |
Tri Vo | e381deb | 2019-06-12 15:52:30 -0700 | [diff] [blame] | 247 | top_half: "29.0.ignore.cil", |
Jae Shin | 1fa9634 | 2018-07-11 18:30:44 +0900 | [diff] [blame] | 248 | } |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 249 | |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 250 | se_cil_compat_map { |
| 251 | name: "29.0.ignore.cil", |
| 252 | bottom_half: [":29.0.board.ignore.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 253 | top_half: "30.0.ignore.cil", |
| 254 | } |
| 255 | |
| 256 | se_cil_compat_map { |
| 257 | name: "30.0.ignore.cil", |
| 258 | bottom_half: [":30.0.board.ignore.map"], |
| 259 | // top_half: "31.0.ignore.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 260 | } |
| 261 | |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 262 | prebuilt_etc { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 263 | name: "26.0.compat.cil", |
| 264 | src: "private/compat/26.0/26.0.compat.cil", |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 265 | sub_dir: "selinux/mapping", |
| 266 | } |
| 267 | |
| 268 | prebuilt_etc { |
| 269 | name: "27.0.compat.cil", |
| 270 | src: "private/compat/27.0/27.0.compat.cil", |
| 271 | sub_dir: "selinux/mapping", |
| 272 | } |
| 273 | |
| 274 | prebuilt_etc { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 275 | name: "28.0.compat.cil", |
| 276 | src: "private/compat/28.0/28.0.compat.cil", |
| 277 | sub_dir: "selinux/mapping", |
| 278 | } |
| 279 | |
| 280 | prebuilt_etc { |
| 281 | name: "29.0.compat.cil", |
| 282 | src: "private/compat/29.0/29.0.compat.cil", |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 283 | sub_dir: "selinux/mapping", |
| 284 | } |
| 285 | |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 286 | prebuilt_etc { |
| 287 | name: "30.0.compat.cil", |
| 288 | src: "private/compat/30.0/30.0.compat.cil", |
| 289 | sub_dir: "selinux/mapping", |
| 290 | } |
| 291 | |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 292 | se_filegroup { |
| 293 | name: "file_contexts_files", |
| 294 | srcs: ["file_contexts"], |
| 295 | } |
| 296 | |
| 297 | se_filegroup { |
| 298 | name: "file_contexts_asan_files", |
| 299 | srcs: ["file_contexts_asan"], |
| 300 | } |
| 301 | |
| 302 | se_filegroup { |
| 303 | name: "file_contexts_overlayfs_files", |
| 304 | srcs: ["file_contexts_overlayfs"], |
| 305 | } |
| 306 | |
| 307 | se_filegroup { |
| 308 | name: "hwservice_contexts_files", |
| 309 | srcs: ["hwservice_contexts"], |
| 310 | } |
| 311 | |
| 312 | se_filegroup { |
| 313 | name: "property_contexts_files", |
| 314 | srcs: ["property_contexts"], |
| 315 | } |
| 316 | |
| 317 | se_filegroup { |
| 318 | name: "service_contexts_files", |
| 319 | srcs: ["service_contexts"], |
| 320 | } |
| 321 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 322 | se_filegroup { |
| 323 | name: "keystore2_key_contexts_files", |
| 324 | srcs: ["keystore2_key_contexts"], |
| 325 | } |
| 326 | |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 327 | file_contexts { |
| 328 | name: "plat_file_contexts", |
| 329 | srcs: [":file_contexts_files"], |
| 330 | product_variables: { |
| 331 | address_sanitize: { |
| 332 | srcs: [":file_contexts_asan_files"], |
| 333 | }, |
| 334 | debuggable: { |
| 335 | srcs: [":file_contexts_overlayfs_files"], |
| 336 | }, |
| 337 | }, |
| 338 | |
| 339 | flatten_apex: { |
| 340 | srcs: ["apex/*-file_contexts"], |
| 341 | }, |
| 342 | |
| 343 | recovery_available: true, |
| 344 | } |
| 345 | |
| 346 | file_contexts { |
| 347 | name: "vendor_file_contexts", |
| 348 | srcs: [":file_contexts_files"], |
| 349 | soc_specific: true, |
| 350 | recovery_available: true, |
| 351 | } |
| 352 | |
| 353 | file_contexts { |
Bowgo Tsai | 86a048d | 2019-09-09 22:04:06 +0800 | [diff] [blame] | 354 | name: "system_ext_file_contexts", |
| 355 | srcs: [":file_contexts_files"], |
| 356 | system_ext_specific: true, |
| 357 | recovery_available: true, |
| 358 | } |
| 359 | |
| 360 | file_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 361 | name: "product_file_contexts", |
| 362 | srcs: [":file_contexts_files"], |
| 363 | product_specific: true, |
| 364 | recovery_available: true, |
| 365 | } |
| 366 | |
| 367 | file_contexts { |
| 368 | name: "odm_file_contexts", |
| 369 | srcs: [":file_contexts_files"], |
| 370 | device_specific: true, |
| 371 | recovery_available: true, |
| 372 | } |
| 373 | |
| 374 | hwservice_contexts { |
| 375 | name: "plat_hwservice_contexts", |
| 376 | srcs: [":hwservice_contexts_files"], |
| 377 | } |
| 378 | |
| 379 | hwservice_contexts { |
Bowgo Tsai | 241d36e | 2019-09-09 22:05:10 +0800 | [diff] [blame] | 380 | name: "system_ext_hwservice_contexts", |
| 381 | srcs: [":hwservice_contexts_files"], |
| 382 | system_ext_specific: true, |
| 383 | } |
| 384 | |
| 385 | hwservice_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 386 | name: "product_hwservice_contexts", |
| 387 | srcs: [":hwservice_contexts_files"], |
| 388 | product_specific: true, |
| 389 | } |
| 390 | |
| 391 | hwservice_contexts { |
| 392 | name: "vendor_hwservice_contexts", |
| 393 | srcs: [":hwservice_contexts_files"], |
| 394 | reqd_mask: true, |
| 395 | soc_specific: true, |
| 396 | } |
| 397 | |
| 398 | hwservice_contexts { |
| 399 | name: "odm_hwservice_contexts", |
| 400 | srcs: [":hwservice_contexts_files"], |
| 401 | device_specific: true, |
| 402 | } |
| 403 | |
| 404 | property_contexts { |
| 405 | name: "plat_property_contexts", |
| 406 | srcs: [":property_contexts_files"], |
| 407 | recovery_available: true, |
| 408 | } |
| 409 | |
| 410 | property_contexts { |
Bowgo Tsai | 1864cd0 | 2019-09-09 18:09:22 +0800 | [diff] [blame] | 411 | name: "system_ext_property_contexts", |
| 412 | srcs: [":property_contexts_files"], |
| 413 | system_ext_specific: true, |
| 414 | recovery_available: true, |
| 415 | } |
| 416 | |
| 417 | property_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 418 | name: "product_property_contexts", |
| 419 | srcs: [":property_contexts_files"], |
| 420 | product_specific: true, |
| 421 | recovery_available: true, |
| 422 | } |
| 423 | |
| 424 | property_contexts { |
| 425 | name: "vendor_property_contexts", |
| 426 | srcs: [":property_contexts_files"], |
| 427 | reqd_mask: true, |
| 428 | soc_specific: true, |
| 429 | recovery_available: true, |
| 430 | } |
| 431 | |
| 432 | property_contexts { |
| 433 | name: "odm_property_contexts", |
| 434 | srcs: [":property_contexts_files"], |
| 435 | device_specific: true, |
| 436 | recovery_available: true, |
| 437 | } |
| 438 | |
| 439 | service_contexts { |
| 440 | name: "plat_service_contexts", |
| 441 | srcs: [":service_contexts_files"], |
| 442 | } |
| 443 | |
| 444 | service_contexts { |
Bowgo Tsai | 9823116 | 2019-09-09 22:05:29 +0800 | [diff] [blame] | 445 | name: "system_ext_service_contexts", |
| 446 | srcs: [":service_contexts_files"], |
| 447 | system_ext_specific: true, |
| 448 | } |
| 449 | |
| 450 | service_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 451 | name: "product_service_contexts", |
| 452 | srcs: [":service_contexts_files"], |
| 453 | product_specific: true, |
| 454 | } |
| 455 | |
| 456 | service_contexts { |
| 457 | name: "vendor_service_contexts", |
| 458 | srcs: [":service_contexts_files"], |
| 459 | reqd_mask: true, |
| 460 | soc_specific: true, |
| 461 | } |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 462 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 463 | keystore2_key_contexts { |
| 464 | name: "plat_keystore2_key_contexts", |
| 465 | srcs: [":keystore2_key_contexts_files"], |
| 466 | } |
| 467 | |
| 468 | keystore2_key_contexts { |
| 469 | name: "system_keystore2_key_contexts", |
| 470 | srcs: [":keystore2_key_contexts_files"], |
| 471 | system_ext_specific: true, |
| 472 | } |
| 473 | |
| 474 | keystore2_key_contexts { |
| 475 | name: "product_keystore2_key_contexts", |
| 476 | srcs: [":keystore2_key_contexts_files"], |
| 477 | product_specific: true, |
| 478 | } |
| 479 | |
| 480 | keystore2_key_contexts { |
| 481 | name: "vendor_keystore2_key_contexts", |
| 482 | srcs: [":keystore2_key_contexts_files"], |
| 483 | reqd_mask: true, |
| 484 | soc_specific: true, |
| 485 | } |
| 486 | |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 487 | // For vts_treble_sys_prop_test |
| 488 | filegroup { |
| 489 | name: "private_property_contexts", |
| 490 | srcs: ["private/property_contexts"], |
| 491 | visibility: [ |
| 492 | "//test/vts-testcase/security/system_property", |
| 493 | ], |
| 494 | } |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 495 | |
| 496 | // This is a minimized cil modules to test microdroid. |
| 497 | // TODO(b/178993690): migrate cil files to Android.bp and remove below |
| 498 | filegroup { |
| 499 | name: "microdroid_sepolicy_build_files", |
| 500 | srcs: [ |
| 501 | // This order is important. Should be identical to sepolicy_build_files in Android.mk |
| 502 | "private/security_classes", |
| 503 | "private/initial_sids", |
| 504 | "private/access_vectors", |
| 505 | "public/global_macros", |
| 506 | "public/neverallow_macros", |
| 507 | "private/mls_macros", |
| 508 | "private/mls_decl", |
| 509 | "private/mls", |
| 510 | "private/policy_capabilities", |
| 511 | "public/te_macros", |
| 512 | "public/attributes", |
| 513 | "private/attributes", |
| 514 | "public/ioctl_defines", |
| 515 | "public/ioctl_macros", |
| 516 | "public/*.te", |
| 517 | "private/*.te", |
| 518 | "private/roles_decl", |
| 519 | "public/roles", |
| 520 | "private/users", |
| 521 | "private/initial_sid_contexts", |
| 522 | "private/fs_use", |
| 523 | "private/genfs_contexts", |
| 524 | "private/port_contexts", |
| 525 | ], |
| 526 | } |
| 527 | |
| 528 | filegroup { |
| 529 | name: "microdroid_sepolicy_public_and_reqd_mask_build_files", |
| 530 | srcs: [ |
| 531 | // This order is important. Should be identical to sepolicy_build_files in Android.mk |
| 532 | "reqd_mask/security_classes", |
| 533 | "reqd_mask/initial_sids", |
| 534 | "reqd_mask/access_vectors", |
| 535 | "public/global_macros", |
| 536 | "public/neverallow_macros", |
| 537 | "reqd_mask/mls_macros", |
| 538 | "reqd_mask/mls_decl", |
| 539 | "reqd_mask/mls", |
| 540 | "public/te_macros", |
| 541 | "public/attributes", |
| 542 | "public/ioctl_defines", |
| 543 | "public/ioctl_macros", |
| 544 | "public/*.te", |
| 545 | "reqd_mask/*.te", |
| 546 | "reqd_mask/roles_decl", |
| 547 | "public/roles", |
| 548 | "reqd_mask/roles", |
| 549 | "reqd_mask/users", |
| 550 | "reqd_mask/initial_sid_contexts", |
| 551 | ], |
| 552 | } |
| 553 | |
| 554 | filegroup { |
| 555 | name: "microdroid_sepolicy_reqd_mask_build_files", |
| 556 | srcs: [ |
| 557 | // This order is important. Should be identical to sepolicy_build_files in Android.mk |
| 558 | "reqd_mask/security_classes", |
| 559 | "reqd_mask/initial_sids", |
| 560 | "reqd_mask/access_vectors", |
| 561 | "reqd_mask/mls_macros", |
| 562 | "reqd_mask/mls_decl", |
| 563 | "reqd_mask/mls", |
| 564 | "reqd_mask/*.te", |
| 565 | "reqd_mask/roles_decl", |
| 566 | "reqd_mask/roles", |
| 567 | "reqd_mask/users", |
| 568 | "reqd_mask/initial_sid_contexts", |
| 569 | ], |
| 570 | } |
| 571 | |
| 572 | // These variables are based on aosp_cf_x86_64_only_phone-userdebug. Other than target_arch, |
| 573 | // these configurations should be fine to test microdroid on normal devices with full treble. |
| 574 | // The exception is target_arch. But as target_arch is meaningful only on mips, and as we are not |
| 575 | // running microdroid on mips for now, we skip assigning target_arch here. After cil files are fully |
| 576 | // migrated into Soong, these will have correct values. |
| 577 | policy_to_conf_flags = "$(location m4) --fatal-warnings " + |
| 578 | "-D mls_num_sens=1 -D mls_num_cats=1024 " + |
| 579 | "-D target_build_variant=userdebug " + |
| 580 | "-D target_with_asan=false " + |
| 581 | "-D target_with_native_coverage=false " + |
| 582 | "-D target_full_treble=true " + |
| 583 | "-D target_compatible_property=true " + |
| 584 | "-D target_treble_sysprop_neverallow=true " + |
| 585 | "-D target_enforce_sysprop_owner=true " |
| 586 | |
| 587 | genrule { |
| 588 | name: "microdroid_plat_sepolicy.cil_gen", |
| 589 | srcs: [":microdroid_sepolicy_build_files"], |
| 590 | tools: ["m4", "checkpolicy"], |
| 591 | out: ["plat_sepolicy.cil"], |
| 592 | cmd: policy_to_conf_flags + |
| 593 | "-s $(locations :microdroid_sepolicy_build_files) > $(out).conf" + |
| 594 | "&& $(location checkpolicy) -M -C -c 30 -o $(out) $(out).conf", |
| 595 | visibility: ["//visibility:private"], |
| 596 | } |
| 597 | |
| 598 | prebuilt_etc { |
| 599 | name: "microdroid_plat_sepolicy.cil", |
| 600 | src: ":microdroid_plat_sepolicy.cil_gen", |
| 601 | filename: "plat_sepolicy.cil", |
| 602 | relative_install_path: "selinux", |
| 603 | installable: false, |
| 604 | } |
| 605 | |
| 606 | genrule { |
| 607 | name: "microdroid_reqd_policy_mask.cil_gen", |
| 608 | srcs: [":microdroid_sepolicy_reqd_mask_build_files"], |
| 609 | tools: ["m4", "checkpolicy"], |
| 610 | out: ["reqd_policy_mask.cil"], |
| 611 | cmd: policy_to_conf_flags + |
| 612 | "-s $(in) > $(out).conf" + |
| 613 | "&& $(location checkpolicy) -C -M -c 30 -o $(out) $(out).conf", |
| 614 | visibility: ["//visibility:private"], |
| 615 | } |
| 616 | |
| 617 | genrule { |
| 618 | name: "microdroid_plat_mapping_file_gen", |
| 619 | srcs: [":microdroid_sepolicy_public_and_reqd_mask_build_files", ":microdroid_reqd_policy_mask.cil_gen"], |
| 620 | tools: ["m4", "checkpolicy", "build_sepolicy", "version_policy"], |
| 621 | out: ["10000.0.cil"], |
| 622 | cmd: policy_to_conf_flags + |
| 623 | "-s $(locations :microdroid_sepolicy_public_and_reqd_mask_build_files) > $(out).conf" + |
| 624 | "&& $(location checkpolicy) -M -C -c 30 -o $(out).pub $(out).conf" + |
| 625 | "&& $(location build_sepolicy) filter_out -f $(location :microdroid_reqd_policy_mask.cil_gen) -t $(out).pub" + |
| 626 | "&& $(location version_policy) -b $(out).pub -m -n 10000.0 -o $(out)", |
| 627 | visibility: ["//visibility:private"], |
| 628 | } |
| 629 | |
| 630 | prebuilt_etc { |
| 631 | name: "microdroid_plat_mapping_file", |
| 632 | src: ":microdroid_plat_mapping_file_gen", |
| 633 | filename: "10000.0.cil", |
| 634 | relative_install_path: "selinux/mapping", |
| 635 | installable: false, |
| 636 | } |