Thanks for the patch! Reviewed-By: Samer El-Haj-Mahmoud <samer.el-haj-mahm...@arm.com>
> -----Original Message----- > From: Grzegorz Bernacki <g...@semihalf.com> > Sent: Wednesday, August 18, 2021 3:38 AM > To: devel@edk2.groups.io > Cc: l...@nuviainc.com; ardb+tianoc...@kernel.org; Samer El-Haj-Mahmoud > <samer.el-haj-mahm...@arm.com>; Sunny Wang > <sunny.w...@arm.com>; m...@semihalf.com; upstr...@semihalf.com; > p...@akeo.ie; Grzegorz Bernacki <g...@semihalf.com> > Subject: [edk2-platforms PATCH] Platform/RaspberryPi: Check for Boot > Discovery Policy change. > > This patch adds checks if Boot Discovery Policy has been > changed. Only in that case EfiBootManagerRefreshAllBootOption() > should be called. > > Signed-off-by: Grzegorz Bernacki <g...@semihalf.com> > --- > Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c | 24 > +++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > > diff --git > a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > index c8305ce4f5..378ba0ebf4 100644 > --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c > @@ -617,6 +617,7 @@ BootDiscoveryPolicyHandler ( > { > EFI_STATUS Status; > UINT32 DiscoveryPolicy; > + UINT32 DiscoveryPolicyOld; > UINTN Size; > EFI_BOOT_MANAGER_POLICY_PROTOCOL *BMPolicy; > EFI_GUID *Class; > @@ -678,7 +679,28 @@ BootDiscoveryPolicyHandler ( > return Status; > } > > - EfiBootManagerRefreshAllBootOption(); > + // > + // Refresh Boot Options if Boot Discovery Policy has been changed > + // > + Size = sizeof (DiscoveryPolicyOld); > + Status = gRT->GetVariable ( > + BOOT_DISCOVERY_POLICY_OLD_VAR, > + &gBootDiscoveryPolicyMgrFormsetGuid, > + NULL, > + &Size, > + &DiscoveryPolicyOld > + ); > + if ((Status == EFI_NOT_FOUND) || (DiscoveryPolicyOld != DiscoveryPolicy)) > { > + EfiBootManagerRefreshAllBootOption(); > + > + Status = gRT->SetVariable ( > + BOOT_DISCOVERY_POLICY_OLD_VAR, > + &gBootDiscoveryPolicyMgrFormsetGuid, > + EFI_VARIABLE_NON_VOLATILE | > EFI_VARIABLE_BOOTSERVICE_ACCESS, > + sizeof (DiscoveryPolicyOld), > + &DiscoveryPolicy > + ); > + } > > return EFI_SUCCESS; > } > -- > 2.25.1 IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#79509): https://edk2.groups.io/g/devel/message/79509 Mute This Topic: https://groups.io/mt/84967553/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-