diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-10-07 14:09:21 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-10-07 14:09:21 +0200 |
commit | 884f4d47c697b825a7e69fe51d3b409be58da5d0 (patch) | |
tree | 24226d1678b57d7a58947fe8899b41facf630878 /commands | |
parent | 656f0370c1a572996fd8c7e284f7052aae89ccb1 (diff) | |
download | barebox-884f4d47c697b825a7e69fe51d3b409be58da5d0.tar.gz barebox-884f4d47c697b825a7e69fe51d3b409be58da5d0.tar.xz |
Revert "image: factorise image printing contents"
This reverts commit d424ce77f5e9295584252452dbd78eea562c9af0.
Diffstat (limited to 'commands')
-rw-r--r-- | commands/bootm.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/commands/bootm.c b/commands/bootm.c index 83d36d3e2e..98047cda69 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"); } - image_print_contents(header); + print_image_hdr(header); close(fd); @@ -451,6 +451,50 @@ 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) { |