diff options
Diffstat (limited to 'meta/recipes-core/initrdscripts/initramfs-framework/exec')
-rw-r--r-- | meta/recipes-core/initrdscripts/initramfs-framework/exec | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/exec b/meta/recipes-core/initrdscripts/initramfs-framework/exec new file mode 100644 index 0000000000..a8e2432bb6 --- /dev/null +++ b/meta/recipes-core/initrdscripts/initramfs-framework/exec | |||
@@ -0,0 +1,29 @@ | |||
1 | #!/bin/sh | ||
2 | # Copyright (C) 2017 O.S. Systems Software LTDA. | ||
3 | # Licensed on MIT | ||
4 | |||
5 | EXEC_DIR=/exec.d # place to look for modules | ||
6 | |||
7 | exec_enabled() { | ||
8 | return 0 | ||
9 | } | ||
10 | |||
11 | exec_run() { | ||
12 | if [ ! -d $EXEC_DIR ]; then | ||
13 | msg "No contents to exec in $EXEC_DIR. Starting shell ..." | ||
14 | sh | ||
15 | fi | ||
16 | |||
17 | # Load and run modules | ||
18 | for m in $EXEC_DIR/*; do | ||
19 | # Skip backup files | ||
20 | if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then | ||
21 | continue | ||
22 | fi | ||
23 | |||
24 | debug "Starting $m" | ||
25 | |||
26 | # process module | ||
27 | ./$m | ||
28 | done | ||
29 | } | ||