diff options
author | 2025-01-16 16:33:26 -0800 | |
---|---|---|
committer | 2025-01-16 16:36:58 -0800 | |
commit | b8e280f886c1095c8a7e35cf88c4265c2b55f173 (patch) | |
tree | a7c207608fc89aa8bd1625846d0e771d59a688b6 /filesystem/system_other.go | |
parent | 74ee4e0adc7fb37d648b86852cae93746556e02e (diff) |
Install odex/vdex files into soong-built system_other
This makes system_other almost identical to the make-built one,
but there's still a diff in just one file:
system_other/system/priv-app/CredentialManager/oat/x86_64/CredentialManager.art
Bug: 390269431
Test: m --soong-only
Change-Id: I440097cead56a20d0268f4e766ac1be8fe11b34b
Diffstat (limited to 'filesystem/system_other.go')
-rw-r--r-- | filesystem/system_other.go | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/filesystem/system_other.go b/filesystem/system_other.go index cad426337..28fe1ce49 100644 --- a/filesystem/system_other.go +++ b/filesystem/system_other.go @@ -49,7 +49,7 @@ type systemOtherImage struct { func SystemOtherImageFactory() android.Module { module := &systemOtherImage{} module.AddProperties(&module.properties) - android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon) + android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon) android.InitDefaultableModule(module) return module } @@ -89,14 +89,29 @@ func (m *systemOtherImage) GenerateAndroidBuildActions(ctx android.ModuleContext builder := android.NewRuleBuilder(pctx, ctx) builder.Command().Textf("rm -rf %s && mkdir -p %s", stagingDir, stagingDir) + specs := make(map[string]android.PackagingSpec) for _, otherPartition := range m.properties.Preinstall_dexpreopt_files_from { dexModule := ctx.GetDirectDepProxyWithTag(otherPartition, dexpreoptDependencyTag) - _, ok := android.OtherModuleProvider(ctx, dexModule, FilesystemProvider) + fsInfo, ok := android.OtherModuleProvider(ctx, dexModule, FilesystemProvider) if !ok { ctx.PropertyErrorf("preinstall_dexpreopt_files_from", "Expected module %q to provide FilesystemProvider", otherPartition) return } - // TODO(b/390269431): Install dex files to the staging dir + // Merge all the packaging specs into 1 map + for k := range fsInfo.SpecsForSystemOther { + if _, ok := specs[k]; ok { + ctx.ModuleErrorf("Packaging spec %s given by two different partitions", k) + continue + } + specs[k] = fsInfo.SpecsForSystemOther[k] + } + } + + // TOOD: CopySpecsToDir only exists on PackagingBase, but doesn't use any fields from it. Clean this up. + (&android.PackagingBase{}).CopySpecsToDir(ctx, builder, specs, stagingDir) + + if len(m.properties.Preinstall_dexpreopt_files_from) > 0 { + builder.Command().Textf("touch %s", filepath.Join(stagingDir.String(), "system-other-odex-marker")) } // Most of the time, if build_image were to call a host tool, it accepts the path to the |