diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-02-13 20:31:47 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-02-13 20:31:47 +0100 |
commit | 2a17e75a976d11c1712972d29813094b8020ac35 (patch) | |
tree | ea0e991c927752937803d72a5411f7159365aa83 /common/boot.c | |
parent | a5f75fe8175aefec5b7cefaadc5359096c8eb22c (diff) | |
parent | 7185b353c96e1e831533eeaaada06ad9bebf84a2 (diff) | |
download | barebox-2a17e75a976d11c1712972d29813094b8020ac35.tar.gz barebox-2a17e75a976d11c1712972d29813094b8020ac35.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'common/boot.c')
-rw-r--r-- | common/boot.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/common/boot.c b/common/boot.c index 41bf1ce64b..974eaf5d02 100644 --- a/common/boot.c +++ b/common/boot.c @@ -96,8 +96,8 @@ static int bootscript_boot(struct bootentry *entry, int verbose, int dryrun) ret = run_command(bs->scriptpath); if (ret) { - printf("Running %s failed\n", bs->scriptpath); - goto out; + pr_err("Running script '%s' failed: %s\n", bs->scriptpath, strerror(-ret)); + return ret; } bootm_data_init_defaults(&data); @@ -107,11 +107,7 @@ static int bootscript_boot(struct bootentry *entry, int verbose, int dryrun) if (dryrun) data.dryrun = dryrun; - ret = bootm_boot(&data); - if (ret) - pr_err("Booting '%s' failed: %s\n", basename(bs->scriptpath), strerror(-ret)); -out: - return ret; + return bootm_boot(&data); } static unsigned int boot_watchdog_timeout; @@ -135,7 +131,7 @@ int boot_entry(struct bootentry *be, int verbose, int dryrun) { int ret; - printf("booting '%s'\n", be->title); + printf("Booting entry '%s'\n", be->title); if (IS_ENABLED(CONFIG_WATCHDOG) && boot_watchdog_timeout) { ret = watchdog_set_timeout(boot_watchdog_timeout); @@ -144,9 +140,8 @@ int boot_entry(struct bootentry *be, int verbose, int dryrun) } ret = be->boot(be, verbose, dryrun); - if (ret) - printf("booting '%s' failed: %s\n", be->title, strerror(-ret)); + pr_err("Booting entry '%s' failed\n", be->title); return ret; } @@ -154,11 +149,8 @@ int boot_entry(struct bootentry *be, int verbose, int dryrun) static void bootsource_action(struct menu *m, struct menu_entry *me) { struct bootentry *be = container_of(me, struct bootentry, me); - int ret; - ret = boot_entry(be, 0, 0); - if (ret) - printf("Booting failed with: %s\n", strerror(-ret)); + boot_entry(be, 0, 0); printf("Press any key to continue\n"); |