blob: 1dd5e4a4544d8d284f4555767ae4da72aed5c735 [file] [log] [blame]
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -07001// Copyright (C) 2008 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
Dan Willemsend32e6d12019-04-10 12:25:07 -070015bootstrap_go_package {
16 name: "soong-fs_config",
17 pkgPath: "android/soong/fs_config",
18 deps: [
19 "soong-android",
20 "soong-genrule",
21 ],
22 srcs: [
Tom Cherryfb303a52019-07-11 15:31:36 -070023 "fs_config.go",
Dan Willemsend32e6d12019-04-10 12:25:07 -070024 ],
25 pluginFor: ["soong_build"],
26}
27
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070028cc_binary_host {
29 name: "fs_config",
30 srcs: ["fs_config.c"],
31 shared_libs: [
32 "libcutils",
33 "libselinux",
34 ],
35 cflags: ["-Werror"],
36}
Dan Willemsend32e6d12019-04-10 12:25:07 -070037
38target_fs_config_gen_filegroup {
39 name: "target_fs_config_gen",
40}
41
42genrule {
43 name: "oemaids_header_gen",
44 tool_files: ["fs_config_generator.py"],
Dan Willemsen7f25f2a2019-04-18 10:10:34 -070045 cmd: "$(location fs_config_generator.py) oemaid --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
Dan Willemsend32e6d12019-04-10 12:25:07 -070046 srcs: [
47 ":target_fs_config_gen",
48 ":android_filesystem_config_header",
49 ],
50 out: ["generated_oem_aid.h"],
51}
52
53cc_library_headers {
54 name: "oemaids_headers",
P.Adarsh Reddy8b2e7c92020-02-18 14:53:22 +053055 vendor_available: true,
Dan Willemsend32e6d12019-04-10 12:25:07 -070056 generated_headers: ["oemaids_header_gen"],
57 export_generated_headers: ["oemaids_header_gen"],
58}
59
Tom Cherryfb303a52019-07-11 15:31:36 -070060// Generate the */etc/passwd text files for the target
61// These files may be empty if no AIDs are defined in
Dan Willemsend32e6d12019-04-10 12:25:07 -070062// TARGET_FS_CONFIG_GEN files.
63genrule {
Tom Cherryfb303a52019-07-11 15:31:36 -070064 name: "passwd_gen_system",
Dan Willemsend32e6d12019-04-10 12:25:07 -070065 tool_files: ["fs_config_generator.py"],
Tom Cherryfb303a52019-07-11 15:31:36 -070066 cmd: "$(location fs_config_generator.py) passwd --partition=system --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
Dan Willemsend32e6d12019-04-10 12:25:07 -070067 srcs: [
68 ":target_fs_config_gen",
69 ":android_filesystem_config_header",
70 ],
71 out: ["passwd"],
72}
73
74prebuilt_etc {
Tom Cherryfb303a52019-07-11 15:31:36 -070075 name: "passwd_system",
76 filename: "passwd",
77 src: ":passwd_gen_system",
Dan Willemsend32e6d12019-04-10 12:25:07 -070078}
79
Tom Cherryfb303a52019-07-11 15:31:36 -070080genrule {
81 name: "passwd_gen_vendor",
82 tool_files: ["fs_config_generator.py"],
83 cmd: "$(location fs_config_generator.py) passwd --partition=vendor --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
84 srcs: [
85 ":target_fs_config_gen",
86 ":android_filesystem_config_header",
87 ],
88 out: ["passwd"],
89}
90
91prebuilt_etc {
92 name: "passwd_vendor",
93 filename: "passwd",
94 vendor: true,
95 src: ":passwd_gen_vendor",
96}
97
98genrule {
99 name: "passwd_gen_odm",
100 tool_files: ["fs_config_generator.py"],
101 cmd: "$(location fs_config_generator.py) passwd --partition=odm --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
102 srcs: [
103 ":target_fs_config_gen",
104 ":android_filesystem_config_header",
105 ],
106 out: ["passwd"],
107}
108
109prebuilt_etc {
110 name: "passwd_odm",
111 filename: "passwd",
112 device_specific: true,
113 src: ":passwd_gen_odm",
114}
115
116genrule {
117 name: "passwd_gen_product",
118 tool_files: ["fs_config_generator.py"],
119 cmd: "$(location fs_config_generator.py) passwd --partition=product --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
120 srcs: [
121 ":target_fs_config_gen",
122 ":android_filesystem_config_header",
123 ],
124 out: ["passwd"],
125}
126
127prebuilt_etc {
128 name: "passwd_product",
129 filename: "passwd",
130 product_specific: true,
131 src: ":passwd_gen_product",
132}
133
134genrule {
135 name: "passwd_gen_system_ext",
136 tool_files: ["fs_config_generator.py"],
137 cmd: "$(location fs_config_generator.py) passwd --partition=system_ext --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
138 srcs: [
139 ":target_fs_config_gen",
140 ":android_filesystem_config_header",
141 ],
142 out: ["passwd"],
143}
144
145prebuilt_etc {
146 name: "passwd_system_ext",
147 filename: "passwd",
148 system_ext_specific: true,
149 src: ":passwd_gen_system_ext",
150}
151
152// Generate the */etc/group text files for the target
153// These files may be empty if no AIDs are defined in
Dan Willemsend32e6d12019-04-10 12:25:07 -0700154// TARGET_FS_CONFIG_GEN files.
155genrule {
Tom Cherryfb303a52019-07-11 15:31:36 -0700156 name: "group_gen_system",
Dan Willemsend32e6d12019-04-10 12:25:07 -0700157 tool_files: ["fs_config_generator.py"],
Tom Cherryfb303a52019-07-11 15:31:36 -0700158 cmd: "$(location fs_config_generator.py) group --partition=system --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
Dan Willemsend32e6d12019-04-10 12:25:07 -0700159 srcs: [
160 ":target_fs_config_gen",
161 ":android_filesystem_config_header",
162 ],
163 out: ["group"],
164}
165
166prebuilt_etc {
Tom Cherryfb303a52019-07-11 15:31:36 -0700167 name: "group_system",
168 filename: "group",
169 src: ":group_gen_system",
170}
171
172genrule {
173 name: "group_gen_vendor",
174 tool_files: ["fs_config_generator.py"],
175 cmd: "$(location fs_config_generator.py) group --partition=vendor --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
176 srcs: [
177 ":target_fs_config_gen",
178 ":android_filesystem_config_header",
179 ],
180 out: ["group"],
181}
182
183prebuilt_etc {
184 name: "group_vendor",
185 filename: "group",
Dan Willemsend32e6d12019-04-10 12:25:07 -0700186 vendor: true,
Tom Cherryfb303a52019-07-11 15:31:36 -0700187 src: ":group_gen_vendor",
188}
189
190genrule {
191 name: "group_gen_odm",
192 tool_files: ["fs_config_generator.py"],
193 cmd: "$(location fs_config_generator.py) group --partition=odm --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
194 srcs: [
195 ":target_fs_config_gen",
196 ":android_filesystem_config_header",
197 ],
198 out: ["group"],
199}
200
201prebuilt_etc {
202 name: "group_odm",
203 filename: "group",
204 device_specific: true,
205 src: ":group_gen_odm",
206}
207
208genrule {
209 name: "group_gen_product",
210 tool_files: ["fs_config_generator.py"],
211 cmd: "$(location fs_config_generator.py) group --partition=product --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
212 srcs: [
213 ":target_fs_config_gen",
214 ":android_filesystem_config_header",
215 ],
216 out: ["group"],
217}
218
219prebuilt_etc {
220 name: "group_product",
221 filename: "group",
222 product_specific: true,
223 src: ":group_gen_product",
224}
225
226genrule {
227 name: "group_gen_system_ext",
228 tool_files: ["fs_config_generator.py"],
229 cmd: "$(location fs_config_generator.py) group --partition=system_ext --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
230 srcs: [
231 ":target_fs_config_gen",
232 ":android_filesystem_config_header",
233 ],
234 out: ["group"],
235}
236
237prebuilt_etc {
238 name: "group_system_ext",
239 filename: "group",
240 system_ext_specific: true,
241 src: ":group_gen_system_ext",
Dan Willemsend32e6d12019-04-10 12:25:07 -0700242}