Merge changes from topic "fdo_profile"
* changes: Reimplement afdo support for rust Implement fdo_profile module type
This commit is contained in:
@@ -1418,6 +1418,21 @@ func (c *deviceConfig) PgoAdditionalProfileDirs() []string {
|
||||
return c.config.productVariables.PgoAdditionalProfileDirs
|
||||
}
|
||||
|
||||
// AfdoProfile returns fully qualified path associated to the given module name
|
||||
func (c *deviceConfig) AfdoProfile(name string) (*string, error) {
|
||||
for _, afdoProfile := range c.config.productVariables.AfdoProfiles {
|
||||
split := strings.Split(afdoProfile, ":")
|
||||
if len(split) != 3 {
|
||||
return nil, fmt.Errorf("AFDO_PROFILES has invalid value: %s. "+
|
||||
"The expected format is <module>:<fully-qualified-path-to-fdo_profile>", afdoProfile)
|
||||
}
|
||||
if split[0] == name {
|
||||
return proptools.StringPtr(strings.Join([]string{split[1], split[2]}, ":")), nil
|
||||
}
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *deviceConfig) VendorSepolicyDirs() []string {
|
||||
return c.config.productVariables.BoardVendorSepolicyDirs
|
||||
}
|
||||
|
Reference in New Issue
Block a user