2017-09-09 22:37:03 +02:00
|
|
|
// Copyright (C) 2008 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2019-04-10 21:25:07 +02:00
|
|
|
bootstrap_go_package {
|
|
|
|
name: "soong-fs_config",
|
|
|
|
pkgPath: "android/soong/fs_config",
|
|
|
|
deps: [
|
|
|
|
"soong-android",
|
|
|
|
"soong-genrule",
|
|
|
|
],
|
|
|
|
srcs: [
|
2019-07-12 00:31:36 +02:00
|
|
|
"fs_config.go",
|
2019-04-10 21:25:07 +02:00
|
|
|
],
|
|
|
|
pluginFor: ["soong_build"],
|
|
|
|
}
|
|
|
|
|
2017-09-09 22:37:03 +02:00
|
|
|
cc_binary_host {
|
|
|
|
name: "fs_config",
|
|
|
|
srcs: ["fs_config.c"],
|
|
|
|
shared_libs: [
|
|
|
|
"libcutils",
|
|
|
|
"libselinux",
|
|
|
|
],
|
|
|
|
cflags: ["-Werror"],
|
|
|
|
}
|
2019-04-10 21:25:07 +02:00
|
|
|
|
|
|
|
target_fs_config_gen_filegroup {
|
|
|
|
name: "target_fs_config_gen",
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "oemaids_header_gen",
|
|
|
|
tool_files: ["fs_config_generator.py"],
|
2019-04-18 19:10:34 +02:00
|
|
|
cmd: "$(location fs_config_generator.py) oemaid --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
2019-04-10 21:25:07 +02:00
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["generated_oem_aid.h"],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_headers {
|
|
|
|
name: "oemaids_headers",
|
2020-02-18 10:23:22 +01:00
|
|
|
vendor_available: true,
|
2019-04-10 21:25:07 +02:00
|
|
|
generated_headers: ["oemaids_header_gen"],
|
|
|
|
export_generated_headers: ["oemaids_header_gen"],
|
|
|
|
}
|
|
|
|
|
2019-07-12 00:31:36 +02:00
|
|
|
// Generate the */etc/passwd text files for the target
|
|
|
|
// These files may be empty if no AIDs are defined in
|
2019-04-10 21:25:07 +02:00
|
|
|
// TARGET_FS_CONFIG_GEN files.
|
|
|
|
genrule {
|
2019-07-12 00:31:36 +02:00
|
|
|
name: "passwd_gen_system",
|
2019-04-10 21:25:07 +02:00
|
|
|
tool_files: ["fs_config_generator.py"],
|
2019-07-12 00:31:36 +02:00
|
|
|
cmd: "$(location fs_config_generator.py) passwd --partition=system --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
2019-04-10 21:25:07 +02:00
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["passwd"],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
2019-07-12 00:31:36 +02:00
|
|
|
name: "passwd_system",
|
|
|
|
filename: "passwd",
|
|
|
|
src: ":passwd_gen_system",
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "passwd_gen_vendor",
|
|
|
|
tool_files: ["fs_config_generator.py"],
|
|
|
|
cmd: "$(location fs_config_generator.py) passwd --partition=vendor --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["passwd"],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "passwd_vendor",
|
|
|
|
filename: "passwd",
|
2019-04-10 21:25:07 +02:00
|
|
|
vendor: true,
|
2019-07-12 00:31:36 +02:00
|
|
|
src: ":passwd_gen_vendor",
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "passwd_gen_odm",
|
|
|
|
tool_files: ["fs_config_generator.py"],
|
|
|
|
cmd: "$(location fs_config_generator.py) passwd --partition=odm --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["passwd"],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "passwd_odm",
|
|
|
|
filename: "passwd",
|
|
|
|
device_specific: true,
|
|
|
|
src: ":passwd_gen_odm",
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "passwd_gen_product",
|
|
|
|
tool_files: ["fs_config_generator.py"],
|
|
|
|
cmd: "$(location fs_config_generator.py) passwd --partition=product --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["passwd"],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "passwd_product",
|
|
|
|
filename: "passwd",
|
|
|
|
product_specific: true,
|
|
|
|
src: ":passwd_gen_product",
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "passwd_gen_system_ext",
|
|
|
|
tool_files: ["fs_config_generator.py"],
|
|
|
|
cmd: "$(location fs_config_generator.py) passwd --partition=system_ext --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["passwd"],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "passwd_system_ext",
|
|
|
|
filename: "passwd",
|
|
|
|
system_ext_specific: true,
|
|
|
|
src: ":passwd_gen_system_ext",
|
2019-04-10 21:25:07 +02:00
|
|
|
}
|
|
|
|
|
2019-07-12 00:31:36 +02:00
|
|
|
// Generate the */etc/group text files for the target
|
|
|
|
// These files may be empty if no AIDs are defined in
|
2019-04-10 21:25:07 +02:00
|
|
|
// TARGET_FS_CONFIG_GEN files.
|
|
|
|
genrule {
|
2019-07-12 00:31:36 +02:00
|
|
|
name: "group_gen_system",
|
2019-04-10 21:25:07 +02:00
|
|
|
tool_files: ["fs_config_generator.py"],
|
2019-07-12 00:31:36 +02:00
|
|
|
cmd: "$(location fs_config_generator.py) group --partition=system --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
2019-04-10 21:25:07 +02:00
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["group"],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
2019-07-12 00:31:36 +02:00
|
|
|
name: "group_system",
|
|
|
|
filename: "group",
|
|
|
|
src: ":group_gen_system",
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "group_gen_vendor",
|
|
|
|
tool_files: ["fs_config_generator.py"],
|
|
|
|
cmd: "$(location fs_config_generator.py) group --partition=vendor --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["group"],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "group_vendor",
|
|
|
|
filename: "group",
|
2019-04-10 21:25:07 +02:00
|
|
|
vendor: true,
|
2019-07-12 00:31:36 +02:00
|
|
|
src: ":group_gen_vendor",
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "group_gen_odm",
|
|
|
|
tool_files: ["fs_config_generator.py"],
|
|
|
|
cmd: "$(location fs_config_generator.py) group --partition=odm --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["group"],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "group_odm",
|
|
|
|
filename: "group",
|
|
|
|
device_specific: true,
|
|
|
|
src: ":group_gen_odm",
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "group_gen_product",
|
|
|
|
tool_files: ["fs_config_generator.py"],
|
|
|
|
cmd: "$(location fs_config_generator.py) group --partition=product --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["group"],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "group_product",
|
|
|
|
filename: "group",
|
|
|
|
product_specific: true,
|
|
|
|
src: ":group_gen_product",
|
|
|
|
}
|
|
|
|
|
|
|
|
genrule {
|
|
|
|
name: "group_gen_system_ext",
|
|
|
|
tool_files: ["fs_config_generator.py"],
|
|
|
|
cmd: "$(location fs_config_generator.py) group --partition=system_ext --aid-header=$(location :android_filesystem_config_header) $(locations :target_fs_config_gen) >$(out)",
|
|
|
|
srcs: [
|
|
|
|
":target_fs_config_gen",
|
|
|
|
":android_filesystem_config_header",
|
|
|
|
],
|
|
|
|
out: ["group"],
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "group_system_ext",
|
|
|
|
filename: "group",
|
|
|
|
system_ext_specific: true,
|
|
|
|
src: ":group_gen_system_ext",
|
2019-04-10 21:25:07 +02:00
|
|
|
}
|