summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-09-23 21:32:20 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-09-24 08:46:40 +0200
commitd424ce77f5e9295584252452dbd78eea562c9af0 (patch)
tree8a1ded02eb19e0d41c9738958f33a59e5c8f63f7 /commands
parent0ceafe14be072696eff3e549d8c7b7de8a3e416d (diff)
downloadbarebox-d424ce77f5e9295584252452dbd78eea562c9af0.tar.gz
barebox-d424ce77f5e9295584252452dbd78eea562c9af0.tar.xz
image: factorise image printing contents
before we duplicate it between command/bootm.c and scripts/mkimage.c Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/bootm.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/commands/bootm.c b/commands/bootm.c
index 98047cda69..83d36d3e2e 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -203,7 +203,7 @@ struct image_handle *map_image(const char *filename, int verify)
puts ("OK\n");
}
- print_image_hdr(header);
+ image_print_contents(header);
close(fd);
@@ -451,50 +451,6 @@ BAREBOX_CMD(
#endif /* CONFIG_CMD_IMI */
-void
-print_image_hdr (image_header_t *hdr)
-{
-#if defined(CONFIG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
- time_t timestamp = (time_t)image_get_time(hdr);
- struct rtc_time tm;
-#endif
-
- printf (" Image Name: %.*s\n", IH_NMLEN, image_get_name(hdr));
-#if defined(CONFIG_CMD_DATE) || defined(CONFIG_TIMESTAMP)
- to_tm (timestamp, &tm);
- printf (" Created: %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 /* CONFIG_CMD_DATE, CONFIG_TIMESTAMP */
-#ifdef CONFIG_CMD_BOOTM_SHOW_TYPE
- printf (" Image Type: %s %s %s (%s)\n",
- image_get_arch_name(image_get_arch(hdr)),
- image_get_os_name(image_get_os(hdr)),
- image_get_type_name(image_get_type(hdr)),
- image_get_comp_name(image_get_comp(hdr)));
-#endif
- printf (" Data Size: %d Bytes = %s\n"
- " Load Address: %08x\n"
- " Entry Point: %08x\n",
- image_get_size(hdr),
- size_human_readable(image_get_size(hdr)),
- image_get_load(hdr),
- image_get_ep(hdr));
-
- if (image_check_type(hdr, IH_TYPE_MULTI)) {
- int i;
- uint32_t len;
- uint32_t *len_ptr = (uint32_t *)((ulong)hdr + image_get_header_size());
-
- puts (" Contents:\n");
- for (i=0; len_ptr[i]; ++i) {
- len = ntohl(len_ptr[i]);
- printf (" Image %d: %8ld Bytes = %s", i, len,
- size_human_readable (len));
- }
- }
-}
-
#ifdef CONFIG_BZLIB
void bz_internal_error(int errcode)
{