Skip to contentSkip to conversation

Kconfig: convert MD5 and CMD_MD5SUM

PATCH New Andre Przywara 4 participants 14 messages Mar 15, 2017 – Mar 18, 2017

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

cover Kconfig: convert MD5 and CMD_MD5SUM

This series move CONFIG_MD5 and the associated CONFIG_CMD_MD5SUM over to Kconfig, so it can easily be selected either by menuconfig or by a _defconfig (without resorting to header file hacks).

Cheers,
Andre.

Andre Przywara (4):
kirkwood: remove get_random_hex() and MD5 dependency
Kconfig: introduce md5sum command selection
Kconfig: define MD5 dependency for FIT support
configs: move CMD_MD5SUM definition to defconfigs

 Kconfig                                      |  1 +
 arch/arm/mach-kirkwood/include/mach/config.h |  1 -
 arch/arm/mach-kirkwood/include/mach/cpu.h    |  1 -
 cmd/Kconfig                                  | 14 ++++++++++++++
 configs/dragonboard410c_defconfig            |  1 +
 configs/sandbox_defconfig                    |  1 +
 configs/sandbox_noblk_defconfig              |  1 +
 configs/sandbox_spl_defconfig                |  1 +
 configs/sh7752evb_defconfig                  |  1 +
 configs/sh7753evb_defconfig                  |  1 +
 configs/sh7757lcr_defconfig                  |  1 +
 include/configs/dragonboard410c.h            |  4 ----
 include/configs/sandbox.h                    |  1 -
 include/configs/sh7752evb.h                  |  2 --
 include/configs/sh7753evb.h                  |  2 --
 include/configs/sh7757lcr.h                  |  2 --
 include/image.h                              |  1 -
 lib/Kconfig                                  |  4 ++++
 scripts/config_whitelist.txt                 |  3 ---
 19 files changed, 26 insertions(+), 17 deletions(-)
Signature · 1 line
2.8.2
#1 lore raw

PATCH 1/4 kirkwood: remove get_random_hex() and MD5 dependency

Commit 19a5944fcd62 ("mvgbe: remove setting of ethaddr within the driver") removed the usage of get_random_hex() from the mvgbe driver about six years ago. However the prototype of that function survived till today in some kirkwood header file.
Remove that prototype and the CONFIG_MD5 dependency triggered by that.

---
 arch/arm/mach-kirkwood/include/mach/config.h | 1 -
 arch/arm/mach-kirkwood/include/mach/cpu.h    | 1 -
 2 files changed, 2 deletions(-)
arch/arm/mach-kirkwood/include/mach/config.h +0 -1
index 446457f..b786df0 100644
@@ -24,7 +24,6 @@
 #endif /* CONFIG_KW88F6281 */
 
 #include <asm/arch/soc.h>
-#define CONFIG_MD5	/* get_random_hex on krikwood needs MD5 support */
 #define CONFIG_KIRKWOOD_EGIGA_INIT	/* Enable GbePort0/1 for kernel */
 #define CONFIG_KIRKWOOD_RGMII_PAD_1V8	/* Set RGMII Pad voltage to 1.8V */
 #define CONFIG_KIRKWOOD_PCIE_INIT       /* Enable PCIE Port0 for kernel */
arch/arm/mach-kirkwood/include/mach/cpu.h +0 -1
index 926d347..ab704d9 100644
@@ -139,7 +139,6 @@ struct kwgpio_registers {
 /*
  * functions
  */
-unsigned char get_random_hex(void);
 unsigned int mvebu_sdram_bar(enum memory_bank bank);
 unsigned int mvebu_sdram_bs(enum memory_bank bank);
 void mvebu_sdram_size_adjust(enum memory_bank bank);
Signature · 1 line
2.8.2
#5 lore raw

PATCH 2/4 Kconfig: introduce md5sum command selection

In reply to Andre Przywara

So far CONFIG_MD5SUM would need to be set by a board's include file. Since the command is really generic, move it over to Kconfig to allow it to be defined by either a board's defconfig, menuconfig or some config snippet merged via mergeconfig.sh.

---
 cmd/Kconfig | 14 ++++++++++++++
 lib/Kconfig |  4 ++++
 2 files changed, 18 insertions(+)
cmd/Kconfig +14 -0
index ef53156..25e3b78 100644
@@ -338,6 +338,20 @@ config CMD_CRC32
 	help
 	  Compute CRC32.
 
+config CMD_MD5SUM
+	bool "md5sum"
+	default n
+	select MD5
+	help
+	  Compute MD5 checksum.
+
+config MD5SUM_VERFIY
+	bool "md5sum -v"
+	default n
+	depends on CMD_MD5SUM
+	help
+	  Add -v option to verify data against an MD5 checksum.
+
 config LOOPW
 	bool "loopw"
 	help
lib/Kconfig +4 -0
index b16062f..65c0157 100644
@@ -101,6 +101,10 @@ config SHA_PROG_HW_ACCEL
 	  SHA1/SHA256 progressive hashing.
 	  Data can be streamed in a block at a time and the hashing
 	  is performed in hardware.
+
+config MD5
+	bool
+
 endmenu
 
 menu "Compression Support"
Signature · 1 line
2.8.2
#8 lore raw

PATCH 3/4 Kconfig: define MD5 dependency for FIT support

In reply to Andre Przywara

FIT images require MD5 support to verify image checksums. So far this was expressed by defining a CPP symbol in image.h. Since MD5 is now a first class Kconfig citizen, express that in Kconfig instead.

---
 Kconfig         | 1 +
 include/image.h | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
Kconfig +1 -0
index 81b4226..e0744d1 100644
@@ -144,6 +144,7 @@ menu "Boot images"
 
 config FIT
 	bool "Support Flattened Image Tree"
+	select MD5
 	help
 	  This option allows you to boot the new uImage structure,
 	  Flattened Image Tree.  FIT is formally a FDT, which can include
include/image.h +0 -1
index 1e686b7..2372518 100644
@@ -67,7 +67,6 @@ struct lmb;
 #  endif
 # else
 #  define CONFIG_CRC32		/* FIT images need CRC32 support */
-#  define CONFIG_MD5		/* and MD5 */
 #  define CONFIG_SHA1		/* and SHA1 */
 #  define CONFIG_SHA256		/* and SHA256 */
 #  define IMAGE_ENABLE_CRC32	1
Signature · 1 line
2.8.2
#11 lore raw

PATCH 4/4 configs: move CMD_MD5SUM definition to defconfigs

In reply to Andre Przywara

Boards with an apparent need for the md5sum command had the connected config symbol defined in their board header file.
Move this over to the respective defconfig files now that md5sum is configured via Kconfig.
(This is a manual effort, which differs from moveconfig.py, not sure who is right here. Boards except sandbox loose the md5sum command with moveconfig.py, though it was explicitly mentioned in their config.h's)

---
 configs/dragonboard410c_defconfig | 1 +
 configs/sandbox_defconfig         | 1 +
 configs/sandbox_noblk_defconfig   | 1 +
 configs/sandbox_spl_defconfig     | 1 +
 configs/sh7752evb_defconfig       | 1 +
 configs/sh7753evb_defconfig       | 1 +
 configs/sh7757lcr_defconfig       | 1 +
 include/configs/dragonboard410c.h | 4 ----
 include/configs/sandbox.h         | 1 -
 include/configs/sh7752evb.h       | 2 --
 include/configs/sh7753evb.h       | 2 --
 include/configs/sh7757lcr.h       | 2 --
 scripts/config_whitelist.txt      | 3 ---
 13 files changed, 7 insertions(+), 14 deletions(-)
configs/dragonboard410c_defconfig +1 -0
index 7435818..6b50964 100644
@@ -36,3 +36,4 @@ CONFIG_USB_EHCI_MSM=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
+CONFIG_CMD_MD5SUM=y
configs/sandbox_defconfig +1 -0
index 01f6f5d..7f3f5ac 100644
@@ -22,6 +22,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MD5SUM=y
 CONFIG_LOOPW=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_MX_CYCLIC=y
configs/sandbox_noblk_defconfig +1 -0
index 10e12bf..3f8e70d 100644
@@ -22,6 +22,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MD5SUM=y
 CONFIG_LOOPW=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_MX_CYCLIC=y
configs/sandbox_spl_defconfig +1 -0
index 281e441..ade6714 100644
@@ -29,6 +29,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MD5SUM=y
 CONFIG_LOOPW=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_MX_CYCLIC=y
configs/sh7752evb_defconfig +1 -0
index ace7553..224b55b 100644
@@ -27,6 +27,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_MAC_PARTITION=y
 CONFIG_DOS_PARTITION=y
 CONFIG_MMC=y
+CONFIG_CMD_MD5SUM=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
configs/sh7753evb_defconfig +1 -0
index 48e3d55..7bf8862 100644
@@ -26,6 +26,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_MAC_PARTITION=y
 CONFIG_DOS_PARTITION=y
 CONFIG_MMC=y
+CONFIG_CMD_MD5SUM=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
configs/sh7757lcr_defconfig +1 -0
index dc6f4e1..00870ac 100644
@@ -27,6 +27,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_MAC_PARTITION=y
 CONFIG_DOS_PARTITION=y
 CONFIG_MMC=y
+CONFIG_CMD_MD5SUM=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_USE_PRIVATE_LIBGCC=y
include/configs/dragonboard410c.h +0 -4
index 7f0742a..238f4cd 100644
@@ -46,12 +46,8 @@
 #define CONFIG_USB_ETHER_MCS7830
 #define CONFIG_USB_ETHER_SMSC95XX
 
-/* Libraries  */
-#define CONFIG_MD5
-
 /* Extra Commands */
 #define CONFIG_CMD_ENV
-#define CONFIG_CMD_MD5SUM
 /* Enable that for switching of boot partitions */
 /* Disabled by default as some sub-commands can brick eMMC */
 /*#define CONFIG_SUPPORT_EMMC_BOOT */
include/configs/sandbox.h +0 -1
index ac7973c..ad687b1 100644
@@ -44,7 +44,6 @@
 #define CONFIG_CMD_CBFS
 #define CONFIG_CMD_CRAMFS
 #define CONFIG_HOST_MAX_DEVICES 4
-#define CONFIG_CMD_MD5SUM
 
 /*
  * Size of malloc() pool, before and after relocation
include/configs/sh7752evb.h +0 -2
index d818981..9b12324 100644
@@ -16,8 +16,6 @@
 
 #define CONFIG_CMD_DFL
 #define CONFIG_CMD_SDRAM
-#define CONFIG_CMD_MD5SUM
-#define CONFIG_MD5
 
 #define CONFIG_BAUDRATE		115200
 #define CONFIG_BOOTARGS		"console=ttySC2,115200 root=/dev/nfs ip=dhcp"
include/configs/sh7753evb.h +0 -2
index a7d8de4..a4818ff 100644
@@ -16,8 +16,6 @@
 
 #define CONFIG_CMD_DFL
 #define CONFIG_CMD_SDRAM
-#define CONFIG_CMD_MD5SUM
-#define CONFIG_MD5
 
 #define CONFIG_BAUDRATE		115200
 #define CONFIG_BOOTARGS		"console=ttySC2,115200 root=/dev/nfs ip=dhcp"
include/configs/sh7757lcr.h +0 -2
index c21a5f8..8b33998 100644
@@ -16,8 +16,6 @@
 #define CONFIG_SYS_TEXT_BASE	0x8ef80000
 
 #define CONFIG_CMD_SDRAM
-#define CONFIG_CMD_MD5SUM
-#define CONFIG_MD5
 
 #define CONFIG_BAUDRATE		115200
 #define CONFIG_BOOTARGS		"console=ttySC2,115200 root=/dev/nfs ip=dhcp"
scripts/config_whitelist.txt +0 -3
index f38e56c..9192461 100644
@@ -509,7 +509,6 @@ CONFIG_CMD_LDRINFO
 CONFIG_CMD_LOADY
 CONFIG_CMD_LZMADEC
 CONFIG_CMD_MAX6957
-CONFIG_CMD_MD5SUM
 CONFIG_CMD_MEM
 CONFIG_CMD_MFSL
 CONFIG_CMD_MMC_SPI
@@ -1882,8 +1881,6 @@ CONFIG_MCFRTC
 CONFIG_MCFTMR
 CONFIG_MCFUART
 CONFIG_MCLK_DIS
-CONFIG_MD5
-CONFIG_MD5SUM_VERIFY
 CONFIG_MDIO_TIMEOUT
 CONFIG_MECP5123
 CONFIG_MEMSIZE
Signature · 1 line
2.8.2
#2 lore raw

PATCH 1/4 kirkwood: remove get_random_hex() and MD5 dependency

In reply to Andre Przywara
Quoted 11 lines · Andre Przywara

Commit 19a5944fcd62 ("mvgbe: remove setting of ethaddr within the driver") removed the usage of get_random_hex() from the mvgbe driver about six years ago. However the prototype of that function survived till today in some kirkwood header file.
Remove that prototype and the CONFIG_MD5 dependency triggered by that.

---
 arch/arm/mach-kirkwood/include/mach/config.h | 1 -
 arch/arm/mach-kirkwood/include/mach/cpu.h    | 1 -
 2 files changed, 2 deletions(-)
#6 lore raw

PATCH 2/4 Kconfig: introduce md5sum command selection

In reply to Andre Przywara
Quoted 10 lines · Andre Przywara

So far CONFIG_MD5SUM would need to be set by a board's include file. Since the command is really generic, move it over to Kconfig to allow it to be defined by either a board's defconfig, menuconfig or some config snippet merged via mergeconfig.sh.

---
 cmd/Kconfig | 14 ++++++++++++++
 lib/Kconfig |  4 ++++
 2 files changed, 18 insertions(+)
#9 lore raw

PATCH 3/4 Kconfig: define MD5 dependency for FIT support

In reply to Andre Przywara
Quoted 9 lines · Andre Przywara

FIT images require MD5 support to verify image checksums. So far this was expressed by defining a CPP symbol in image.h. Since MD5 is now a first class Kconfig citizen, express that in Kconfig instead.

---
 Kconfig         | 1 +
 include/image.h | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
#12 lore raw

PATCH 4/4 configs: move CMD_MD5SUM definition to defconfigs

In reply to Andre Przywara

Hi Andre,

Quoted 9 lines · Andre Przywara

Boards with an apparent need for the md5sum command had the connected config symbol defined in their board header file.
Move this over to the respective defconfig files now that md5sum is configured via Kconfig.
(This is a manual effort, which differs from moveconfig.py, not sure who is right here. Boards except sandbox loose the md5sum command with moveconfig.py, though it was explicitly mentioned in their config.h's)

Quoted 15 lines
---
 configs/dragonboard410c_defconfig | 1 +
 configs/sandbox_defconfig         | 1 +
 configs/sandbox_noblk_defconfig   | 1 +
 configs/sandbox_spl_defconfig     | 1 +
 configs/sh7752evb_defconfig       | 1 +
 configs/sh7753evb_defconfig       | 1 +
 configs/sh7757lcr_defconfig       | 1 +
 include/configs/dragonboard410c.h | 4 ----
 include/configs/sandbox.h         | 1 -
 include/configs/sh7752evb.h       | 2 --
 include/configs/sh7753evb.h       | 2 --
 include/configs/sh7757lcr.h       | 2 --
 scripts/config_whitelist.txt      | 3 ---
 13 files changed, 7 insertions(+), 14 deletions(-)

That's odd - did you check that these boards actually do end up with it. I've not seen that problem with moveconfig.py before.

Regards,
SImon

#3 lore raw

PATCH 1/4 kirkwood: remove get_random_hex() and MD5 dependency

In reply to Andre Przywara
Quoted 29 lines · Andre Przywara

Commit 19a5944fcd62 ("mvgbe: remove setting of ethaddr within the driver") removed the usage of get_random_hex() from the mvgbe driver about six years ago. However the prototype of that function survived till today in some kirkwood header file.
Remove that prototype and the CONFIG_MD5 dependency triggered by that.

---
 arch/arm/mach-kirkwood/include/mach/config.h | 1 -
 arch/arm/mach-kirkwood/include/mach/cpu.h    | 1 -
 2 files changed, 2 deletions(-)
arch/arm/mach-kirkwood/include/mach/config.h +0 -1
index 446457f..b786df0 100644
@@ -24,7 +24,6 @@
 #endif /* CONFIG_KW88F6281 */
 
 #include <asm/arch/soc.h>
-#define CONFIG_MD5	/* get_random_hex on krikwood needs MD5 support */
 #define CONFIG_KIRKWOOD_EGIGA_INIT	/* Enable GbePort0/1 for kernel */
 #define CONFIG_KIRKWOOD_RGMII_PAD_1V8	/* Set RGMII Pad voltage to 1.8V */
 #define CONFIG_KIRKWOOD_PCIE_INIT       /* Enable PCIE Port0 for kernel */
arch/arm/mach-kirkwood/include/mach/cpu.h +0 -0
index 926d347..ab704d9 100644

arch/arm/mach-kirkwood/include/mach/cpu.h struct kwgpio_registers { · line 144

Quoted 7 lines
arch/arm/mach-kirkwood/include/mach/cpu.h +0 -1
@@ -139,7 +139,6 @@ struct kwgpio_registers {
 /*
  * functions
  */
-unsigned char get_random_hex(void);
 unsigned int mvebu_sdram_bar(enum memory_bank bank);
 unsigned int mvebu_sdram_bs(enum memory_bank bank);
 void mvebu_sdram_size_adjust(enum memory_bank bank);

Thanks,
Stefan

#4 lore raw

PATCH 1/4 kirkwood: remove get_random_hex() and MD5 dependency

In reply to Andre Przywara
Quoted 8 lines · Andre Przywara

Commit 19a5944fcd62 ("mvgbe: remove setting of ethaddr within the driver") removed the usage of get_random_hex() from the mvgbe driver about six years ago. However the prototype of that function survived till today in some kirkwood header file.
Remove that prototype and the CONFIG_MD5 dependency triggered by that.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170317/02cdc73f/attachment.sig>
#7 lore raw

PATCH 2/4 Kconfig: introduce md5sum command selection

In reply to Andre Przywara
Quoted 7 lines · Andre Przywara

So far CONFIG_MD5SUM would need to be set by a board's include file. Since the command is really generic, move it over to Kconfig to allow it to be defined by either a board's defconfig, menuconfig or some config snippet merged via mergeconfig.sh.

Applied to u-boot/master, thanks!

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

PATCH 3/4 Kconfig: define MD5 dependency for FIT support

In reply to Andre Przywara
Quoted 6 lines · Andre Przywara

FIT images require MD5 support to verify image checksums. So far this was expressed by defining a CPP symbol in image.h. Since MD5 is now a first class Kconfig citizen, express that in Kconfig instead.

Applied to u-boot/master, thanks!

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

PATCH 4/4 configs: move CMD_MD5SUM definition to defconfigs

In reply to Andre Przywara
Quoted 10 lines · Andre Przywara

Boards with an apparent need for the md5sum command had the connected config symbol defined in their board header file.
Move this over to the respective defconfig files now that md5sum is configured via Kconfig.
(This is a manual effort, which differs from moveconfig.py, not sure who is right here. Boards except sandbox loose the md5sum command with moveconfig.py, though it was explicitly mentioned in their config.h's)

Applied to u-boot/master, thanks!

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