summaryrefslogtreecommitdiff
path: root/filesystem/system_image.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2025-01-30 18:19:29 -0800
committer Cole Faust <colefaust@google.com> 2025-01-30 18:25:33 -0800
commit19fbb07dabf3a0a0836e6c4b36fd5584a2d1957b (patch)
tree7f1f86c7a22699a413cb8ad8f26f1d65a64dced7 /filesystem/system_image.go
parentb2edb9b111acb2a3ed932fcc41c842c46bf7a120 (diff)
Fix staging dir creation for adevice
Adevice does a `ninja -t inputs -i droid` and filters the results for out/target/product/ to find files in the staging directories. We were just copying the staging directories without creating ninja rules before, so that failed. Actually create the ninja rules. The rules are created in the android_device module instead of the filesystem so that if you have multiple filesystems, they don't create conflicting installation rules. We should provide a way for tools like adevice to query the build system for installed files, no matter where they are in the out/ dir, and use that to replace this logic. This cl produces the following diff in out/target/product compared to soong-only builds before this change: https://paste.googleplex.com/4624734193713152 It's mostly empty directories, which I don't think matter for adevice. Bug: 393464638 Bug: 392957226 Test: `m installclean && m && launch_cvd && adevice update` says the device is up-to-date. Change-Id: Ifb52aaf5bc3edd2e3900546bf9df73a52d1022c0
Diffstat (limited to 'filesystem/system_image.go')
-rw-r--r--filesystem/system_image.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/filesystem/system_image.go b/filesystem/system_image.go
index 874d20d80..cc9093f9b 100644
--- a/filesystem/system_image.go
+++ b/filesystem/system_image.go
@@ -44,7 +44,12 @@ func (s systemImage) FsProps() FilesystemProperties {
return s.filesystem.properties
}
-func (s *systemImage) BuildLinkerConfigFile(ctx android.ModuleContext, builder *android.RuleBuilder, rebasedDir android.OutputPath) {
+func (s *systemImage) BuildLinkerConfigFile(
+ ctx android.ModuleContext,
+ builder *android.RuleBuilder,
+ rebasedDir android.OutputPath,
+ fullInstallPaths *[]FullInstallPathInfo,
+) {
if !proptools.Bool(s.filesystem.properties.Linker_config.Gen_linker_config) {
return
}
@@ -55,6 +60,11 @@ func (s *systemImage) BuildLinkerConfigFile(ctx android.ModuleContext, builder *
intermediateOutput := android.PathForModuleOut(ctx, "linker.config.pb")
linkerconfig.BuildLinkerConfig(ctx, android.PathsForModuleSrc(ctx, s.filesystem.properties.Linker_config.Linker_config_srcs), provideModules, requireModules, intermediateOutput)
builder.Command().Text("cp").Input(intermediateOutput).Output(output)
+
+ *fullInstallPaths = append(*fullInstallPaths, FullInstallPathInfo{
+ FullInstallPath: android.PathForModuleInPartitionInstall(ctx, s.PartitionType(), "etc", "linker.config.pb"),
+ SourcePath: intermediateOutput,
+ })
} else {
// TODO: This branch is the logic that make uses for the linker config file, which is
// different than linkerconfig.BuildLinkerConfig used above. Keeping both branches for now
@@ -87,6 +97,11 @@ func (s *systemImage) BuildLinkerConfigFile(ctx android.ModuleContext, builder *
Implicit(llndkMovedToApexLibraries)
// TODO: Make also supports adding an extra append command with PRODUCT_EXTRA_STUB_LIBRARIES,
// but that variable appears to have no usages.
+
+ *fullInstallPaths = append(*fullInstallPaths, FullInstallPathInfo{
+ FullInstallPath: android.PathForModuleInPartitionInstall(ctx, s.PartitionType(), "etc", "linker.config.pb"),
+ SourcePath: output,
+ })
}
s.appendToEntry(ctx, output)