diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-07-22 14:19:51 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-07-26 08:31:36 +0200 |
commit | 13daf78f1fe722163466d333c897d335f400363b (patch) | |
tree | 37c28e69fe7490cee888902c41e5796450d049e6 /commands | |
parent | 80c5692ff883183c346cd089152b564d04c54a27 (diff) | |
download | barebox-13daf78f1fe722163466d333c897d335f400363b.tar.gz barebox-13daf78f1fe722163466d333c897d335f400363b.tar.xz |
boot command: Explicitly complain when boot target list is empty
When no targets to boot are found it can happen that the boot command
just returns silently. Explicitly print a message in this case to give
a clue what might went wrong.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/boot.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/commands/boot.c b/commands/boot.c index e757011026..b774ddcc2a 100644 --- a/commands/boot.c +++ b/commands/boot.c @@ -77,6 +77,11 @@ static int do_boot(int argc, char *argv[]) free(freep); } + if (list_empty(&entries->entries)) { + printf("Nothing bootable found\n"); + return COMMAND_ERROR; + } + if (do_list) { bootsources_list(entries); goto out; |