Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3c8ddf7 authored by mrziwang's avatar mrziwang
Browse files

Change SuperImageProperties.Block_devices to be a slice of string

There are some products have empty BOARD_SUPER_PARTITION_BLOCK_DEVICES,
which is valid. But the previous super image logic didn't handle
it correctly. This CL fixes the issue.

Test: CI and verified on the product that has PRODUCT_BUILD_SUPER_PARTITION
      true and empty BOARD_SUPER_PARTITION_BLOCK_DEVICES
Change-Id: I761848ce6abc3f75a5b2083b79008f236e08b4fb
parent d2505873
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ type SuperImageProperties struct {
	// the block device where metadata for dynamic partitions is stored
	Metadata_device *string
	// the super partition block device list
	Block_devices *string
	Block_devices []string
	// whether A/B updater is used
	Ab_update *bool
	// whether dynamic partitions is enabled on devices that were launched without this support
@@ -153,7 +153,9 @@ func (s *superImage) buildMiscInfo(ctx android.ModuleContext) (android.Path, and
	addStr("dynamic_partition_retrofit", strconv.FormatBool(proptools.Bool(s.properties.Retrofit)))
	addStr("lpmake", "lpmake")
	addStr("super_metadata_device", proptools.String(s.properties.Metadata_device))
	addStr("super_block_devices", proptools.String(s.properties.Block_devices))
	if len(s.properties.Block_devices) > 0 {
		addStr("super_block_devices", strings.Join(s.properties.Block_devices, " "))
	}
	addStr("super_super_device_size", strconv.Itoa(proptools.Int(s.properties.Size)))
	var groups, partitionList []string
	for _, groupInfo := range s.properties.Partition_groups {
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ func createSuperImage(ctx android.LoadHookContext, partitions []string, partitio

	superImageProps := &filesystem.SuperImageProperties{
		Metadata_device:        proptools.StringPtr(partitionVars.BoardSuperPartitionMetadataDevice),
		Block_devices:          proptools.StringPtr(partitionVars.BoardSuperPartitionBlockDevices[0]),
		Block_devices:          partitionVars.BoardSuperPartitionBlockDevices,
		Ab_update:              proptools.BoolPtr(partitionVars.AbOtaUpdater),
		Retrofit:               proptools.BoolPtr(partitionVars.ProductRetrofitDynamicPartitions),
		Virtual_ab:             proptools.BoolPtr(partitionVars.ProductVirtualAbOta),