blob: d9a48d704aebda700e22d186eca349ecbb40d159 [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: [
23 "fs_config.go"
24 ],
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",
55 generated_headers: ["oemaids_header_gen"],
56 export_generated_headers: ["oemaids_header_gen"],
57}
58
59// Generate the vendor/etc/passwd text file for the target
60// This file may be empty if no AIDs are defined in
61// TARGET_FS_CONFIG_GEN files.
62genrule {
63 name: "passwd_gen",
64 tool_files: ["fs_config_generator.py"],
Dan Willemsen7f25f2a2019-04-18 10:10:34 -070065 cmd: "$(location fs_config_generator.py) passwd --required-prefix=vendor_ --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
Dan Willemsend32e6d12019-04-10 12:25:07 -070066 srcs: [
67 ":target_fs_config_gen",
68 ":android_filesystem_config_header",
69 ],
70 out: ["passwd"],
71}
72
73prebuilt_etc {
74 name: "passwd",
75 vendor: true,
76 src: ":passwd_gen",
77}
78
79// Generate the vendor/etc/group text file for the target
80// This file may be empty if no AIDs are defined in
81// TARGET_FS_CONFIG_GEN files.
82genrule {
83 name: "group_gen",
84 tool_files: ["fs_config_generator.py"],
Dan Willemsen7f25f2a2019-04-18 10:10:34 -070085 cmd: "$(location fs_config_generator.py) group --required-prefix=vendor_ --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
Dan Willemsend32e6d12019-04-10 12:25:07 -070086 srcs: [
87 ":target_fs_config_gen",
88 ":android_filesystem_config_header",
89 ],
90 out: ["group"],
91}
92
93prebuilt_etc {
94 name: "group",
95 vendor: true,
96 src: ":group_gen",
97}