// If the number of configured boot options has changed, reboot\r
// the system so the new boot options will be taken into account\r
// while executing the ordinary BDS bootflow sequence.\r
+ // *Unless* persistent varstore is being emulated, since we would\r
+ // then end up in an endless reboot loop.\r
//\r
- if (NewBootOptionCount != OldBootOptionCount) {\r
- DEBUG ((DEBUG_WARN, "%a: rebooting after refreshing all boot options\n",\r
- __FUNCTION__));\r
- gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);\r
+ if (!PcdGetBool (PcdEmuVariableNvModeEnable)) {\r
+ if (NewBootOptionCount != OldBootOptionCount) {\r
+ DEBUG ((DEBUG_WARN, "%a: rebooting after refreshing all boot options\n",\r
+ __FUNCTION__));\r
+ gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);\r
+ }\r
}\r
\r
Status = EfiBootManagerGetBootManagerMenu (&BootManagerMenu);\r
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport\r
\r
[FixedPcd]\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits\r