cmd: {zip, unzip} fixes
cover cmd: {zip, unzip} fixes
Automatically pull in the needed libraries for zip and unzip. Move the CONFIG_GZIP_COMPRESSED from legacy config.h style to a Kconfig option. The sole user of CONFIG_GZIP_COMPRESSED is the sandbox target for the compression tests. Remove the CONFIG option in its config.h and instead select it together with CONFIG_SANDBOX.
Michael Walle (4):
cmd: unzip: automatically select CONFIG_GZIP
cmd: zip: automatically pull in gzip()
cmd: zip: fix implicit declaration warning
sandbox: move compression option to Kconfig
arch/Kconfig | 2 ++ cmd/Kconfig | 2 ++ cmd/zip.c | 1 + include/configs/sandbox.h | 3 --- lib/Kconfig | 4 ++++ scripts/config_whitelist.txt | 2 -- 6 files changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/4 cmd: unzip: automatically select CONFIG_GZIP
unzip calls gzwrite() which is provided in lib/gunzip.c. Make sure it is automatically pulled in if the user selects CMD_UNZIP.
--- cmd/Kconfig | 1 + 1 file changed, 1 insertion(+)
cmd/Kconfig +1 -0
@@ -810,6 +810,7 @@ config CMD_UNLZ4 config CMD_UNZIP bool "unzip" default y if CMD_BOOTI + select GZIP help Uncompress a zip-compressed memory region.
Signature · 1 line
2.20.1
PATCH 1/4 cmd: unzip: automatically select CONFIG_GZIP
Quoted 4 lines · Michael Walle
unzip calls
gzwrite()which is provided inlib/gunzip.c. Make sure it is automatically pulled in if the user selectsCMD_UNZIP.Signed-off-by Michael Walle <[email protected]>
Quoted 17 lines
--- cmd/Kconfig | 1 + 1 file changed, 1 insertion(+)cmd/Kconfig +1
-0@@ -810,6 +810,7 @@ config CMD_UNLZ4 config CMD_UNZIP bool "unzip" default y if CMD_BOOTI + select GZIP help Uncompress a zip-compressed memory region.
PATCH 1/4 cmd: unzip: automatically select CONFIG_GZIP
In reply to Michael WalleQuoted 5 lines · Michael Walle
unzip calls
gzwrite()which is provided inlib/gunzip.c. Make sure it is automatically pulled in if the user selectsCMD_UNZIP.Signed-off-by Michael Walle <[email protected]>Reviewed-by Heinrich Schuchardt <[email protected]>
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: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200525/2e58a70c/attachment.sig>
PATCH 2/4 cmd: zip: automatically pull in gzip()
In reply to Michael WalleMove the CONFIG_GZIP_COMPRESSED from a config.h macro to a Kconfig menu item. It is not selectable by a user because there is no reason to do so. Instead it will be automatically selected by the stuff which uses gzip(), like the zip command.
Remove it from the config_whitelist.txt. Also remove CONFIG_GZIP_COMPRESS_DEF_SZ as this was never used on any board. The default seems to be sane, otherwise it should be added as a Kconfig option.
--- cmd/Kconfig | 1 + lib/Kconfig | 4 ++++ scripts/config_whitelist.txt | 2 -- 3 files changed, 5 insertions(+), 2 deletions(-)
cmd/Kconfig +1 -0
@@ -816,6 +816,7 @@ config CMD_UNZIP config CMD_ZIP bool "zip" + select GZIP_COMPRESSED help Compress a memory region with zlib deflate method.
lib/Kconfig +4 -0
@@ -424,6 +424,10 @@ config GZIP help This enables support for GZIP compression algorithm. +config GZIP_COMPRESSED + bool + select ZLIB + config BZIP2 bool "Enable bzip2 decompression support" help
scripts/config_whitelist.txt +0 -2
@@ -644,8 +644,6 @@ CONFIG_GPIO_LED_STUBS CONFIG_GREEN_LED CONFIG_GURNARD_FPGA CONFIG_GURNARD_SPLASH -CONFIG_GZIP_COMPRESSED -CONFIG_GZIP_COMPRESS_DEF_SZ CONFIG_G_DNL_THOR_PRODUCT_NUM CONFIG_G_DNL_THOR_VENDOR_NUM CONFIG_G_DNL_UMS_PRODUCT_NUM
Signature · 1 line
2.20.1
PATCH 2/4 cmd: zip: automatically pull in gzip()
Quoted 11 lines · Michael Walle
Move the
CONFIG_GZIP_COMPRESSEDfrom aconfig.hmacro to aKconfigmenu item. It is not selectable by a user because there is no reason to do so. Instead it will be automatically selected by the stuff which usesgzip(), like the zip command.Remove it from the config_whitelist.txt. Also remove
CONFIG_GZIP_COMPRESS_DEF_SZas this was never used on any board. The default seems to be sane, otherwise it should be added as aKconfigoption.
Quoted 6 lines
Signed-off-by Michael Walle <[email protected]>--- cmd/Kconfig | 1 + lib/Kconfig | 4 ++++ scripts/config_whitelist.txt | 2 -- 3 files changed, 5 insertions(+), 2 deletions(-)
PATCH 2/4 cmd: zip: automatically pull in gzip()
In reply to Michael WalleQuoted 5 lines · Michael Walle
Move the
CONFIG_GZIP_COMPRESSEDfrom aconfig.hmacro to aKconfigmenu item. It is not selectable by a user because there is no reason to do so. Instead it will be automatically selected by the stuff which usesgzip(), like the zip command.
Quoted 7 lines
Remove it from the config_whitelist.txt. Also remove
CONFIG_GZIP_COMPRESS_DEF_SZas this was never used on any board. The default seems to be sane, otherwise it should be added as aKconfigoption.Signed-off-by Michael Walle <[email protected]>Reviewed-by Simon Glass <[email protected]>
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: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200525/d3c90253/attachment.sig>
PATCH 3/4 cmd: zip: fix implicit declaration warning
In reply to Michael WalleFix the following warning:
cmd/zip.c: In function ?do_zip?:cmd/zip.c:30:6: warning: implicit declaration of function ?gzip?; did you mean ?do_zip?? [-Wimplicit-function-declaration]
if (gzip((void *) dst, &dst_len, (void *) src, src_len) != 0)
^~~~
do_zipInclude gzip.h header which declares the gzip() function.
--- cmd/zip.c | 1 + 1 file changed, 1 insertion(+)
cmd/zip.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <command.h> #include <env.h> +#include <gzip.h> static int do_zip (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
Signature · 1 line
2.20.1
PATCH 3/4 cmd: zip: fix implicit declaration warning
Quoted 9 lines · Michael Walle
Fix the following warning:
cmd/zip.c: In function ?do_zip?:cmd/zip.c:30:6: warning: implicit declaration of function ?gzip?; did you mean ?do_zip?? [-Wimplicit-function-declaration]
if (gzip((void *) dst, &dst_len, (void *) src, src_len)!= 0)^~~~ do_zip
Quoted 6 lines
Include
gzip.hheader which declares thegzip()function.Signed-off-by Michael Walle <[email protected]>--- cmd/zip.c | 1 + 1 file changed, 1 insertion(+)
PATCH 3/4 cmd: zip: fix implicit declaration warning
In reply to Michael WalleQuoted 5 lines · Michael Walle
Fix the following warning:
cmd/zip.c: In function ?do_zip?:cmd/zip.c:30:6: warning: implicit declaration of function ?gzip?; did you mean ?do_zip?? [-Wimplicit-function-declaration]
if (gzip((void *) dst, &dst_len, (void *) src, src_len)!= 0)
Quoted 7 lines
^~~~ do_zipInclude
gzip.hheader which declares thegzip()function.Signed-off-by Michael Walle <[email protected]>Reviewed-by Simon Glass <[email protected]>
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: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200525/a3392158/attachment.sig>
PATCH 4/4 sandbox: move compression option to Kconfig
In reply to Michael WalleCONFIG_BZIP2 and CONFIG_GZIP_COMPRESSED are Kconfig options. Select them by CONFIG_SANDBOX instead of setting them in configs/sandbox.h.
--- arch/Kconfig | 2 ++ include/configs/sandbox.h | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-)
arch/Kconfig +2 -0
@@ -86,6 +86,7 @@ config RISCV config SANDBOX bool "Sandbox" select BOARD_LATE_INIT + select BZIP2 select DM select DM_GPIO select DM_I2C
@@ -94,6 +95,7 @@ config SANDBOX select DM_SERIAL select DM_SPI select DM_SPI_FLASH + select GZIP_COMPRESSED select HAVE_BLOCK_DEVICE select LZO select OF_BOARD_SETUP
include/configs/sandbox.h +0 -3
@@ -114,9 +114,6 @@BOOTENV \ MEM_LAYOUT_ENV_SETTINGS -#define CONFIG_GZIP_COMPRESSED -#define CONFIG_BZIP2 -#ifndef CONFIG_SPL_BUILD #define CONFIG_SYS_IDE_MAXBUS 1#define CONFIG_SYS_ATA_IDE0_OFFSET 0
Signature · 1 line
2.20.1
PATCH 4/4 sandbox: move compression option to Kconfig
Quoted 9 lines · Michael Walle
CONFIG_BZIP2andCONFIG_GZIP_COMPRESSEDareKconfigoptions. Select them byCONFIG_SANDBOXinstead of setting them inconfigs/sandbox.h.Signed-off-by Michael Walle <[email protected]>--- arch/Kconfig | 2 ++ include/configs/sandbox.h | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-)
PATCH 4/4 sandbox: move compression option to Kconfig
In reply to Michael WalleQuoted 5 lines · Michael Walle
CONFIG_BZIP2andCONFIG_GZIP_COMPRESSEDareKconfigoptions. Select them byCONFIG_SANDBOXinstead of setting them inconfigs/sandbox.h.Signed-off-by Michael Walle <[email protected]>Reviewed-by Simon Glass <[email protected]>
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: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200525/9aee05bf/attachment.sig>