diff options
author | 2024-10-14 21:41:06 +0000 | |
---|---|---|
committer | 2024-10-14 21:41:06 +0000 | |
commit | 86a2d548394059cd88de6c8e912bae72624151d4 (patch) | |
tree | 4a1db0a74abc07bb052778cb88d2a05c8c5d0600 /filesystem/filesystem.go | |
parent | c71b175e6c3d6e7223c5c30b305659cce15b68c0 (diff) | |
parent | 7a46f6c4247a912ed4cb21e1cabeda6ff67b9c23 (diff) |
Merge "Reland "Create an empty system_ext partition for aosp_cf_*"" into main
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r-- | filesystem/filesystem.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 1e816a752..8c59df371 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 @@ -217,11 +220,19 @@ func (f *filesystem) fsType(ctx android.ModuleContext) fsType { case "cpio": return cpioType default: - ctx.PropertyErrorf("type", "%q not supported", typeStr) return unknown } } +func (f *filesystem) fsType(ctx android.ModuleContext) fsType { + typeStr := proptools.StringDefault(f.properties.Type, "ext4") + fsType := GetFsTypeFromString(ctx, typeStr) + if fsType == unknown { + ctx.PropertyErrorf("type", "%q not supported", typeStr) + } + return fsType +} + func (f *filesystem) installFileName() string { return f.BaseModuleName() + ".img" } |