aboutsummaryrefslogtreecommitdiffstats
path: root/INSTALL/setup_image.sh
diff options
context:
space:
mode:
Diffstat (limited to 'INSTALL/setup_image.sh')
-rwxr-xr-xINSTALL/setup_image.sh39
1 files changed, 29 insertions, 10 deletions
diff --git a/INSTALL/setup_image.sh b/INSTALL/setup_image.sh
index b7df59d..7f2099b 100755
--- a/INSTALL/setup_image.sh
+++ b/INSTALL/setup_image.sh
@@ -33,6 +33,9 @@ fi
# source variables in conf file
. $INSTDIR/image.conf
+# source flavour config file (generated by top Makefile)
+. $INSTDIR/flavour.conf
+
################################## install docker endpoint #####################
# install the entrypoint script in /usr/bin
@@ -80,16 +83,32 @@ ln -sf ../usr/share/zoneinfo/$TIMEZONE /etc/localtime
################################## run other scripts in turn ##############
-for script in $INSTDIR/setup.d/*; do
- case $(basename $script) in
- [0-9][0-9]_*)
- echo "--------------------- start script $script ---------------------"
- . $script
- echo "--------------------- end of script $script ---------------------"
- ;;
- *)
- ;;
- esac
+function enumerate_tasks() {
+ for script in $INSTDIR/common.d/*; do
+ case $(basename $script) in
+ [0-9][0-9]_*)
+ echo $(basename $script):$script
+ ;;
+ esac
+ done
+
+ for tsk in $(cat $INSTDIR/flavours/$FLAVOUR.tasks | sed 's/#.*$//g'); do
+ if [[ -f $INSTDIR/tasks.d/$tsk ]]; then
+ echo $tsk:$INSTDIR/tasks.d/$tsk
+ else
+ # fail to find task
+ echo "$INSTDIR/flavours/$FLAVOUR.tasks: invalid task '$tsk'" >&2
+ return 1
+ fi
+ done
+ return 0
+}
+
+
+for script in $(enumerate_tasks | sort -k1 -t':' | cut -f2 -d':'); do
+ echo "--------------------- start script $script ---------------------"
+ . $script
+ echo "--------------------- end of script $script ---------------------"
done
############################### cleanup ###################################