Copy selinux_fc file to target_files.zip
This CL introduces a new field in FilesystemInfo with the selinux_fc
path of the filesystem(s). android_device will copy this file to the
META subdirectory of target_files.zip
Test: Built soong target_files.zip
Bug: 388633394
Change-Id: Ia81bd2c2d90d6beb116d57adf53deb5736579c3a
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 514fd28..eb967ad 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -454,6 +454,10 @@
abOtaKeysSorted := android.SortedUniqueStrings(a.deviceProps.Ab_ota_keys)
abOtaKeysSortedString := proptools.ShellEscape(strings.Join(abOtaKeysSorted, "\\n"))
builder.Command().Textf("echo -e").Flag(abOtaKeysSortedString).Textf(" > %s/META/otakeys.txt", targetFilesDir.String())
+ // selinuxfc
+ if a.getFsInfos(ctx)["system"].SelinuxFc != nil {
+ builder.Command().Textf("cp").Input(a.getFsInfos(ctx)["system"].SelinuxFc).Textf(" %s/META/file_contexts.bin", targetFilesDir.String())
+ }
}
}