Enforce adb_keys to be installed in product partition
adb_keys module type installs the output file into product partition
regardless of the partition specific property. To translate this logic
into product packaging with Soong, this change enforces adb_keys module
type to specify `product_specific` to true.
Test: m soong_generated_product_filesystem_test
Bug: 376515714
Change-Id: I23337f07b548caaf9361fbea525940394ffbcecc
diff --git a/etc/adb_keys.go b/etc/adb_keys.go
index a2df41c..73bc347 100644
--- a/etc/adb_keys.go
+++ b/etc/adb_keys.go
@@ -36,6 +36,11 @@
func (m *AdbKeysModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
productVariables := ctx.Config().ProductVariables()
+
+ if !m.ProductSpecific() {
+ ctx.ModuleErrorf("adb_keys module type must set product_specific to true")
+ }
+
if !(android.Bool(productVariables.Debuggable) && len(android.String(productVariables.AdbKeys)) > 0) {
m.SkipInstall()
return
@@ -48,7 +53,7 @@
Output: m.outputPath,
Input: input.Path(),
})
- m.installPath = android.PathForModuleInPartitionInstall(ctx, ctx.DeviceConfig().ProductPath(), "etc/security")
+ m.installPath = android.PathForModuleInstall(ctx, "etc/security")
ctx.InstallFile(m.installPath, "adb_keys", m.outputPath)
}