diff options
| -rw-r--r-- | apex/apex.go | 8 | ||||
| -rw-r--r-- | apex/builder.go | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/apex/apex.go b/apex/apex.go index 0a785f3d0..cedc3b3b9 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -98,6 +98,14 @@ type apexBundleProperties struct { // /system/sepolicy/apex/<module_name>_file_contexts. File_contexts *string `android:"path"` + // Path to the canned fs config file for customizing file's uid/gid/mod/capabilities. The + // format is /<path_or_glob> <uid> <gid> <mode> [capabilities=0x<cap>], where path_or_glob is a + // path or glob pattern for a file or set of files, uid/gid are numerial values of user ID + // and group ID, mode is octal value for the file mode, and cap is hexadecimal value for the + // capability. If this property is not set, or a file is missing in the file, default config + // is used. + Canned_fs_config *string `android:"path"` + ApexNativeDependencies Multilib apexMultilibProperties diff --git a/apex/builder.go b/apex/builder.go index 787b2c4b0..ea25537ca 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -1067,6 +1067,11 @@ func (a *apexBundle) buildCannedFsConfig(ctx android.ModuleContext) android.Outp file := appSetFiles[dir] cmd.Text("zipinfo -1").Input(file).Textf(`| sed "s:\(.*\):/%s/\1 1000 1000 0644:";`, dir) } + // Custom fs_config is "appended" to the last so that entries from the file are preferred + // over default ones set above. + if a.properties.Canned_fs_config != nil { + cmd.Text("cat").Input(android.PathForModuleSrc(ctx, *a.properties.Canned_fs_config)) + } cmd.Text(")").FlagWithOutput("> ", cannedFsConfig) builder.Build("generateFsConfig", fmt.Sprintf("Generating canned fs config for %s", a.BaseModuleName())) |