summaryrefslogtreecommitdiff
path: root/android/config.go
diff options
context:
space:
mode:
author Jooyung Han <jooyung@google.com> 2024-11-15 12:50:50 +0900
committer Jooyung Han <jooyung@google.com> 2024-11-19 02:28:32 +0000
commit920809ad4bb6bd0f72f228c3020438f2e9cf5bbf (patch)
tree7c4402e8801e7ce01b0726182298b7b42ea7921a /android/config.go
parent098743d0972d8a414aaf4faf17f90cedc8cb7901 (diff)
Use PRODUCT variable for default payload fs type
ext4 was hard-coded, but now it can be configured with {OVERRIDE_}PRODUCT_DEFAULT_APEX_PAYLOAD_TYPE variables. Previously, it was hard-coded as 'ext4', which makes it difficult to use a different filesystem for apex payload: for example, erofs. Using erofs for apex payload can help to make apexes smaller on read-only partitions. (When testing with the cuttlefish, it was ~40% smaller for all apexes) This is more important for those devices using erofs on their read-only partitions (like system) because it's recommend to use "not compress .apex files" for erofs partitions (to open apex files with Direct-IO enabled). Besides, we want to make erofs as a default filesystem for apex payload. (and hopefully deprecate .capex) However, we will need to support ext4 apexes for those older devices especially for mainline modules. Hence, we need a way to switch the default filesystem type for apex payload. Bug: 377388109 Test: OVERRIDE_PRODUCT_DEFAULT_APEX_PAYLOAD_TYPE=erofs \ m com.android.runtime # The runtime APEX has erofs payload. Change-Id: Ia42ad913cdaeb52b5617f71017aca3b051a61508
Diffstat (limited to 'android/config.go')
-rw-r--r--android/config.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/android/config.go b/android/config.go
index 27d3b87ba..94285f822 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1834,6 +1834,10 @@ func (c *config) ApexCompressionEnabled() bool {
return Bool(c.productVariables.CompressedApex) && !c.UnbundledBuildApps()
}
+func (c *config) DefaultApexPayloadType() string {
+ return StringDefault(c.productVariables.DefaultApexPayloadType, "ext4")
+}
+
func (c *config) UseSoongSystemImage() bool {
return Bool(c.productVariables.UseSoongSystemImage)
}