summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-03-19 10:54:41 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-03-19 16:19:20 +0100
commit6357b7fdad6b8954e743fc26dd6cc14056d751a7 (patch)
tree409fb556b1b429f2e596957188afb3394f1cc0a0 /commands
parent7c2dbf684bb58a39f3a5aad1a1f1bd11c7b83713 (diff)
downloadbarebox-6357b7fdad6b8954e743fc26dd6cc14056d751a7.tar.gz
barebox-6357b7fdad6b8954e743fc26dd6cc14056d751a7.tar.xz
boot command: only create boot entries from scripts
When given a directory ignore all files that are not shell scripts. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/boot.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/commands/boot.c b/commands/boot.c
index 9c7aa213c3..a54d0d51ec 100644
--- a/commands/boot.c
+++ b/commands/boot.c
@@ -106,6 +106,11 @@ static void bootsource_action(struct menu *m, struct menu_entry *me)
static int bootscript_create_entry(struct blspec *blspec, const char *name)
{
struct blspec_entry *be;
+ enum filetype type;
+
+ type = file_name_detect_type(name);
+ if (type != filetype_sh)
+ return -EINVAL;
be = blspec_entry_alloc(blspec);
be->me.type = MENU_ENTRY_NORMAL;