From a780fd175934f6202fa9e0731b6a551d15763162 Mon Sep 17 00:00:00 2001 From: Andriy Gudz Date: Mon, 15 May 2017 17:58:18 +0300 Subject: [PATCH] Changed build/deploy scripts --- device_core/scripts/.gitignore | 1 + device_core/scripts/build-kantm.sh | 6 ------ device_core/scripts/build-tm1.sh | 6 ------ device_core/scripts/build-tm2.sh | 6 ------ device_core/scripts/build.sh | 43 ++++++++++++++++++++++++++++++++----- device_core/scripts/deploy-kantm.sh | 6 ------ device_core/scripts/deploy-tm1.sh | 6 ------ device_core/scripts/deploy-tm2.sh | 6 ------ device_core/scripts/deploy.sh | 38 +++++++++++++++++++++++++++++--- 9 files changed, 74 insertions(+), 44 deletions(-) create mode 100644 device_core/scripts/.gitignore delete mode 100755 device_core/scripts/build-kantm.sh delete mode 100755 device_core/scripts/build-tm1.sh delete mode 100755 device_core/scripts/build-tm2.sh delete mode 100755 device_core/scripts/deploy-kantm.sh delete mode 100755 device_core/scripts/deploy-tm1.sh delete mode 100755 device_core/scripts/deploy-tm2.sh diff --git a/device_core/scripts/.gitignore b/device_core/scripts/.gitignore new file mode 100644 index 0000000..9c5e689 --- /dev/null +++ b/device_core/scripts/.gitignore @@ -0,0 +1 @@ +.device \ No newline at end of file diff --git a/device_core/scripts/build-kantm.sh b/device_core/scripts/build-kantm.sh deleted file mode 100755 index 7f0db96..0000000 --- a/device_core/scripts/build-kantm.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -SCRIPT_PATH=$(readlink -m ${0}) -SCRIPT_DIR=${SCRIPT_PATH%/*} - -${SCRIPT_DIR}/build.sh 2 $* diff --git a/device_core/scripts/build-tm1.sh b/device_core/scripts/build-tm1.sh deleted file mode 100755 index f726007..0000000 --- a/device_core/scripts/build-tm1.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -SCRIPT_PATH=$(readlink -m ${0}) -SCRIPT_DIR=${SCRIPT_PATH%/*} - -${SCRIPT_DIR}/build.sh 1 $* diff --git a/device_core/scripts/build-tm2.sh b/device_core/scripts/build-tm2.sh deleted file mode 100755 index 4da75c1..0000000 --- a/device_core/scripts/build-tm2.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -SCRIPT_PATH=$(readlink -m ${0}) -SCRIPT_DIR=${SCRIPT_PATH%/*} - -${SCRIPT_DIR}/build.sh 0 $* diff --git a/device_core/scripts/build.sh b/device_core/scripts/build.sh index 783f9a2..d67afde 100755 --- a/device_core/scripts/build.sh +++ b/device_core/scripts/build.sh @@ -1,10 +1,41 @@ #!/bin/bash +SCRIPT_PATH=$(readlink -m ${0}) +SCRIPT_DIR=${SCRIPT_PATH%/*} +ROOT_DIR=${SCRIPT_DIR}/.. +DEVICE_TEMP=${SCRIPT_DIR}/.device + if [ -z "$1" ]; then - DEVICE=0 + if [ ! -e "$DEVICE_TEMP" ] ; then + DEVICE=1 + else + DEVICE=`cat $DEVICE_TEMP` + fi else DEVICE=$1 fi +echo "$DEVICE" > $DEVICE_TEMP + +GREEN='\033[0;32m' +NC='\033[0m' + +declare -a DEVICE_ARRAY=( +"TM2 mobile" +"TM1 mobile" +"Kant TV" +) + +arraylength=${#DEVICE_ARRAY[@]} +for (( i=0; i<${arraylength}; i++ )); +do + if [ $i -eq $DEVICE ]; then + echo -e "${GREEN}$i) ${DEVICE_ARRAY[$i]}${NC}" + else + echo "$i) ${DEVICE_ARRAY[$i]}" + fi +done +echo -e "\n\n" + case $DEVICE in 0) PROFILE=profile.tzmb_3.0_TM2 ; TARGET_ARCH=aarch64 ; GTEST_TYPE="main" ;; @@ -13,9 +44,11 @@ case $DEVICE in ?) echo "error: unknown DEVICE number"; exit 1 ;; esac -SCRIPT_PATH=$(readlink -m ${0}) -SCRIPT_DIR=${SCRIPT_PATH%/*} -ROOT_DIR=${SCRIPT_DIR}/.. + + + + + for ARG in $* do @@ -30,7 +63,7 @@ cd $ROOT_DIR #init git repo for GBS git init -git add . +git add CMakeLists.txt git commit -m "commit needed for GBS" # trap ctrl-c and call ctrl_c() diff --git a/device_core/scripts/deploy-kantm.sh b/device_core/scripts/deploy-kantm.sh deleted file mode 100755 index 2512ddd..0000000 --- a/device_core/scripts/deploy-kantm.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -SCRIPT_PATH=$(readlink -m ${0}) -SCRIPT_DIR=${SCRIPT_PATH%/*} - -${SCRIPT_DIR}/deploy.sh 2 $* diff --git a/device_core/scripts/deploy-tm1.sh b/device_core/scripts/deploy-tm1.sh deleted file mode 100755 index 7c297cf..0000000 --- a/device_core/scripts/deploy-tm1.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -SCRIPT_PATH=$(readlink -m ${0}) -SCRIPT_DIR=${SCRIPT_PATH%/*} - -${SCRIPT_DIR}/deploy.sh 1 $* diff --git a/device_core/scripts/deploy-tm2.sh b/device_core/scripts/deploy-tm2.sh deleted file mode 100755 index 732fd32..0000000 --- a/device_core/scripts/deploy-tm2.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -SCRIPT_PATH=$(readlink -m ${0}) -SCRIPT_DIR=${SCRIPT_PATH%/*} - -${SCRIPT_DIR}/deploy.sh 0 $* diff --git a/device_core/scripts/deploy.sh b/device_core/scripts/deploy.sh index f8bd9f1..675d648 100755 --- a/device_core/scripts/deploy.sh +++ b/device_core/scripts/deploy.sh @@ -1,10 +1,39 @@ #!/bin/bash +SCRIPT_PATH=$(readlink -m ${0}) +SCRIPT_DIR=${SCRIPT_PATH%/*} +DEVICE_TEMP=${SCRIPT_DIR}/.device + if [ -z "$1" ]; then - DEVICE=0 + if [ ! -e "$DEVICE_TEMP" ] ; then + DEVICE=1 + else + DEVICE=`cat $DEVICE_TEMP` + fi else DEVICE=$1 fi +echo "$DEVICE" > $DEVICE_TEMP + +GREEN='\033[0;32m' +NC='\033[0m' + +declare -a DEVICE_ARRAY=( +"TM2 mobile" +"TM1 mobile" +"Kant TV" +) + +arraylength=${#DEVICE_ARRAY[@]} +for (( i=0; i<${arraylength}; i++ )); +do + if [ $i -eq $DEVICE ]; then + echo -e "${GREEN}$i) ${DEVICE_ARRAY[$i]}${NC}" + else + echo "$i) ${DEVICE_ARRAY[$i]}" + fi +done +echo -e "\n\n" case $DEVICE in 0) BUILD_ROOT=GBS_ROOT_3.0_TM2 ; PROFILE=tzmb_3.0_TM2 ; TARGET_ARCH=aarch64 ;; @@ -13,8 +42,11 @@ case $DEVICE in ?) echo "error: unknown DEVICE number"; exit 1 ;; esac -SCRIPT_PATH="$(readlink -m ${0})" -CONTROL_DIR="${SCRIPT_PATH%/*/*}/scripts" + + + + + GBS_RPMS_DIR=~/${BUILD_ROOT}/local/repos/${PROFILE}/${TARGET_ARCH}/RPMS -- 2.7.4