diff mbox series

[v2] package/uboot-tools: fix dumpimage for FIT image

Message ID 20220815.100252.228788492467122600.atsushi.nemoto@sord.co.jp
State Accepted
Headers show
Series [v2] package/uboot-tools: fix dumpimage for FIT image | expand

Commit Message

Atsushi Nemoto Aug. 15, 2022, 1:02 a.m. UTC
The upstream commit 7a01882eb37e7504e2450f474d0cc8db60ed26c2
("common: Kconfig.boot: Add FIT_PRINT config option") introduce
CONFIG_FIT_PRINT and make fit_print_contents() empty if it was
not enabled.

Adding CONFIG_FIT_PRINT=y to UBOOT_TOOLS_MAKE_OPTS does not help
while CONFIG_FIT_PRINT=y affects Makefiles only, not C sources.

Add "#define CONFIG_FIT_PRINT 1" to autoconf.h if FIT_SUPPORT enabled.

Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
---
Backport to: 2022.02.x, 2022.05.x
Change from v1: Describe why not add CONFIG_FIT_PRINT=y
---
 package/uboot-tools/uboot-tools.mk | 2 ++
 1 file changed, 2 insertions(+)

Comments

Arnout Vandecappelle Aug. 24, 2022, 8:07 p.m. UTC | #1
On 15/08/2022 03:02, Atsushi Nemoto wrote:
> The upstream commit 7a01882eb37e7504e2450f474d0cc8db60ed26c2
> ("common: Kconfig.boot: Add FIT_PRINT config option") introduce
> CONFIG_FIT_PRINT and make fit_print_contents() empty if it was
> not enabled.
> 
> Adding CONFIG_FIT_PRINT=y to UBOOT_TOOLS_MAKE_OPTS does not help
> while CONFIG_FIT_PRINT=y affects Makefiles only, not C sources.
> 
> Add "#define CONFIG_FIT_PRINT 1" to autoconf.h if FIT_SUPPORT enabled.

  This is getting quicky kludgy. It would be better to convert the package to 
kconfig-package infra so we can use KCONFIG_ENABLE_OPT for this.

  However, that's a much bigger change, which would not be suitable for 
backporting to the stable branches. Therefore, applied to master, thanks.

  If you could look into converting uboot-tools to kconfig infra, that would be 
nice. It's going to be tricky, though. I don't think we have any example at the 
moment where we don't have a user-provided config or defconfig to start from. In 
addition, we currently don't have host-kconfig-package.

  Regards,
  Arnout

> 
> Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
> ---
> Backport to: 2022.02.x, 2022.05.x
> Change from v1: Describe why not add CONFIG_FIT_PRINT=y
> ---
>   package/uboot-tools/uboot-tools.mk | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
> index 7cd527ad12..d884a010fb 100644
> --- a/package/uboot-tools/uboot-tools.mk
> +++ b/package/uboot-tools/uboot-tools.mk
> @@ -22,6 +22,7 @@ define UBOOT_TOOLS_CONFIGURE_CMDS
>   	touch $(@D)/include/config/auto.conf
>   	mkdir -p $(@D)/include/generated
>   	touch $(@D)/include/generated/autoconf.h
> +	echo $(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),'#define CONFIG_FIT_PRINT 1') >> $(@D)/include/generated/autoconf.h
>   	mkdir -p $(@D)/include/asm
>   	touch $(@D)/include/asm/linkage.h
>   endef
> @@ -111,6 +112,7 @@ define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
>   	touch $(@D)/include/config/auto.conf
>   	mkdir -p $(@D)/include/generated
>   	touch $(@D)/include/generated/autoconf.h
> +	echo $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),'#define CONFIG_FIT_PRINT 1') >> $(@D)/include/generated/autoconf.h
>   	mkdir -p $(@D)/include/asm
>   	touch $(@D)/include/asm/linkage.h
>   endef
Peter Korsgaard Sept. 17, 2022, 3:23 p.m. UTC | #2
>>>>> "Atsushi" == Atsushi Nemoto <atsushi.nemoto@sord.co.jp> writes:

 > The upstream commit 7a01882eb37e7504e2450f474d0cc8db60ed26c2
 > ("common: Kconfig.boot: Add FIT_PRINT config option") introduce
 > CONFIG_FIT_PRINT and make fit_print_contents() empty if it was
 > not enabled.

 > Adding CONFIG_FIT_PRINT=y to UBOOT_TOOLS_MAKE_OPTS does not help
 > while CONFIG_FIT_PRINT=y affects Makefiles only, not C sources.

 > Add "#define CONFIG_FIT_PRINT 1" to autoconf.h if FIT_SUPPORT enabled.

 > Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
 > ---
 > Backport to: 2022.02.x, 2022.05.x
 > Change from v1: Describe why not add CONFIG_FIT_PRINT=y

Committed to 2022.05.x and 2022.02.x, thanks.
diff mbox series

Patch

diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index 7cd527ad12..d884a010fb 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -22,6 +22,7 @@  define UBOOT_TOOLS_CONFIGURE_CMDS
 	touch $(@D)/include/config/auto.conf
 	mkdir -p $(@D)/include/generated
 	touch $(@D)/include/generated/autoconf.h
+	echo $(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),'#define CONFIG_FIT_PRINT 1') >> $(@D)/include/generated/autoconf.h
 	mkdir -p $(@D)/include/asm
 	touch $(@D)/include/asm/linkage.h
 endef
@@ -111,6 +112,7 @@  define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
 	touch $(@D)/include/config/auto.conf
 	mkdir -p $(@D)/include/generated
 	touch $(@D)/include/generated/autoconf.h
+	echo $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),'#define CONFIG_FIT_PRINT 1') >> $(@D)/include/generated/autoconf.h
 	mkdir -p $(@D)/include/asm
 	touch $(@D)/include/asm/linkage.h
 endef