summaryrefslogtreecommitdiffstats
path: root/commands/boot.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-07-22 14:23:57 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-26 08:31:36 +0200
commiteeaed6eee3d4983564e2e737b29de8fded37caf6 (patch)
tree3d5bf84d2ad09ae62cf675b11207170f67851271 /commands/boot.c
parent16dc0b0b488d124e0227de0cd3ddb6f0ff0bb117 (diff)
downloadbarebox-eeaed6eee3d4983564e2e737b29de8fded37caf6.tar.gz
barebox-eeaed6eee3d4983564e2e737b29de8fded37caf6.tar.xz
boot: Print a message when a boot target string does not lead to a boot target
When doing a 'boot friesel net' one expects a message when 'friesel' does not give any bootable results and thus 'net' is booted. This patch adds this message. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/boot.c')
-rw-r--r--commands/boot.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/commands/boot.c b/commands/boot.c
index b774ddcc2a..8b3b407e12 100644
--- a/commands/boot.c
+++ b/commands/boot.c
@@ -59,8 +59,11 @@ static int do_boot(int argc, char *argv[])
entries = bootentries_alloc();
if (optind < argc) {
- for (i = optind; i < argc; i++)
- bootentry_create_from_name(entries, argv[i]);
+ for (i = optind; i < argc; i++) {
+ ret = bootentry_create_from_name(entries, argv[i]);
+ if (ret <= 0)
+ printf("Nothing bootable found on '%s'\n", argv[i]);
+ }
} else {
const char *def;
char *sep, *name;
@@ -71,8 +74,11 @@ static int do_boot(int argc, char *argv[])
sep = freep = xstrdup(def);
- while ((name = strsep(&sep, " ")) != NULL)
- bootentry_create_from_name(entries, name);
+ while ((name = strsep(&sep, " ")) != NULL) {
+ ret = bootentry_create_from_name(entries, name);
+ if (ret <= 0)
+ printf("Nothing bootable found on '%s'\n", name);
+ }
free(freep);
}