uImage fixes
cover uImage fixes
Antony Pavlov (2):
uImage: use IS_ENABLED(CONFIG_TIMESTAMP)
common: Kconfig: TIMESTAMP: fix help
common/Kconfig | 7 +++---- common/uimage.c | 22 ++++++++++++---------- fs/uimagefs.c | 24 ++++++++++-------------- 3 files changed, 25 insertions(+), 28 deletions(-)
Signature · 1 line
2.39.0
PATCH 1/2 uImage: use IS_ENABLED(CONFIG_TIMESTAMP)
Signed-off-by Antony Pavlov <[email protected]>
--- common/uimage.c | 22 ++++++++++++---------- fs/uimagefs.c | 24 ++++++++++-------------- 2 files changed, 22 insertions(+), 24 deletions(-)
common/uimage.c +12 -10
@@ -29,17 +29,19 @@ static inline int uimage_is_multi_image(struct uimage_handle *handle)void uimage_print_contents (struct uimage_handle *handle) {struct image_header *hdr = &handle->header; -#if defined(CONFIG_TIMESTAMP ) -struct rtc_time tm; -#endif +printf (" Image Name: %.*s\n" ,IH_NMLEN , hdr->ih_name); -#if defined(CONFIG_TIMESTAMP ) -printf (" Created: " ); -to_tm (hdr->ih_time, &tm); -printf ("%4d-%02d-%02d %2d:%02d:%02d UTC\n" , - tm.tm_year, tm.tm_mon, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec); -#endif + +if (IS_ENABLED (CONFIG_TIMESTAMP )) { +struct rtc_time tm; + +printf (" Created: " ); +to_tm (hdr->ih_time, &tm); +printf ("%4d-%02d-%02d %2d:%02d:%02d UTC\n" , + tm.tm_year, tm.tm_mon, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec); + } +#if defined(CONFIG_BOOTM_SHOW_TYPE )printf (" OS: %s\n" ,image_get_os_name (hdr->ih_os));printf (" Architecture: %s\n" ,image_get_arch_name (hdr->ih_arch));
fs/uimagefs.c +10 -14
@@ -300,28 +300,24 @@ static int uimagefs_add_data_entry(struct uimagefs_handle *priv, size_t offset,return 0 ; } -#if defined(CONFIG_TIMESTAMP )static int uimagefs_add_time (struct uimagefs_handle *priv) {struct image_header *header = &priv->header; -struct rtc_time tm; -char *val; -to_tm (header->ih_time, &tm); - val =basprintf ("%4d-%02d-%02d %2d:%02d:%02d UTC" , - tm.tm_year, tm.tm_mon, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec); +if (IS_ENABLED (CONFIG_TIMESTAMP )) { +struct rtc_time tm; +char *val; -return uimagefs_add_str (priv,UIMAGEFS_TIME , val); -} -#else -static int uimagefs_add_time (struct uimagefs_handle *priv) -{ -struct image_header *header = &priv->header; +to_tm (header->ih_time, &tm); + val =basprintf ("%4d-%02d-%02d %2d:%02d:%02d UTC" , + tm.tm_year, tm.tm_mon, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec); + +return uimagefs_add_str (priv,UIMAGEFS_TIME , val); + }return uimagefs_add_hex (priv,UIMAGEFS_TIME , header->ih_time); } -#endif static int uimagefs_add_os (struct uimagefs_handle *priv) {
Signature · 1 line
2.39.0
PATCH 2/2 common: Kconfig: TIMESTAMP: fix help
In reply to Antony PavlovAt the moment CONFIG_TIMESTAMP help text is inherited from U-Boot. Fix it in accordance with barebox realities.
Signed-off-by Antony Pavlov <[email protected]>
--- common/Kconfig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
common/Kconfig +3 -4
@@ -533,12 +533,11 @@ config TIMESTAMP bool default y select GREGORIAN_CALENDER - prompt "print timestamp information from images" + prompt "print timestamp information from uImages" help When CONFIG_TIMESTAMP is selected, the timestamp - (date and time) of an image is printed by image - commands like bootm or iminfo. This option is - automatically enabled when you select CFG_CMD_DATE . + (date and time) of an uImage is printed by image + commands like bootm or uimage. menuconfig BOOTM select UIMAGE
Signature · 1 line
2.39.0
Sascha Hauer
AppliedQuoted 3 lines · Antony Pavlov
Antony Pavlov (2):
uImage: useIS_ENABLED(CONFIG_TIMESTAMP)
common:Kconfig: TIMESTAMP: fix help
Applied, thanks
Sascha
Quoted 10 lines
common/Kconfig | 7 +++---- common/uimage.c | 22 ++++++++++++---------- fs/uimagefs.c | 24 ++++++++++-------------- 3 files changed, 25 insertions(+), 28 deletions(-)Signature · 1 line
2.39.0
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |