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

Commit 6850d8f8 authored by Jihoon Kang's avatar Jihoon Kang
Browse files

Set build_logtags true for system partition

This enables etc/event-log-tag file to be installed for the soong
generated system partition.

This change also introduces `partitionSpecificFilesystemProps` to
improve readability.

Test: run diff test and observe etc/event-log-tag is removed from the diff
Bug: 374132914
Change-Id: Id4a084431ccb4644e3ac6c9248c7993d1a75158f
parent 130cbf6f
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -331,10 +331,18 @@ func (f *filesystemCreator) createDeviceModule(ctx android.LoadHookContext) {
	ctx.CreateModule(filesystem.AndroidDeviceFactory, baseProps, partitionProps)
}

var (
	// https://source.corp.google.com/h/googleplex-android/platform/build/+/639d79f5012a6542ab1f733b0697db45761ab0f3:core/packaging/flags.mk;l=21;drc=5ba8a8b77507f93aa48cc61c5ba3f31a4d0cbf37;bpv=1;bpt=0
	partitionsWithAconfig = []string{"system", "product", "vendor"}
)
func partitionSpecificFsProps(fsProps *filesystem.FilesystemProperties, partitionType string) {
	switch partitionType {
	case "system":
		fsProps.Build_logtags = proptools.BoolPtr(true)
		// https://source.corp.google.com/h/googleplex-android/platform/build//639d79f5012a6542ab1f733b0697db45761ab0f3:core/packaging/flags.mk;l=21;drc=5ba8a8b77507f93aa48cc61c5ba3f31a4d0cbf37;bpv=1;bpt=0
		fsProps.Gen_aconfig_flags_pb = proptools.BoolPtr(true)
	case "product":
		fsProps.Gen_aconfig_flags_pb = proptools.BoolPtr(true)
	case "vendor":
		fsProps.Gen_aconfig_flags_pb = proptools.BoolPtr(true)
	}
}

// Creates a soong module to build the given partition. Returns false if we can't support building
// it.
@@ -381,8 +389,6 @@ func (f *filesystemCreator) createPartition(ctx android.LoadHookContext, partiti

	fsProps.Base_dir = proptools.StringPtr(partitionType)

	fsProps.Gen_aconfig_flags_pb = proptools.BoolPtr(android.InList(partitionType, partitionsWithAconfig))

	fsProps.Is_auto_generated = proptools.BoolPtr(true)

	// Identical to that of the generic_system_image
@@ -396,6 +402,8 @@ func (f *filesystemCreator) createPartition(ctx android.LoadHookContext, partiti
		"framework/oat/*/*", // framework/oat/{arch}
	}

	partitionSpecificFsProps(fsProps, partitionType)

	// system_image properties that are not set:
	// - filesystemProperties.Avb_hash_algorithm
	// - filesystemProperties.File_contexts