From b21e072127c17f359f891b913fd6a294708aa4f4 Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Mon, 24 Jul 2023 19:24:26 +0200 Subject: [PATCH] boot/edk2: remove superfluous =TRUE in DEBUG_ON_SERIAL_PORT macro definition Commit 8e9c8e624f "boot/edk2: introduce a new _OVMF_DEBUG_ON_SERIAL option" adds a build macro definition with a "=TRUE" value. edk2 OVMF readme suggests to define the "DEBUG_ON_SERIAL_PORT" macro _without_ the "=TRUE" in [1]. The example build.sh script calls build to set the macro _with_ "=TRUE" in [2]. The "Build_Utility_Man_Page.rtf" documentation in [3] does not specify either what exactly happen when a macro is defined without any value. Looking at the "build.py" code in [4] shows that a macro definition of the form "-DMYMACRO" is indeed equivalent as "-DMYMACRO=TRUE". This was also tested with a qemu virt x86_64 grub2 EFI boot image, to verify behaviors remain the same. This commit removes the superfluous "=TRUE" as requested by Yann in [5]. Removing the "=TRUE" make it a bit clearer that it is the macro definition itself that will enable the feature, rather than its value. Defining, -DDEBUG_ON_SERIAL_PORT=FALSE (OFF, 0, or anything else that would suggest the feature is disabled) would do the opposite of the desired effect, and enable the feature. [1] https://github.com/tianocore/edk2/blob/edk2-stable202305/OvmfPkg/README#L95 [2] https://github.com/tianocore/edk2/blob/edk2-stable202305/OvmfPkg/build.sh#L252 [3] https://github.com/tianocore/edk2/tree/edk2-stable202305/BaseTools/UserManuals [4] https://github.com/tianocore/edk2/blob/edk2-stable202305/BaseTools/Source/Python/build/build.py#L2531 [5] https://lists.buildroot.org/pipermail/buildroot/2023-July/671059.html Signed-off-by: Julien Olivain Signed-off-by: Thomas Petazzoni --- boot/edk2/edk2.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/edk2/edk2.mk b/boot/edk2/edk2.mk index 95cbe415ef..f49258ecb5 100644 --- a/boot/edk2/edk2.mk +++ b/boot/edk2/edk2.mk @@ -19,7 +19,7 @@ EDK2_BUILD_TYPE = DEBUG ifeq ($(BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL),y) # DEBUG_ON_SERIAL_PORT is only tested to be set, so don't disable it, as # it would still be set. -EDK2_BUILD_OPTS += -DDEBUG_ON_SERIAL_PORT=TRUE +EDK2_BUILD_OPTS += -DDEBUG_ON_SERIAL_PORT endif else EDK2_BUILD_TYPE = RELEASE