mirror of https://github.com/acidanthera/audk.git
OvmfPkg: add PcdEntryPointOverrideDefaultValue
UefiDriverEntryPointFwCfgOverrideLib will use PcdEntryPointOverrideDefaultValue to decide what to do in case the fw_cfg file specified via PcdEntryPointOverrideFwCfgVarName is not present. Default is "yes". This allows to disable drivers by default and only enable them when requested via fw_cfg. Also log a message with the config option applied and whenever the default value or a fw_cfg option was used. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
9ca29831f6
commit
645988d9b3
|
@ -120,7 +120,20 @@ _ModuleEntryPoint (
|
|||
FixedPcdGetPtr (PcdEntryPointOverrideFwCfgVarName),
|
||||
&Enabled
|
||||
);
|
||||
if (!RETURN_ERROR (RetStatus) && !Enabled) {
|
||||
|
||||
if (RETURN_ERROR (RetStatus)) {
|
||||
Enabled = AsciiStrCmp (FixedPcdGetPtr (PcdEntryPointOverrideDefaultValue), "yes") == 0;
|
||||
}
|
||||
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"EntryPointFwCfgOverride: %a = %a (%a)\n",
|
||||
FixedPcdGetPtr (PcdEntryPointOverrideFwCfgVarName),
|
||||
Enabled ? "enabled" : "disabled",
|
||||
RETURN_ERROR (RetStatus) ? "default" : "fw_cfg"
|
||||
));
|
||||
|
||||
if (!Enabled) {
|
||||
//
|
||||
// The QEMU fw_cfg variable tells us not to load this image. So abort.
|
||||
//
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
[FixedPcd]
|
||||
gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideFwCfgVarName
|
||||
gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideDefaultValue
|
||||
|
||||
#
|
||||
# For UEFI drivers, these architectural protocols defined in PI 1.0 spec need
|
||||
|
|
|
@ -346,6 +346,10 @@
|
|||
# check to decide whether to abort dispatch of the driver it is linked into.
|
||||
gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideFwCfgVarName|""|VOID*|0x68
|
||||
|
||||
## The default value UefiDriverEntryPointFwCfgOverrideLib will use in case
|
||||
# the QEMU fw_cfg variable is not present
|
||||
gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideDefaultValue|"yes"|VOID*|0x76
|
||||
|
||||
## Restrict boot to EFI applications in firmware volumes.
|
||||
gUefiOvmfPkgTokenSpaceGuid.PcdBootRestrictToFirmware|FALSE|BOOLEAN|0x6c
|
||||
|
||||
|
|
Loading…
Reference in New Issue