From efc456a762db406022537b696a1d6eae73880f9a Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Thu, 10 Oct 2024 21:24:34 +0000 Subject: 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 --- filesystem/filesystem.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'filesystem/filesystem.go') 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 { -- cgit v1.2.3-59-g8ed1b