blob: 4544e076c6ae8085480755d2d02255a8d74a55dd [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
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "build_make_license"
19 // to get the below license kinds:
20 // legacy_restricted
21 default_applicable_licenses: ["build_make_license"],
22}
23
Dan Willemsend32e6d12019-04-10 12:25:07 -070024bootstrap_go_package {
25 name: "soong-fs_config",
26 pkgPath: "android/soong/fs_config",
27 deps: [
28 "soong-android",
29 "soong-genrule",
30 ],
31 srcs: [
Tom Cherryfb303a52019-07-11 15:31:36 -070032 "fs_config.go",
Dan Willemsend32e6d12019-04-10 12:25:07 -070033 ],
34 pluginFor: ["soong_build"],
35}
36
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070037cc_binary_host {
38 name: "fs_config",
39 srcs: ["fs_config.c"],
40 shared_libs: [
41 "libcutils",
42 "libselinux",
43 ],
44 cflags: ["-Werror"],
45}
Dan Willemsend32e6d12019-04-10 12:25:07 -070046
47target_fs_config_gen_filegroup {
48 name: "target_fs_config_gen",
49}
50
51genrule {
52 name: "oemaids_header_gen",
53 tool_files: ["fs_config_generator.py"],
Dan Willemsen7f25f2a2019-04-18 10:10:34 -070054 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 -070055 srcs: [
56 ":target_fs_config_gen",
57 ":android_filesystem_config_header",
58 ],
59 out: ["generated_oem_aid.h"],
60}
61
62cc_library_headers {
63 name: "oemaids_headers",
P.Adarsh Reddy8b2e7c92020-02-18 14:53:22 +053064 vendor_available: true,
Dan Willemsend32e6d12019-04-10 12:25:07 -070065 generated_headers: ["oemaids_header_gen"],
66 export_generated_headers: ["oemaids_header_gen"],
67}
68
Tom Cherryfb303a52019-07-11 15:31:36 -070069// Generate the */etc/passwd text files for the target
70// These files may be empty if no AIDs are defined in
Dan Willemsend32e6d12019-04-10 12:25:07 -070071// TARGET_FS_CONFIG_GEN files.
72genrule {
Tom Cherryfb303a52019-07-11 15:31:36 -070073 name: "passwd_gen_system",
Dan Willemsend32e6d12019-04-10 12:25:07 -070074 tool_files: ["fs_config_generator.py"],
Tom Cherryfb303a52019-07-11 15:31:36 -070075 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 -070076 srcs: [
77 ":target_fs_config_gen",
78 ":android_filesystem_config_header",
79 ],
80 out: ["passwd"],
81}
82
83prebuilt_etc {
Tom Cherryfb303a52019-07-11 15:31:36 -070084 name: "passwd_system",
85 filename: "passwd",
86 src: ":passwd_gen_system",
Dan Willemsend32e6d12019-04-10 12:25:07 -070087}
88
Tom Cherryfb303a52019-07-11 15:31:36 -070089genrule {
90 name: "passwd_gen_vendor",
91 tool_files: ["fs_config_generator.py"],
92 cmd: "$(location fs_config_generator.py) passwd --partition=vendor --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
93 srcs: [
94 ":target_fs_config_gen",
95 ":android_filesystem_config_header",
96 ],
97 out: ["passwd"],
98}
99
100prebuilt_etc {
101 name: "passwd_vendor",
102 filename: "passwd",
103 vendor: true,
104 src: ":passwd_gen_vendor",
105}
106
107genrule {
108 name: "passwd_gen_odm",
109 tool_files: ["fs_config_generator.py"],
110 cmd: "$(location fs_config_generator.py) passwd --partition=odm --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
111 srcs: [
112 ":target_fs_config_gen",
113 ":android_filesystem_config_header",
114 ],
115 out: ["passwd"],
116}
117
118prebuilt_etc {
119 name: "passwd_odm",
120 filename: "passwd",
121 device_specific: true,
122 src: ":passwd_gen_odm",
123}
124
125genrule {
126 name: "passwd_gen_product",
127 tool_files: ["fs_config_generator.py"],
128 cmd: "$(location fs_config_generator.py) passwd --partition=product --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
129 srcs: [
130 ":target_fs_config_gen",
131 ":android_filesystem_config_header",
132 ],
133 out: ["passwd"],
134}
135
136prebuilt_etc {
137 name: "passwd_product",
138 filename: "passwd",
139 product_specific: true,
140 src: ":passwd_gen_product",
141}
142
143genrule {
144 name: "passwd_gen_system_ext",
145 tool_files: ["fs_config_generator.py"],
146 cmd: "$(location fs_config_generator.py) passwd --partition=system_ext --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
147 srcs: [
148 ":target_fs_config_gen",
149 ":android_filesystem_config_header",
150 ],
151 out: ["passwd"],
152}
153
154prebuilt_etc {
155 name: "passwd_system_ext",
156 filename: "passwd",
157 system_ext_specific: true,
158 src: ":passwd_gen_system_ext",
159}
160
161// Generate the */etc/group text files for the target
162// These files may be empty if no AIDs are defined in
Dan Willemsend32e6d12019-04-10 12:25:07 -0700163// TARGET_FS_CONFIG_GEN files.
164genrule {
Tom Cherryfb303a52019-07-11 15:31:36 -0700165 name: "group_gen_system",
Dan Willemsend32e6d12019-04-10 12:25:07 -0700166 tool_files: ["fs_config_generator.py"],
Tom Cherryfb303a52019-07-11 15:31:36 -0700167 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 -0700168 srcs: [
169 ":target_fs_config_gen",
170 ":android_filesystem_config_header",
171 ],
172 out: ["group"],
173}
174
175prebuilt_etc {
Tom Cherryfb303a52019-07-11 15:31:36 -0700176 name: "group_system",
177 filename: "group",
178 src: ":group_gen_system",
179}
180
181genrule {
182 name: "group_gen_vendor",
183 tool_files: ["fs_config_generator.py"],
184 cmd: "$(location fs_config_generator.py) group --partition=vendor --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
185 srcs: [
186 ":target_fs_config_gen",
187 ":android_filesystem_config_header",
188 ],
189 out: ["group"],
190}
191
192prebuilt_etc {
193 name: "group_vendor",
194 filename: "group",
Dan Willemsend32e6d12019-04-10 12:25:07 -0700195 vendor: true,
Tom Cherryfb303a52019-07-11 15:31:36 -0700196 src: ":group_gen_vendor",
197}
198
199genrule {
200 name: "group_gen_odm",
201 tool_files: ["fs_config_generator.py"],
202 cmd: "$(location fs_config_generator.py) group --partition=odm --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
203 srcs: [
204 ":target_fs_config_gen",
205 ":android_filesystem_config_header",
206 ],
207 out: ["group"],
208}
209
210prebuilt_etc {
211 name: "group_odm",
212 filename: "group",
213 device_specific: true,
214 src: ":group_gen_odm",
215}
216
217genrule {
218 name: "group_gen_product",
219 tool_files: ["fs_config_generator.py"],
220 cmd: "$(location fs_config_generator.py) group --partition=product --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
221 srcs: [
222 ":target_fs_config_gen",
223 ":android_filesystem_config_header",
224 ],
225 out: ["group"],
226}
227
228prebuilt_etc {
229 name: "group_product",
230 filename: "group",
231 product_specific: true,
232 src: ":group_gen_product",
233}
234
235genrule {
236 name: "group_gen_system_ext",
237 tool_files: ["fs_config_generator.py"],
238 cmd: "$(location fs_config_generator.py) group --partition=system_ext --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
239 srcs: [
240 ":target_fs_config_gen",
241 ":android_filesystem_config_header",
242 ],
243 out: ["group"],
244}
245
246prebuilt_etc {
247 name: "group_system_ext",
248 filename: "group",
249 system_ext_specific: true,
250 src: ":group_gen_system_ext",
Dan Willemsend32e6d12019-04-10 12:25:07 -0700251}