diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-04-13 15:07:21 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-04-14 15:32:45 +0200 |
commit | ff879a2d4cc73046460e1fc88e5d1251bdc6dd1d (patch) | |
tree | 306a61933aa9bcee764c91db21e3e1ade16deba4 /commands/bootm.c | |
parent | 38a07fb8a943d7d338e6cc662a550d7c371e1131 (diff) | |
download | barebox-ff879a2d4cc73046460e1fc88e5d1251bdc6dd1d.tar.gz barebox-ff879a2d4cc73046460e1fc88e5d1251bdc6dd1d.tar.xz |
bootm: be more informative with oftrees
- print error message when the specified oftree cannot be opened
- move verbose info to top of function so that the information is
printed before something else fails.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/bootm.c')
-rw-r--r-- | commands/bootm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/commands/bootm.c b/commands/bootm.c index 4f174dbc77..1e1dc52ebf 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -154,9 +154,14 @@ static int bootm_open_oftree(struct image_data *data, char *oftree, int num) int ret; size_t size; + if (bootm_verbose(data)) + printf("Loading oftree from '%s'\n", oftree); + ft = file_name_detect_type(oftree); - if ((int)ft < 0) + if ((int)ft < 0) { + printf("failed to open %s: %s\n", oftree, strerror(-(int)ft)); return ft; + } if (ft == filetype_uimage) { #ifdef CONFIG_CMD_BOOTM_OFTREE_UIMAGE @@ -196,9 +201,6 @@ static int bootm_open_oftree(struct image_data *data, char *oftree, int num) file_type_to_string(ft)); } - if (bootm_verbose(data)) - printf("Loading oftree from '%s'\n", oftree); - fdt = xrealloc(fdt, size + 0x8000); fdt_open_into(fdt, fdt, size + 0x8000); |