Skip to contentSkip to conversation

Migrate IMAGE_FORMAT_LEGACY to Kconfig

RFC PATCH New Alex Kiernan 2 participants 6 messages Apr 19, 2018 – Apr 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Migrate IMAGE_FORMAT_LEGACY to Kconfig

On the face of it, this is a straightforward moveconfig, but because of how CONFIG_FIT_SIGNATURE, CONFIG_IMAGE_FORMAT_LEGACY and CONFIG_DISABLE_IMAGE_LEGACY interacted when you enabled CONFIG_FIT_SIGNATURE, you got CONFIG_IMAGE_FORMAT_LEGACY disabled immediately unless you had some way of explicitly enabling it elsewhere.

Kconfig doesn't give us this - CONFIG_IMAGE_FORMAT_LEGACY starts off enabled, CONFIG_FIT_SIGNATURE starts off disabled and if you enable CONFIG_FIT_SIGNATURE then CONFIG_IMAGE_FORMAT_LEGACY stays enabled.

Is there some way to preserve the existing behaviour through Kconfig that I've failed to figure out?

Green Travis build:

https://travis-ci.org/akiernan/u-boot/builds/368366062

Alex Kiernan (1):
Migrate IMAGE_FORMAT_LEGACY to Kconfig

 Kconfig                                | 10 ++++++++++
 README                                 | 13 -------------
 configs/ids8313_defconfig              |  1 +
 configs/imx6dl_icore_nand_defconfig    |  1 +
 configs/imx6q_icore_nand_defconfig     |  1 +
 configs/imx6qdl_icore_mipi_defconfig   |  1 +
 configs/imx6qdl_icore_mmc_defconfig    |  1 +
 configs/imx6qdl_icore_nand_defconfig   |  1 +
 configs/imx6qdl_icore_rqs_defconfig    |  1 +
 configs/imx6ul_geam_mmc_defconfig      |  1 +
 configs/imx6ul_geam_nand_defconfig     |  1 +
 configs/imx6ul_isiot_emmc_defconfig    |  1 +
 configs/imx6ul_isiot_nand_defconfig    |  1 +
 configs/syzygy_hub_defconfig           |  1 +
 configs/zynq_cc108_defconfig           |  1 +
 configs/zynq_microzed_defconfig        |  1 +
 configs/zynq_z_turn_defconfig          |  1 +
 configs/zynq_zc702_defconfig           |  1 +
 configs/zynq_zc706_defconfig           |  1 +
 configs/zynq_zc770_xm010_defconfig     |  1 +
 configs/zynq_zc770_xm011_defconfig     |  1 +
 configs/zynq_zc770_xm011_x16_defconfig |  1 +
 configs/zynq_zc770_xm012_defconfig     |  1 +
 configs/zynq_zc770_xm013_defconfig     |  1 +
 configs/zynq_zed_defconfig             |  1 +
 configs/zynq_zybo_defconfig            |  1 +
 include/config_fallbacks.h             |  8 --------
 include/configs/ids8313.h              |  2 --
 include/configs/imx6-engicam.h         |  5 -----
 include/configs/wb50n.h                |  2 --
 include/configs/zynq-common.h          |  3 ---
 scripts/config_whitelist.txt           |  2 --
 32 files changed, 34 insertions(+), 35 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

RFC PATCH 1/1 Migrate IMAGE_FORMAT_LEGACY to Kconfig

This converts IMAGE_FORMAT_LEGACY to Kconfig

---

 Kconfig                                | 10 ++++++++++
 README                                 | 13 -------------
 configs/ids8313_defconfig              |  1 +
 configs/imx6dl_icore_nand_defconfig    |  1 +
 configs/imx6q_icore_nand_defconfig     |  1 +
 configs/imx6qdl_icore_mipi_defconfig   |  1 +
 configs/imx6qdl_icore_mmc_defconfig    |  1 +
 configs/imx6qdl_icore_nand_defconfig   |  1 +
 configs/imx6qdl_icore_rqs_defconfig    |  1 +
 configs/imx6ul_geam_mmc_defconfig      |  1 +
 configs/imx6ul_geam_nand_defconfig     |  1 +
 configs/imx6ul_isiot_emmc_defconfig    |  1 +
 configs/imx6ul_isiot_nand_defconfig    |  1 +
 configs/syzygy_hub_defconfig           |  1 +
 configs/zynq_cc108_defconfig           |  1 +
 configs/zynq_microzed_defconfig        |  1 +
 configs/zynq_z_turn_defconfig          |  1 +
 configs/zynq_zc702_defconfig           |  1 +
 configs/zynq_zc706_defconfig           |  1 +
 configs/zynq_zc770_xm010_defconfig     |  1 +
 configs/zynq_zc770_xm011_defconfig     |  1 +
 configs/zynq_zc770_xm011_x16_defconfig |  1 +
 configs/zynq_zc770_xm012_defconfig     |  1 +
 configs/zynq_zc770_xm013_defconfig     |  1 +
 configs/zynq_zed_defconfig             |  1 +
 configs/zynq_zybo_defconfig            |  1 +
 include/config_fallbacks.h             |  8 --------
 include/configs/ids8313.h              |  2 --
 include/configs/imx6-engicam.h         |  5 -----
 include/configs/wb50n.h                |  2 --
 include/configs/zynq-common.h          |  3 ---
 scripts/config_whitelist.txt           |  2 --
 32 files changed, 34 insertions(+), 35 deletions(-)
Kconfig +10 -0
index 6957097..78afe72 100644
@@ -361,6 +361,16 @@ endif # SPL
 
 endif # FIT
 
+config IMAGE_FORMAT_LEGACY
+	bool "Enable support for the legacy image format"
+	default y if !FIT_SIGNATURE
+	help
+	  This option enables the legacy image format. It is enabled by
+	  default for backward compatibility, unless FIT_SIGNATURE is
+	  set where it is disabled so that unsigned images cannot be
+	  loaded. If a board needs the legacy image format support in this
+	  case, enable it here.
+
 config OF_BOARD_SETUP
 	bool "Set up board-specific details in device tree before boot"
 	depends on OF_LIBFDT
README +0 -13
index 6f98e09..a15a3dd 100644
@@ -2413,19 +2413,6 @@ FIT uImage format:
  -150	common/cmd_nand.c	Incorrect FIT image format
   151	common/cmd_nand.c	FIT image format OK
 
-- legacy image format:
-		CONFIG_IMAGE_FORMAT_LEGACY
-		enables the legacy image format support in U-Boot.
-
-		Default:
-		enabled if CONFIG_FIT_SIGNATURE is not defined.
-
-		CONFIG_DISABLE_IMAGE_LEGACY
-		disable the legacy image format
-
-		This define is introduced, as the legacy image format is
-		enabled per default for backward compatibility.
-
 - Standalone program support:
 		CONFIG_STANDALONE_LOAD_ADDR
 
configs/ids8313_defconfig +1 -0
index b662111..695a1ed 100644
@@ -4,6 +4,7 @@ CONFIG_MPC83xx=y
 CONFIG_TARGET_IDS8313=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=1
configs/imx6dl_icore_nand_defconfig +1 -0
index 74a534c..c34e3ac 100644
@@ -13,6 +13,7 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6dl-icore"
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_SPL_DMA_SUPPORT=y
configs/imx6q_icore_nand_defconfig +1 -0
index 0caba80..f8477a9 100644
@@ -13,6 +13,7 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6q-icore"
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
configs/imx6qdl_icore_mipi_defconfig +1 -0
index 4e1dad6..17fff72 100644
@@ -17,6 +17,7 @@ CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
configs/imx6qdl_icore_mmc_defconfig +1 -0
index 308e11c..948894e 100644
@@ -17,6 +17,7 @@ CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
configs/imx6qdl_icore_nand_defconfig +1 -0
index 0caba80..f8477a9 100644
@@ -13,6 +13,7 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6q-icore"
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
configs/imx6qdl_icore_rqs_defconfig +1 -0
index fb7f260..2e49fe3 100644
@@ -16,6 +16,7 @@ CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
configs/imx6ul_geam_mmc_defconfig +1 -0
index b4aa1b2..6530667 100644
@@ -15,6 +15,7 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6ul-geam-kit"
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
configs/imx6ul_geam_nand_defconfig +1 -0
index f836c18..243ab39 100644
@@ -13,6 +13,7 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6ul-geam-kit"
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
configs/imx6ul_isiot_emmc_defconfig +1 -0
index 2a5dbef..1fa41f6 100644
@@ -15,6 +15,7 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6ul-isiot-emmc"
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
configs/imx6ul_isiot_nand_defconfig +1 -0
index 2c84424..d738c0b 100644
@@ -13,6 +13,7 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6ul-isiot-nand"
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
configs/syzygy_hub_defconfig +1 -0
index 005cb9c..aef21a8 100644
@@ -11,6 +11,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_cc108_defconfig +1 -0
index 170cfbd..f161cf8 100644
@@ -9,6 +9,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_microzed_defconfig +1 -0
index 967c037..34939fa 100644
@@ -8,6 +8,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_z_turn_defconfig +1 -0
index 5b13edb..c2c478d 100644
@@ -9,6 +9,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_zc702_defconfig +1 -0
index 2c9210f..c23dd8f 100644
@@ -11,6 +11,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_zc706_defconfig +1 -0
index dd1b1af..00042c1 100644
@@ -11,6 +11,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_zc770_xm010_defconfig +1 -0
index 214d7eb..7713e5a 100644
@@ -10,6 +10,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_zc770_xm011_defconfig +1 -0
index 8db7b99..3c394bf 100644
@@ -11,6 +11,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_zc770_xm011_x16_defconfig +1 -0
index b53ca3d..4bc49b3 100644
@@ -11,6 +11,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_zc770_xm012_defconfig +1 -0
index b3956ee..0a78830 100644
@@ -10,6 +10,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_zc770_xm013_defconfig +1 -0
index 76f881a..6659218 100644
@@ -10,6 +10,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_zed_defconfig +1 -0
index 769c531..13898b3 100644
@@ -9,6 +9,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
configs/zynq_zybo_defconfig +1 -0
index fbe22c5..771d8ca 100644
@@ -10,6 +10,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_IMAGE_FORMAT_LEGACY=y
 CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
include/config_fallbacks.h +0 -8
index 23a4cfb..c18f19a 100644
@@ -46,14 +46,6 @@
 #define CONFIG_SYS_MAXARGS	16
 #endif
 
-#ifndef CONFIG_FIT_SIGNATURE
-#define CONFIG_IMAGE_FORMAT_LEGACY
-#endif
-
-#ifdef CONFIG_DISABLE_IMAGE_LEGACY
-#undef CONFIG_IMAGE_FORMAT_LEGACY
-#endif
-
 #ifdef CONFIG_DM_I2C
 # ifdef CONFIG_SYS_I2C
 #  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
include/configs/ids8313.h +0 -2
index a10dc12..8357895 100644
@@ -506,6 +506,4 @@
 /* UBI Support */
 #define CONFIG_MTD_PARTITIONS
 
-#define CONFIG_IMAGE_FORMAT_LEGACY
-
 #endif	/* __CONFIG_H */
include/configs/imx6-engicam.h +0 -5
index 246a636..86604d6 100644
@@ -130,11 +130,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_INIT_RAM_ADDR + \
 					CONFIG_SYS_INIT_SP_OFFSET)
 
-/* FIT */
-#ifdef CONFIG_FIT
-# define CONFIG_IMAGE_FORMAT_LEGACY
-#endif
-
 /* UART */
 #ifdef CONFIG_MXC_UART
 # ifdef CONFIG_MX6UL
include/configs/wb50n.h +0 -2
index 028e3ff..093cc32 100644
@@ -23,8 +23,6 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #endif
 
-#define CONFIG_IMAGE_FORMAT_LEGACY
-
 /* general purpose I/O */
 #define CONFIG_AT91_GPIO
 
include/configs/zynq-common.h +0 -3
index ae82a7a..9872f0a 100644
@@ -259,9 +259,6 @@
 					GENERATED_GBL_DATA_SIZE)
 
 
-/* FIT support */
-#define CONFIG_IMAGE_FORMAT_LEGACY /* enable also legacy image format */
-
 /* Extend size of kernel image for uncompression */
 #define CONFIG_SYS_BOOTM_LEN	(60 * 1024 * 1024)
 
scripts/config_whitelist.txt +0 -2
index 193c7de..517805a 100644
@@ -373,7 +373,6 @@ CONFIG_DIALOG_POWER
 CONFIG_DIMM_SLOTS_PER_CTLR
 CONFIG_DIRECT_NOR_BOOT
 CONFIG_DISABLE_CONSOLE
-CONFIG_DISABLE_IMAGE_LEGACY
 CONFIG_DISCONTIGMEM
 CONFIG_DISCOVER_PHY
 CONFIG_DISPLAY_AER_xxxx
@@ -974,7 +973,6 @@ CONFIG_IDE_SWAP_IO
 CONFIG_IDT8T49N222A
 CONFIG_ID_EEPROM
 CONFIG_IMA
-CONFIG_IMAGE_FORMAT_LEGACY
 CONFIG_IMX
 CONFIG_IMX6_PWM_PER_CLK
 CONFIG_IMX_HDMI
Signature · 1 line
2.7.4
#2 lore raw

cover Migrate IMAGE_FORMAT_LEGACY to Kconfig

In reply to Alex Kiernan
Quoted 8 lines · Alex Kiernan

On the face of it, this is a straightforward moveconfig, but because of how CONFIG_FIT_SIGNATURE, CONFIG_IMAGE_FORMAT_LEGACY and CONFIG_DISABLE_IMAGE_LEGACY interacted when you enabled CONFIG_FIT_SIGNATURE, you got CONFIG_IMAGE_FORMAT_LEGACY disabled immediately unless you had some way of explicitly enabling it elsewhere.

Quoted 6 lines

Kconfig doesn't give us this - CONFIG_IMAGE_FORMAT_LEGACY starts off enabled, CONFIG_FIT_SIGNATURE starts off disabled and if you enable CONFIG_FIT_SIGNATURE then CONFIG_IMAGE_FORMAT_LEGACY stays enabled.

Is there some way to preserve the existing behaviour through Kconfig that I've failed to figure out?

When I do these, it's a multi-step moveconfig.py that goes something like:
- Introduce FOO (no deps)
- moveconfig.py -y it.
- Introduce BAR (no deps)
- moveconfig.py -y it.
- for FILE in configs/*defconfig;do grep -q FOO $FILE || echo '# CONFIG_FOO is not set' >> $FILE;done
- Repeat the for loop but for BAR.
- Introduce deps
- moveconfig.py -sC
- Build before/after for a few boards that I know are tricky, use buildman -SCvel/Ssdel to confirm size changes didn't happen.
- If good, world-build checking sizes.

And in some cases like this particular one, there might need to be an initial first comment to invert the logic, and as that can be tricky when adding a new option that _should_ be default y, first I add it without default y, moveconfig.py -y it, for loop like above, then add default y and moveconfig.py -s.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180419/9b794dc9/attachment.sig>
#3 lore raw

cover Migrate IMAGE_FORMAT_LEGACY to Kconfig

Quoted 31 lines · Tom Rini
Quoted 8 lines · Alex Kiernan

On the face of it, this is a straightforward moveconfig, but because of how CONFIG_FIT_SIGNATURE, CONFIG_IMAGE_FORMAT_LEGACY and CONFIG_DISABLE_IMAGE_LEGACY interacted when you enabled CONFIG_FIT_SIGNATURE, you got CONFIG_IMAGE_FORMAT_LEGACY disabled immediately unless you had some way of explicitly enabling it elsewhere.

Quoted 6 lines

Kconfig doesn't give us this - CONFIG_IMAGE_FORMAT_LEGACY starts off enabled, CONFIG_FIT_SIGNATURE starts off disabled and if you enable CONFIG_FIT_SIGNATURE then CONFIG_IMAGE_FORMAT_LEGACY stays enabled.

Is there some way to preserve the existing behaviour through Kconfig that I've failed to figure out?

When I do these, it's a multi-step moveconfig.py that goes something like:
- Introduce FOO (no deps)
- moveconfig.py -y it.
- Introduce BAR (no deps)
- moveconfig.py -y it.
- for FILE in configs/*defconfig;do grep -q FOO $FILE || echo '# CONFIG_FOO is not set' >> $FILE;done
- Repeat the for loop but for BAR.
- Introduce deps
- moveconfig.py -sC
- Build before/after for a few boards that I know are tricky, use buildman -SCvel/Ssdel to confirm size changes didn't happen.
- If good, world-build checking sizes.

Quoted 6 lines

And in some cases like this particular one, there might need to be an initial first comment to invert the logic, and as that can be tricky when adding a new option that _should_ be default y, first I add it without default y, moveconfig.py -y it, for loop like above, then add default y and moveconfig.py -s.

Thanks, let me give that a go...

There's a second concern I have once the pieces are all in there when you're making changes through menuconfig (and friends)... there's no "weak" default enable in Kconfig (at least as far as I can tell) so if you select FIT_SIGNATURE, you have to explicitly go and de-select IMAGE_FORMAT_LEGACY.

Am I missing something, or can we live with that?

Signature · 1 line
Alex Kiernan
#4 lore raw

cover Migrate IMAGE_FORMAT_LEGACY to Kconfig

Quoted 32 lines · Alex Kiernan
Quoted 31 lines · Tom Rini
Quoted 8 lines · Alex Kiernan

On the face of it, this is a straightforward moveconfig, but because of how CONFIG_FIT_SIGNATURE, CONFIG_IMAGE_FORMAT_LEGACY and CONFIG_DISABLE_IMAGE_LEGACY interacted when you enabled CONFIG_FIT_SIGNATURE, you got CONFIG_IMAGE_FORMAT_LEGACY disabled immediately unless you had some way of explicitly enabling it elsewhere.

Quoted 6 lines

Kconfig doesn't give us this - CONFIG_IMAGE_FORMAT_LEGACY starts off enabled, CONFIG_FIT_SIGNATURE starts off disabled and if you enable CONFIG_FIT_SIGNATURE then CONFIG_IMAGE_FORMAT_LEGACY stays enabled.

Is there some way to preserve the existing behaviour through Kconfig that I've failed to figure out?

When I do these, it's a multi-step moveconfig.py that goes something like:
- Introduce FOO (no deps)
- moveconfig.py -y it.
- Introduce BAR (no deps)
- moveconfig.py -y it.
- for FILE in configs/*defconfig;do grep -q FOO $FILE || echo '# CONFIG_FOO is not set' >> $FILE;done
- Repeat the for loop but for BAR.
- Introduce deps
- moveconfig.py -sC
- Build before/after for a few boards that I know are tricky, use buildman -SCvel/Ssdel to confirm size changes didn't happen.
- If good, world-build checking sizes.

Quoted 9 lines
Quoted 6 lines

And in some cases like this particular one, there might need to be an initial first comment to invert the logic, and as that can be tricky when adding a new option that _should_ be default y, first I add it without default y, moveconfig.py -y it, for loop like above, then add default y and moveconfig.py -s.

Thanks, let me give that a go...

Having gone through that piece by piece, I'm pretty sure that moveconfig has actually done the right thing. We've these configurations which enable FIT_SIGNATURE without IMAGE_FORMAT_LEGACY:

am335x_boneblack_vboot_defconfig
conga-qeval20-qa3-e3845_defconfig
conga-qeval20-qa3-e3845-internal-uart_defconfig
controlcenterdc_defconfig
dfi-bt700-q7x-151_defconfig
minnowmax_defconfig
sandbox64_defconfig
sandbox_defconfig
sandbox_flattree_defconfig
sandbox_noblk_defconfig
sandbox_spl_defconfig
som-db5800-som-6867_defconfig
theadorable-x86-conga-qa3-e3845_defconfig
theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig
theadorable-x86-dfi-bt700_defconfig

And checking each of them, they're IMAGE_FORMAT_LEGACY disabled after the conversion.

I'll hang fire on sending a non-RFC v2 to see if there's any more comments.

Signature · 1 line
Alex Kiernan
#5 lore raw

cover Migrate IMAGE_FORMAT_LEGACY to Kconfig

Quoted 63 lines · Alex Kiernan
Quoted 32 lines · Alex Kiernan
Quoted 31 lines · Tom Rini
Quoted 8 lines · Alex Kiernan

On the face of it, this is a straightforward moveconfig, but because of how CONFIG_FIT_SIGNATURE, CONFIG_IMAGE_FORMAT_LEGACY and CONFIG_DISABLE_IMAGE_LEGACY interacted when you enabled CONFIG_FIT_SIGNATURE, you got CONFIG_IMAGE_FORMAT_LEGACY disabled immediately unless you had some way of explicitly enabling it elsewhere.

Quoted 6 lines

Kconfig doesn't give us this - CONFIG_IMAGE_FORMAT_LEGACY starts off enabled, CONFIG_FIT_SIGNATURE starts off disabled and if you enable CONFIG_FIT_SIGNATURE then CONFIG_IMAGE_FORMAT_LEGACY stays enabled.

Is there some way to preserve the existing behaviour through Kconfig that I've failed to figure out?

When I do these, it's a multi-step moveconfig.py that goes something like:
- Introduce FOO (no deps)
- moveconfig.py -y it.
- Introduce BAR (no deps)
- moveconfig.py -y it.
- for FILE in configs/*defconfig;do grep -q FOO $FILE || echo '# CONFIG_FOO is not set' >> $FILE;done
- Repeat the for loop but for BAR.
- Introduce deps
- moveconfig.py -sC
- Build before/after for a few boards that I know are tricky, use buildman -SCvel/Ssdel to confirm size changes didn't happen.
- If good, world-build checking sizes.

Quoted 9 lines
Quoted 6 lines

And in some cases like this particular one, there might need to be an initial first comment to invert the logic, and as that can be tricky when adding a new option that _should_ be default y, first I add it without default y, moveconfig.py -y it, for loop like above, then add default y and moveconfig.py -s.

Thanks, let me give that a go...

Having gone through that piece by piece, I'm pretty sure that moveconfig has actually done the right thing. We've these configurations which enable FIT_SIGNATURE without IMAGE_FORMAT_LEGACY:

am335x_boneblack_vboot_defconfig
conga-qeval20-qa3-e3845_defconfig
conga-qeval20-qa3-e3845-internal-uart_defconfig
controlcenterdc_defconfig
dfi-bt700-q7x-151_defconfig
minnowmax_defconfig
sandbox64_defconfig
sandbox_defconfig
sandbox_flattree_defconfig
sandbox_noblk_defconfig
sandbox_spl_defconfig
som-db5800-som-6867_defconfig
theadorable-x86-conga-qa3-e3845_defconfig
theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig
theadorable-x86-dfi-bt700_defconfig

Quoted 4 lines

And checking each of them, they're IMAGE_FORMAT_LEGACY disabled after the conversion.

I'll hang fire on sending a non-RFC v2 to see if there's any more comments.

I think you have it right as well, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180420/a90d8191/attachment.sig>