summaryrefslogtreecommitdiff
path: root/filesystem/system_image.go
diff options
context:
space:
mode:
author Inseob Kim <inseob@google.com> 2024-11-05 17:21:37 +0900
committer Inseob Kim <inseob@google.com> 2024-11-12 17:02:10 +0900
commit3c0a042d2056f35ffa7859c72d0aea1c9592e449 (patch)
tree4023a5bfa28def3935fbfa60a9d8c61113eed934 /filesystem/system_image.go
parent25777477593f60273be433e44ee9e49897bdab23 (diff)
Add GSI support for android_system_image
GSI's system.img includes system_ext and product artifacts. This patches android_system_image module so it can include such artifacts when building GSI. Bug: 370351758 Test: m android_gsi Change-Id: Id29678b1101e787e88dbedae38cdbf6d82d1cb95
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()))
+ }
}