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

Commit a8fa6b44 authored by Spandan Das's avatar Spandan Das
Browse files

Set Fsverity props conditionally

Only system and system_ext kati partitions have fsverity metadata.
system_ext also does not use etc/* pattern.
`fsverity-metadata-targets-patterns` in build/make/core/Makefile
contains all the patterns.

Test: Ran the diff test on system, system_ext and vendor locally
Change-Id: Id8cc3a06fc8d5663dea18c00f0a4f289d82d46b8
parent b70d6238
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
@@ -362,6 +362,24 @@ func partitionSpecificFsProps(fsProps *filesystem.FilesystemProperties, partitio
		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)
		// Identical to that of the generic_system_image
		fsProps.Fsverity.Inputs = []string{
			"etc/boot-image.prof",
			"etc/dirty-image-objects",
			"etc/preloaded-classes",
			"etc/classpaths/*.pb",
			"framework/*",
			"framework/*/*",     // framework/{arch}
			"framework/oat/*/*", // framework/oat/{arch}
		}
		fsProps.Fsverity.Libs = []string{":framework-res{.export-package.apk}"}
	case "system_ext":
		fsProps.Fsverity.Inputs = []string{
			"framework/*",
			"framework/*/*",     // framework/{arch}
			"framework/oat/*/*", // framework/oat/{arch}
		}
		fsProps.Fsverity.Libs = []string{":framework-res{.export-package.apk}"}
	case "product":
		fsProps.Gen_aconfig_flags_pb = proptools.BoolPtr(true)
	case "vendor":
@@ -441,18 +459,6 @@ func generateFsProps(ctx android.EarlyModuleContext, partitionType string) (*fil

	fsProps.Is_auto_generated = proptools.BoolPtr(true)

	// Identical to that of the generic_system_image
	fsProps.Fsverity.Inputs = []string{
		"etc/boot-image.prof",
		"etc/dirty-image-objects",
		"etc/preloaded-classes",
		"etc/classpaths/*.pb",
		"framework/*",
		"framework/*/*",     // framework/{arch}
		"framework/oat/*/*", // framework/oat/{arch}
	}
	fsProps.Fsverity.Libs = []string{":framework-res{.export-package.apk}"}

	partitionSpecificFsProps(fsProps, partitionType)

	// system_image properties that are not set: