summaryrefslogtreecommitdiff
path: root/filesystem/filesystem.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-10-10 21:24:34 +0000
committer Spandan Das <spandandas@google.com> 2024-10-10 23:28:40 +0000
commitefc456a762db406022537b696a1d6eae73880f9a (patch)
treef6005f2d998b3adc43fd615e897d35df27ed8aaa /filesystem/filesystem.go
parentc35d6fb14192ea72bae0177ae57a3a1d72384aca (diff)
Create an empty system_ext partition for aosp_cf_*
Cuttlefish uses erofs, which is now supported. With this CL, empty system and system_ext filesystem soong modules will be created This CL also makes ext4 the default fs. If `BOARD_$PARTITION_IMAGE_FILE_SYSTEM_TYPE` is empty, ext4 will be used. Bug: 372487849 Test: lunch aosp_cf_x86_64_phone-trunk_staging-userdebug && m nothing Test: verified that soong modules are created for system and system_ext Change-Id: Ib4eecb63e86a09a45853279c1afce5c26e5202d4
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r--filesystem/filesystem.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 87c6381c0..1ab07a2e7 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -198,6 +198,10 @@ const (
unknown
)
+func (fs fsType) IsUnknown() bool {
+ return fs == unknown
+}
+
type FilesystemInfo struct {
// A text file containing the list of paths installed on the partition.
FileListFile android.Path
@@ -205,8 +209,7 @@ type FilesystemInfo struct {
var FilesystemProvider = blueprint.NewProvider[FilesystemInfo]()
-func (f *filesystem) fsType(ctx android.ModuleContext) fsType {
- typeStr := proptools.StringDefault(f.properties.Type, "ext4")
+func GetFsTypeFromString(ctx android.EarlyModuleContext, typeStr string) fsType {
switch typeStr {
case "ext4":
return ext4Type
@@ -220,6 +223,11 @@ func (f *filesystem) fsType(ctx android.ModuleContext) fsType {
ctx.PropertyErrorf("type", "%q not supported", typeStr)
return unknown
}
+
+}
+
+func (f *filesystem) fsType(ctx android.ModuleContext) fsType {
+ return GetFsTypeFromString(ctx, proptools.StringDefault(f.properties.Type, "ext4"))
}
func (f *filesystem) installFileName() string {