[PATCH 16/18] boot command: Explicitly complain when boot target list is empty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 commands/boot.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/commands/boot.c b/commands/boot.c
index e757011..b774ddc 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;
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux