blob: 8891a0a6eceaaa67ffcc7f8a2dc8c8b25929b2a0 [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
Bob Badour03905802021-02-12 21:42:54 -080015package {
16 // See: http://go/android-license-faq
Bob Badourd2c7c082022-01-24 15:21:32 -080017 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour03905802021-02-12 21:42:54 -080018}
19
Dan Willemsend32e6d12019-04-10 12:25:07 -070020bootstrap_go_package {
21 name: "soong-fs_config",
22 pkgPath: "android/soong/fs_config",
23 deps: [
24 "soong-android",
25 "soong-genrule",
26 ],
27 srcs: [
Tom Cherryfb303a52019-07-11 15:31:36 -070028 "fs_config.go",
Dan Willemsend32e6d12019-04-10 12:25:07 -070029 ],
30 pluginFor: ["soong_build"],
31}
32
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070033cc_binary_host {
34 name: "fs_config",
35 srcs: ["fs_config.c"],
36 shared_libs: [
37 "libcutils",
38 "libselinux",
39 ],
40 cflags: ["-Werror"],
41}
Dan Willemsend32e6d12019-04-10 12:25:07 -070042
43target_fs_config_gen_filegroup {
44 name: "target_fs_config_gen",
45}
46
47genrule {
48 name: "oemaids_header_gen",
49 tool_files: ["fs_config_generator.py"],
Dan Willemsen7f25f2a2019-04-18 10:10:34 -070050 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 -070051 srcs: [
52 ":target_fs_config_gen",
53 ":android_filesystem_config_header",
54 ],
55 out: ["generated_oem_aid.h"],
56}
57
58cc_library_headers {
59 name: "oemaids_headers",
P.Adarsh Reddy8b2e7c92020-02-18 14:53:22 +053060 vendor_available: true,
Dan Willemsend32e6d12019-04-10 12:25:07 -070061 generated_headers: ["oemaids_header_gen"],
62 export_generated_headers: ["oemaids_header_gen"],
63}
64
Tom Cherryfb303a52019-07-11 15:31:36 -070065// Generate the */etc/passwd text files for the target
66// These files may be empty if no AIDs are defined in
Dan Willemsend32e6d12019-04-10 12:25:07 -070067// TARGET_FS_CONFIG_GEN files.
68genrule {
Tom Cherryfb303a52019-07-11 15:31:36 -070069 name: "passwd_gen_system",
Dan Willemsend32e6d12019-04-10 12:25:07 -070070 tool_files: ["fs_config_generator.py"],
Tom Cherryfb303a52019-07-11 15:31:36 -070071 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 -070072 srcs: [
73 ":target_fs_config_gen",
74 ":android_filesystem_config_header",
75 ],
76 out: ["passwd"],
77}
78
79prebuilt_etc {
Tom Cherryfb303a52019-07-11 15:31:36 -070080 name: "passwd_system",
81 filename: "passwd",
82 src: ":passwd_gen_system",
Dan Willemsend32e6d12019-04-10 12:25:07 -070083}
84
Tom Cherryfb303a52019-07-11 15:31:36 -070085genrule {
86 name: "passwd_gen_vendor",
87 tool_files: ["fs_config_generator.py"],
88 cmd: "$(location fs_config_generator.py) passwd --partition=vendor --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
89 srcs: [
90 ":target_fs_config_gen",
91 ":android_filesystem_config_header",
92 ],
93 out: ["passwd"],
94}
95
96prebuilt_etc {
97 name: "passwd_vendor",
98 filename: "passwd",
99 vendor: true,
100 src: ":passwd_gen_vendor",
101}
102
103genrule {
104 name: "passwd_gen_odm",
105 tool_files: ["fs_config_generator.py"],
106 cmd: "$(location fs_config_generator.py) passwd --partition=odm --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
107 srcs: [
108 ":target_fs_config_gen",
109 ":android_filesystem_config_header",
110 ],
111 out: ["passwd"],
112}
113
114prebuilt_etc {
115 name: "passwd_odm",
116 filename: "passwd",
117 device_specific: true,
118 src: ":passwd_gen_odm",
119}
120
121genrule {
122 name: "passwd_gen_product",
123 tool_files: ["fs_config_generator.py"],
124 cmd: "$(location fs_config_generator.py) passwd --partition=product --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
125 srcs: [
126 ":target_fs_config_gen",
127 ":android_filesystem_config_header",
128 ],
129 out: ["passwd"],
130}
131
132prebuilt_etc {
133 name: "passwd_product",
134 filename: "passwd",
135 product_specific: true,
136 src: ":passwd_gen_product",
137}
138
139genrule {
140 name: "passwd_gen_system_ext",
141 tool_files: ["fs_config_generator.py"],
142 cmd: "$(location fs_config_generator.py) passwd --partition=system_ext --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
143 srcs: [
144 ":target_fs_config_gen",
145 ":android_filesystem_config_header",
146 ],
147 out: ["passwd"],
148}
149
150prebuilt_etc {
151 name: "passwd_system_ext",
152 filename: "passwd",
153 system_ext_specific: true,
154 src: ":passwd_gen_system_ext",
155}
156
157// Generate the */etc/group text files for the target
158// These files may be empty if no AIDs are defined in
Dan Willemsend32e6d12019-04-10 12:25:07 -0700159// TARGET_FS_CONFIG_GEN files.
160genrule {
Tom Cherryfb303a52019-07-11 15:31:36 -0700161 name: "group_gen_system",
Dan Willemsend32e6d12019-04-10 12:25:07 -0700162 tool_files: ["fs_config_generator.py"],
Tom Cherryfb303a52019-07-11 15:31:36 -0700163 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 -0700164 srcs: [
165 ":target_fs_config_gen",
166 ":android_filesystem_config_header",
167 ],
168 out: ["group"],
169}
170
171prebuilt_etc {
Tom Cherryfb303a52019-07-11 15:31:36 -0700172 name: "group_system",
173 filename: "group",
174 src: ":group_gen_system",
175}
176
177genrule {
178 name: "group_gen_vendor",
179 tool_files: ["fs_config_generator.py"],
180 cmd: "$(location fs_config_generator.py) group --partition=vendor --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
181 srcs: [
182 ":target_fs_config_gen",
183 ":android_filesystem_config_header",
184 ],
185 out: ["group"],
186}
187
188prebuilt_etc {
189 name: "group_vendor",
190 filename: "group",
Dan Willemsend32e6d12019-04-10 12:25:07 -0700191 vendor: true,
Tom Cherryfb303a52019-07-11 15:31:36 -0700192 src: ":group_gen_vendor",
193}
194
195genrule {
196 name: "group_gen_odm",
197 tool_files: ["fs_config_generator.py"],
198 cmd: "$(location fs_config_generator.py) group --partition=odm --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
199 srcs: [
200 ":target_fs_config_gen",
201 ":android_filesystem_config_header",
202 ],
203 out: ["group"],
204}
205
206prebuilt_etc {
207 name: "group_odm",
208 filename: "group",
209 device_specific: true,
210 src: ":group_gen_odm",
211}
212
213genrule {
214 name: "group_gen_product",
215 tool_files: ["fs_config_generator.py"],
216 cmd: "$(location fs_config_generator.py) group --partition=product --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
217 srcs: [
218 ":target_fs_config_gen",
219 ":android_filesystem_config_header",
220 ],
221 out: ["group"],
222}
223
224prebuilt_etc {
225 name: "group_product",
226 filename: "group",
227 product_specific: true,
228 src: ":group_gen_product",
229}
230
231genrule {
232 name: "group_gen_system_ext",
233 tool_files: ["fs_config_generator.py"],
234 cmd: "$(location fs_config_generator.py) group --partition=system_ext --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
235 srcs: [
236 ":target_fs_config_gen",
237 ":android_filesystem_config_header",
238 ],
239 out: ["group"],
240}
241
242prebuilt_etc {
243 name: "group_system_ext",
244 filename: "group",
245 system_ext_specific: true,
246 src: ":group_gen_system_ext",
Dan Willemsend32e6d12019-04-10 12:25:07 -0700247}