Browse Source

Add ADK_CUSTOM_TASKS_DIR variable to point to external tasks

dir 6 years ago
parent
commit
4f64194c55
3 changed files with 15 additions and 5 deletions
  1. 3 2
      docs/common-usage.txt
  2. 3 1
      docs/using.txt
  3. 9 2
      scripts/create-menu

+ 3 - 2
docs/common-usage.txt

@@ -69,12 +69,14 @@ Environment variables
 OpenADK also honors some environment variables, when they are passed
 to +make+.
 
-* +ADK_APPLIANCE+, the appliance task you want to build 
+* +ADK_APPLIANCE+, the appliance task you want to build
+* +ADK_CUSTOM_TASKS_DIR+, extra directory to fetch tasks from
 * +ADK_TARGET_ARCH+, the architecture of the target system
 * +ADK_TARGET_SYSTEM+, the embedded target system name
 * +ADK_TARGET_LIBC+, the C library for the target system
 * +ADK_VERBOSE+, verbose build, when set to 1
 
+
 An example that creates a configuration file for Raspberry PI with all
 software packages enabled, but not included in the resulting firmware image:
 
@@ -84,4 +86,3 @@ software packages enabled, but not included in the resulting firmware image:
 
 This is often used in the development process of a target system, to verify that
 all packages are compilable.
-

+ 3 - 1
docs/using.txt

@@ -35,7 +35,9 @@ image::openadk-task.png[]
 
 If you want to compile some predefined appliance tasks, you can select it in +Tasks+.
 You can later simply add your own tasks, which is a collection of options, packages,
-kernel modules or features, runtime configuration and more.
+kernel modules or features, runtime configuration and more. They can either be placed
+inside the +tasks+ directory or in your own custom directory that you pass via
++ADK_CUSTOM_TASKS_DIR+ to make.
 
 When you are ready exit and save. You can always redefine the
 configuration using +make menuconfig+.

+ 9 - 2
scripts/create-menu

@@ -12,11 +12,18 @@ printf "source target/config/Config.in.system.default\n" >> target/config/Config
 printf "source target/config/Config.in.system.choice\n" >> target/config/Config.in.system
 
 # update tasks
-if [ -d "$topdir/tasks" ];then
+if [ -d "$topdir/tasks" -o -n "$ADK_CUSTOM_TASKS_DIR" ];then
 	printf "# autogenerated via scripts/create-menu\n" > $topdir/target/config/Config.in.tasks
 	printf "menu \"Tasks\"\n" >> $topdir/target/config/Config.in.tasks
 	printf "\tvisible if ADK_TARGET_OS_LINUX && !ADK_TARGET_CHOOSE_ARCH\n\n" >> $topdir/target/config/Config.in.tasks
-	cat $topdir/tasks/* >> $topdir/target/config/Config.in.tasks 2>/dev/null
+
+        if [ -d "$topdir/tasks" ];then
+        	cat $topdir/tasks/* >> $topdir/target/config/Config.in.tasks 2>/dev/null
+        fi
+        if [ -n "$ADK_CUSTOM_TASKS_DIR" -a -d "$ADK_CUSTOM_TASKS_DIR" ];then
+        	printf "\n# tasks pulled from ADK_CUSTOM_TASKS_DIR='%s'\n" "$ADK_CUSTOM_TASKS_DIR" >> $topdir/target/config/Config.in.tasks
+        	cat $ADK_CUSTOM_TASKS_DIR/* >> $topdir/target/config/Config.in.tasks 2>/dev/null
+        fi
 	printf "\nendmenu\n\n" >> $topdir/target/config/Config.in.tasks
 fi