summaryrefslogtreecommitdiff
path: root/filesystem/system_image.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2024-11-12 20:00:12 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-11-12 20:00:12 +0000
commitf1c83ad42b4fb8f1ec875d580605b25e8cb3209c (patch)
tree8e4f725daa366cb6256d202b5ab65b5fe0f05107 /filesystem/system_image.go
parent229ef6d20fc044ac3a8848682ecc3e6dbf8611d6 (diff)
parent3c0a042d2056f35ffa7859c72d0aea1c9592e449 (diff)
Merge "Add GSI support for android_system_image" into main
Diffstat (limited to 'filesystem/system_image.go')
-rw-r--r--filesystem/system_image.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/filesystem/system_image.go b/filesystem/system_image.go
index 672458c53..4d176ae45 100644
--- a/filesystem/system_image.go
+++ b/filesystem/system_image.go
@@ -18,6 +18,9 @@ import (
"android/soong/android"
"android/soong/linkerconfig"
+ "path/filepath"
+ "strings"
+
"github.com/google/blueprint/proptools"
)
@@ -58,5 +61,14 @@ func (s *systemImage) BuildLinkerConfigFile(ctx android.ModuleContext, builder *
// for symbol lookup by imitating "activated" paths.
func (s *systemImage) FilterPackagingSpec(ps android.PackagingSpec) bool {
return !ps.SkipInstall() &&
- (ps.Partition() == "system" || ps.Partition() == "root")
+ (ps.Partition() == "system" || ps.Partition() == "root" ||
+ strings.HasPrefix(ps.Partition(), "system/"))
+}
+
+func (s *systemImage) ModifyPackagingSpec(ps *android.PackagingSpec) {
+ if strings.HasPrefix(ps.Partition(), "system/") {
+ subPartition := strings.TrimPrefix(ps.Partition(), "system/")
+ ps.SetPartition("system")
+ ps.SetRelPathInPackage(filepath.Join(subPartition, ps.RelPathInPackage()))
+ }
}