Fix missing avb keys

Previously we were using the "specific" board avb key path, but it's
actually common for the partition-specific avb key to not be set and
instead fall back to the global avb key. Add that fallback to the
global avb key.

Also, now that we're properly using the keys, generate filegroups
for the keys as they're often in a different folder. Also use
pre-existing filegroups where possible.

Bug: 377563298
Test: m product_config_to_bp and check the generated bp file for avb keys
Change-Id: Iafef06b95c895c47d5b55c8aef2061a636754b28
diff --git a/fsgen/fsgen_mutators.go b/fsgen/fsgen_mutators.go
index f6fe7c4..7b30264 100644
--- a/fsgen/fsgen_mutators.go
+++ b/fsgen/fsgen_mutators.go
@@ -68,6 +68,8 @@
 	moduleToInstallationProps map[string]installationProperties
 	// List of prebuilt_* modules that are autogenerated.
 	generatedPrebuiltEtcModuleNames []string
+	// Mapping from a path to an avb key to the name of a filegroup module that contains it
+	avbKeyFilegroups map[string]string
 }
 
 type installationProperties struct {
@@ -179,6 +181,7 @@
 			fsDepsMutex:                     sync.Mutex{},
 			moduleToInstallationProps:       map[string]installationProperties{},
 			generatedPrebuiltEtcModuleNames: generatedPrebuiltEtcModuleNames,
+			avbKeyFilegroups:                map[string]string{},
 		}
 
 		if avbpubkeyGenerated {