aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Veit <claymore1298@gmail.com>2019-11-08 14:19:58 +0100
committerAli B <abittin@gmail.com>2019-12-20 18:05:32 +0100
commit8edb2f09c4f0cbd3a80ea7094535466dd1eb7b67 (patch)
treebeae32c4c31841d267c3b906c5bde0b00e1e83cd
parent0f50b073d7df5b7ae97b242ad21d823ccc5a8d91 (diff)
build: add pre_scripts.txt mechanism [1/2]q10.0-backup
Add a mechanismus to execute script on breakfast command. If the env variable AICP_EXEC_PRE_SCRIPT is set - the scripts are also executed on lunch command. The mechanism check, if the script pre_scripts.txt exist in device tree and execute the listed scripts. Change-Id: I023d7b5f7fee701c73b62fcc5d85809120b8b1a2
-rw-r--r--envsetup.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 4b29460384..611c4e1f29 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -331,6 +331,27 @@ function printconfig()
get_build_var report_config
}
+function execaicpscripts()
+{
+ getdevice=$(echo $TARGET_PRODUCT | cut -d "_" -f2)
+ devicepath=$(find device/ -name $getdevice -type d)
+ exec_script_location=$devicepath/pre_scripts.txt
+ if [ -f $exec_script_location ];then
+ echo -e "\npre script configuration: $exec_script_location found"
+ while read each_script
+ do
+ if [ -x $each_script ];then
+ echo "executing pre script: $each_script"
+ $each_script
+ else
+ echo "pre script: $each_script is not existent or executable"
+ fi
+ done < $exec_script_location
+ fi
+
+ unset $getdevice
+ unset $each_script
+}
function set_stuff_for_environment()
{
setpaths
@@ -699,6 +720,7 @@ function lunch()
set_stuff_for_environment
printconfig
+ [ $AICP_EXEC_PRE_SCRIPT ] && execaicpscripts
destroy_build_var_cache
}