[PATCH 10/12] UefiPayloadPkg: Add macro to disable some drivers


Guo Dong
 

+ DEFINE DISABLE_VARIABLE = FALSE
Could you change this MACRO definition as below to specifically disable EMU variable?
DEFINE EMU_VARIABLE_ENABLE = FALSE

This way, late we could enable other variable drivers (e.g. SMM variable) in UEFI payload.

Thanks,
Guo

-----Original Message-----
From: Liu, Zhiguang <zhiguang.liu@intel.com>
Sent: Sunday, June 20, 2021 8:47 AM
To: devel@edk2.groups.io
Cc: Ma, Maurice <maurice.ma@intel.com>; Dong, Guo
<guo.dong@intel.com>; You, Benjamin <benjamin.you@intel.com>
Subject: [PATCH 10/12] UefiPayloadPkg: Add macro to disable some drivers

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
UefiPayloadPkg/UefiPayloadPkg.dsc | 11 ++++++++++-
UefiPayloadPkg/UefiPayloadPkg.fdf | 7 +++++++
2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 155aea4bc4..99b0e49d46 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -87,6 +87,12 @@
#

DEFINE SHELL_TYPE = BUILD_SHELL



+ #

+ # Disable features

+ #

+ DEFINE DISABLE_VARIABLE = FALSE

+ DEFINE DISABLE_RESET_SYSTEM = FALSE

+

[BuildOptions]

*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG

@@ -431,10 +437,13 @@
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf

MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf


MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCoun
terRuntimeDxe.inf

+!if $(DISABLE_RESET_SYSTEM) == FALSE


MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntime
Dxe.inf

+!endif


PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntime
Dxe.inf

+!if $(DISABLE_VARIABLE) == FALSE

MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf

-

+!endif

#

# Following are the DXE drivers

#

diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf
b/UefiPayloadPkg/UefiPayloadPkg.fdf
index 6073f9c1b4..3b6adc2cfe 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -105,9 +105,16 @@ INF
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf

INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf

INF
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCoun
terRuntimeDxe.inf

+

+!if $(DISABLE_RESET_SYSTEM) == FALSE

INF
MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntime
Dxe.inf

+!endif

+

INF
PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntime
Dxe.inf

+

+!if $(DISABLE_VARIABLE) == FALSE

INF
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf

+!endif



INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf

INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf

--
2.16.2.windows.1


Zhiguang Liu
 

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
UefiPayloadPkg/UefiPayloadPkg.dsc | 11 ++++++++++-
UefiPayloadPkg/UefiPayloadPkg.fdf | 7 +++++++
2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload=
Pkg.dsc
index 155aea4bc4..99b0e49d46 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -87,6 +87,12 @@
#=0D
DEFINE SHELL_TYPE =3D BUILD_SHELL=0D
=0D
+ #=0D
+ # Disable features=0D
+ #=0D
+ DEFINE DISABLE_VARIABLE =3D FALSE=0D
+ DEFINE DISABLE_RESET_SYSTEM =3D FALSE=0D
+=0D
[BuildOptions]=0D
*_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES=
=0D
GCC:*_UNIXGCC_*_CC_FLAGS =3D -DMDEPKG_NDEBUG=0D
@@ -431,10 +437,13 @@
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf=0D
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf=0D
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntim=
eDxe.inf=0D
+!if $(DISABLE_RESET_SYSTEM) =3D=3D FALSE=0D
MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf=0D
+!endif=0D
PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.i=
nf=0D
+!if $(DISABLE_VARIABLE) =3D=3D FALSE=0D
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf=0D
-=0D
+!endif=0D
#=0D
# Following are the DXE drivers=0D
#=0D
diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayload=
Pkg.fdf
index 6073f9c1b4..3b6adc2cfe 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -105,9 +105,16 @@ INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTi=
mer.inf
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf=0D
INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf=0D
INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRunt=
imeDxe.inf=0D
+=0D
+!if $(DISABLE_RESET_SYSTEM) =3D=3D FALSE=0D
INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf=
=0D
+!endif=0D
+=0D
INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe=
.inf=0D
+=0D
+!if $(DISABLE_VARIABLE) =3D=3D FALSE=0D
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf=0D
+!endif=0D
=0D
INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf=0D
INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf=0D
--=20
2.16.2.windows.1