• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2020 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21python_defaults {
22    name: "gki_python_defaults",
23    libs: [
24        "releasetools_ota_from_target_files",
25    ],
26    version: {
27        py3: {
28            embedded_launcher: true,
29        },
30    },
31    target: {
32        darwin: {
33            // required module "brillo_update_payload" is disabled on darwin
34            enabled: false,
35        },
36    },
37}
38
39python_binary_host {
40    name: "ota_from_raw_image",
41    defaults: ["gki_python_defaults"],
42    srcs: ["ota_from_raw_image.py"],
43    required: [
44        "brillo_update_payload",
45    ],
46}
47
48python_binary_host {
49    name: "extract_img_from_apex",
50    defaults: ["gki_python_defaults"],
51    srcs: ["extract_img_from_apex.py"],
52    required: [
53        "debugfs",
54        "delta_generator",
55    ],
56}
57
58apex_key {
59    name: "com.android.gki.key",
60    public_key: "com.android.gki.avbpubkey",
61    private_key: "com.android.gki.pem",
62}
63
64// Use cc_prebuilt_binary because sh_binary does not support product_specific.
65// TODO(b/169954965): Change to sh_binary when product_specific is supported.
66cc_prebuilt_binary {
67    name: "com.android.gki.preinstall",
68    product_specific: true,
69    srcs: ["preinstall.sh"],
70    apex_available: ["com.android.gki.*"],
71    strip: {
72        none: true,
73    },
74}
75
76// Common defaults for all GKI APEXes.
77apex_defaults {
78    name: "com.android.gki_defaults",
79    product_specific: true,
80    binaries: [
81        "update_engine_stable_client",
82        "com.android.gki.preinstall",
83    ],
84    file_contexts: ":com.android.gki-file_contexts",
85    // Key to sign apex_payload.img
86    key: "com.android.gki.key",
87    // Key to sign APEX. Left empty to use defaults.
88    certificate: "",
89    updatable: false,
90}
91
92// Helper binary to build APEX manifest for GKI.
93cc_binary_host {
94    name: "build_gki_apex_manifest",
95    srcs: [
96        "build_gki_apex_manifest.cpp",
97    ],
98    static_libs: [
99        "libbase",
100        "libgflags",
101        "libjsoncpp",
102        "libkver",
103        "liblog",
104    ],
105    cflags: [
106        "-Wall",
107        "-Werror",
108    ],
109}
110
111// Build GKI APEX 5.4-android12-unstable from $(PRODUCT_OUT)/boot.img.
112// Also generate test packages.
113gki_apex {
114    name: "com.android.gki.kmi_5_4_android12_unstable",
115    installable: true,
116    kmi_version: "5.4-android12-unstable",
117    product_out_path: "boot.img",
118    gen_test: true,
119}
120
121// Build GKI APEX 5.10-android12-unstable from $(PRODUCT_OUT)/boot.img.
122// Also generate test packages.
123gki_apex {
124    name: "com.android.gki.kmi_5_10_android12_unstable",
125    installable: true,
126    kmi_version: "5.10-android12-unstable",
127    product_out_path: "boot.img",
128    gen_test: true,
129}
130
131// Build GKI APEX 5.4-android12-unstable from $(PRODUCT_OUT)/boot-5.4.img
132gki_apex {
133    name: "com.android.gki.kmi_5_4_android12_unstable_boot-5.4",
134    installable: false,
135    kmi_version: "5.4-android12-unstable",
136    product_out_path: "boot-5.4.img",
137}
138
139// Build GKI APEX 5.10-android12-unstable from $(PRODUCT_OUT)/boot-5.10.img
140gki_apex {
141    name: "com.android.gki.kmi_5_10_android12_unstable_boot-5.10",
142    installable: false,
143    kmi_version: "5.10-android12-unstable",
144    product_out_path: "boot-5.10.img",
145}
146
147// List of all test APEXes for GkiInstallTest. Append "_test_high" and "_test_low" for each
148// gki_apex with gen_test:true.
149filegroup {
150    name: "gki_install_test_files",
151    srcs: [
152        ":com.android.gki.kmi_5_4_android12_unstable_test_high",
153        ":com.android.gki.kmi_5_4_android12_unstable_test_low",
154        ":com.android.gki.kmi_5_10_android12_unstable_test_high",
155        ":com.android.gki.kmi_5_10_android12_unstable_test_low",
156    ],
157}
158