Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] boot/edk2: remove superfluous =TRUE in DEBUG_ON_SERIAL_PORT macro definition
@ 2023-07-24 17:24 Julien Olivain
  2023-07-28 20:26 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Julien Olivain @ 2023-07-24 17:24 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain

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 <ju.o@free.fr>
---
 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
-- 
2.41.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] boot/edk2: remove superfluous =TRUE in DEBUG_ON_SERIAL_PORT macro definition
  2023-07-24 17:24 [Buildroot] [PATCH 1/1] boot/edk2: remove superfluous =TRUE in DEBUG_ON_SERIAL_PORT macro definition Julien Olivain
@ 2023-07-28 20:26 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-07-28 20:26 UTC (permalink / raw)
  To: Julien Olivain; +Cc: buildroot

On Mon, 24 Jul 2023 19:24:26 +0200
Julien Olivain <ju.o@free.fr> wrote:

> 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 <ju.o@free.fr>
> ---
>  boot/edk2/edk2.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-28 20:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24 17:24 [Buildroot] [PATCH 1/1] boot/edk2: remove superfluous =TRUE in DEBUG_ON_SERIAL_PORT macro definition Julien Olivain
2023-07-28 20:26 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox