diff mbox series

[U-Boot,1/2] Makefile: always preserve output for images that can contain HAB Blocks

Message ID 20180323110803.16512-1-rasmus.villemoes@prevas.dk
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show
Series [U-Boot,1/2] Makefile: always preserve output for images that can contain HAB Blocks | expand

Commit Message

Rasmus Villemoes March 23, 2018, 11:08 a.m. UTC
The current makefile logic disables creation of the
SPL.log/u-boot-ivt.img.log etc. files when V=1 is given on the command
line, the rationale presumably being that the user wants and gets the
information on the console.

However, from general principles, I don't think a higher V= level
should affect which build artifacts get generated (and certainly
shouldn't produce fewer). Concretely, it's also a problem that when
doing a V=1 build in a terminal, the relevant HAB blocks lines easily
drown in all the other V=1 output.

Moreover, build systems such as Yocto by default pass V=1, so in that
case the information gets hidden away in the do_compile log file, making
it nigh impossible to create a recipe for creating signed U-boot images
- I don't want to disable V=1, because having verbose output in the log
file is valuable when things go wrong, but OTOH trying to go digging in
the do_compile log file (and getting exactly the right lines) is not
pleasant to even think about.

So change the logic so that for V=0, the mkimage output is redirected
to MKIMAGEOUTPUT (which is also the current behaviour), while for any
other value of V, we _additionally_ write the information to make's
stdout, whatever that might be.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 Makefile             | 4 ++--
 scripts/Makefile.lib | 2 +-
 scripts/Makefile.spl | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Fabio Estevam March 23, 2018, 12:40 p.m. UTC | #1
[Adding Stefano and Tom]

On Fri, Mar 23, 2018 at 8:08 AM, Rasmus Villemoes
<rasmus.villemoes@prevas.dk> wrote:
> The current makefile logic disables creation of the
> SPL.log/u-boot-ivt.img.log etc. files when V=1 is given on the command
> line, the rationale presumably being that the user wants and gets the
> information on the console.
>
> However, from general principles, I don't think a higher V= level
> should affect which build artifacts get generated (and certainly
> shouldn't produce fewer). Concretely, it's also a problem that when
> doing a V=1 build in a terminal, the relevant HAB blocks lines easily
> drown in all the other V=1 output.
>
> Moreover, build systems such as Yocto by default pass V=1, so in that
> case the information gets hidden away in the do_compile log file, making
> it nigh impossible to create a recipe for creating signed U-boot images
> - I don't want to disable V=1, because having verbose output in the log
> file is valuable when things go wrong, but OTOH trying to go digging in
> the do_compile log file (and getting exactly the right lines) is not
> pleasant to even think about.
>
> So change the logic so that for V=0, the mkimage output is redirected
> to MKIMAGEOUTPUT (which is also the current behaviour), while for any
> other value of V, we _additionally_ write the information to make's
> stdout, whatever that might be.
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> ---
>  Makefile             | 4 ++--
>  scripts/Makefile.lib | 2 +-
>  scripts/Makefile.spl | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 5fa14789d9..a63dc96e57 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -845,11 +845,11 @@ MKIMAGEOUTPUT ?= /dev/null
>
>  quiet_cmd_mkimage = MKIMAGE $@
>  cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
> -       $(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT))
> +       >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
>
>  quiet_cmd_mkfitimage = MKIMAGE $@
>  cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(U_BOOT_ITS) -E $@ \
> -       $(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT))
> +       >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
>
>  quiet_cmd_cat = CAT     $@
>  cmd_cat = cat $(filter-out $(PHONY), $^) > $@
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 8f21653136..c6b3f69064 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -521,7 +521,7 @@ cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
>  MKIMAGEOUTPUT ?= /dev/null
>  quiet_cmd_mkimage = MKIMAGE $@
>  cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
> -       $(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT))
> +       >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
>
>  # fdtgrep
>  # ---------------------------------------------------------------------------
> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> index 2993ade41e..7f2908d799 100644
> --- a/scripts/Makefile.spl
> +++ b/scripts/Makefile.spl
> @@ -144,7 +144,7 @@ MKIMAGEOUTPUT ?= /dev/null
>
>  quiet_cmd_mkimage = MKIMAGE $@
>  cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
> -       $(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT))
> +       >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
>
>  MKIMAGEFLAGS_MLO = -T omapimage -a $(CONFIG_SPL_TEXT_BASE)
>
> --
> 2.15.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Breno Matheus Lima March 24, 2018, 10:13 p.m. UTC | #2
Hi All,

2018-03-23 8:08 GMT-03:00 Rasmus Villemoes <rasmus.villemoes@prevas.dk>:
> The current makefile logic disables creation of the
> SPL.log/u-boot-ivt.img.log etc. files when V=1 is given on the command
> line, the rationale presumably being that the user wants and gets the
> information on the console.
>
> However, from general principles, I don't think a higher V= level
> should affect which build artifacts get generated (and certainly
> shouldn't produce fewer). Concretely, it's also a problem that when
> doing a V=1 build in a terminal, the relevant HAB blocks lines easily
> drown in all the other V=1 output.
>
> Moreover, build systems such as Yocto by default pass V=1, so in that
> case the information gets hidden away in the do_compile log file, making
> it nigh impossible to create a recipe for creating signed U-boot images
> - I don't want to disable V=1, because having verbose output in the log
> file is valuable when things go wrong, but OTOH trying to go digging in
> the do_compile log file (and getting exactly the right lines) is not
> pleasant to even think about.
>
> So change the logic so that for V=0, the mkimage output is redirected
> to MKIMAGEOUTPUT (which is also the current behaviour), while for any
> other value of V, we _additionally_ write the information to make's
> stdout, whatever that might be.
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

Tested-by: Breno Lima <breno.lima@nxp.com>

Thanks,
Breno Lima
Stefano Babic April 15, 2018, 10:13 a.m. UTC | #3
On 24/03/2018 23:13, Breno Matheus Lima wrote:
> Hi All,
> 
> 2018-03-23 8:08 GMT-03:00 Rasmus Villemoes <rasmus.villemoes@prevas.dk>:
>> The current makefile logic disables creation of the
>> SPL.log/u-boot-ivt.img.log etc. files when V=1 is given on the command
>> line, the rationale presumably being that the user wants and gets the
>> information on the console.
>>
>> However, from general principles, I don't think a higher V= level
>> should affect which build artifacts get generated (and certainly
>> shouldn't produce fewer). Concretely, it's also a problem that when
>> doing a V=1 build in a terminal, the relevant HAB blocks lines easily
>> drown in all the other V=1 output.
>>
>> Moreover, build systems such as Yocto by default pass V=1, so in that
>> case the information gets hidden away in the do_compile log file, making
>> it nigh impossible to create a recipe for creating signed U-boot images
>> - I don't want to disable V=1, because having verbose output in the log
>> file is valuable when things go wrong, but OTOH trying to go digging in
>> the do_compile log file (and getting exactly the right lines) is not
>> pleasant to even think about.
>>
>> So change the logic so that for V=0, the mkimage output is redirected
>> to MKIMAGEOUTPUT (which is also the current behaviour), while for any
>> other value of V, we _additionally_ write the information to make's
>> stdout, whatever that might be.
>>
>> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> 
> Tested-by: Breno Lima <breno.lima@nxp.com>


Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 5fa14789d9..a63dc96e57 100644
--- a/Makefile
+++ b/Makefile
@@ -845,11 +845,11 @@  MKIMAGEOUTPUT ?= /dev/null
 
 quiet_cmd_mkimage = MKIMAGE $@
 cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
-	$(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT))
+	>$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
 
 quiet_cmd_mkfitimage = MKIMAGE $@
 cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(U_BOOT_ITS) -E $@ \
-	$(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT))
+	>$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
 
 quiet_cmd_cat = CAT     $@
 cmd_cat = cat $(filter-out $(PHONY), $^) > $@
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 8f21653136..c6b3f69064 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -521,7 +521,7 @@  cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
 MKIMAGEOUTPUT ?= /dev/null
 quiet_cmd_mkimage = MKIMAGE $@
 cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
-	$(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT))
+	>$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
 
 # fdtgrep
 # ---------------------------------------------------------------------------
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 2993ade41e..7f2908d799 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -144,7 +144,7 @@  MKIMAGEOUTPUT ?= /dev/null
 
 quiet_cmd_mkimage = MKIMAGE $@
 cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
-	$(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT))
+	>$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
 
 MKIMAGEFLAGS_MLO = -T omapimage -a $(CONFIG_SPL_TEXT_BASE)