Build ramdisk with soong
This is the first step to build the ramdisk, it still has some diffs
with with the make-generated ramdisk though.
Bug: 378146476
Test: m soong_generated_ramdisk_filesystem_test
Change-Id: I767ea9d09e4d6413c2ec5af3120595e2001c9bb7
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index d9b2973..660328f 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -421,13 +421,20 @@
fsProps := &filesystem.FilesystemProperties{}
partitionVars := ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse
- specificPartitionVars := partitionVars.PartitionQualifiedVariables[partitionType]
-
- // BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE
- fsType := specificPartitionVars.BoardFileSystemType
+ var specificPartitionVars android.PartitionQualifiedVariablesType
+ var boardAvbEnable bool
+ var fsType string
+ if strings.Contains(partitionType, "ramdisk") {
+ fsType = "compressed_cpio"
+ } else {
+ specificPartitionVars = partitionVars.PartitionQualifiedVariables[partitionType]
+ boardAvbEnable = partitionVars.BoardAvbEnable
+ fsType = specificPartitionVars.BoardFileSystemType
+ }
if fsType == "" {
fsType = "ext4" //default
}
+
fsProps.Type = proptools.StringPtr(fsType)
if filesystem.GetFsTypeFromString(ctx, *fsProps.Type).IsUnknown() {
// Currently the android_filesystem module type only supports a handful of FS types like ext4, erofs
@@ -439,7 +446,7 @@
fsProps.Unchecked_module = proptools.BoolPtr(true)
// BOARD_AVB_ENABLE
- fsProps.Use_avb = proptools.BoolPtr(partitionVars.BoardAvbEnable)
+ fsProps.Use_avb = proptools.BoolPtr(boardAvbEnable)
// BOARD_AVB_KEY_PATH
fsProps.Avb_private_key = proptools.StringPtr(specificPartitionVars.BoardAvbKeyPath)
// BOARD_AVB_ALGORITHM