| #!/bin/bash -ex |
| |
| . $(dirname $0)/functions |
| |
| PATCHES=0 |
| if [ -n "$1" ]; then |
| AOSP="$1" |
| else |
| AOSP="`pwd`" |
| fi |
| |
| if ! [ -d "$AOSP" ] && ! [ -d "$AOSP/bionic" ] && [ -d "$AOSP"/build ]; then |
| echo "This script must be run from the AOSP source directory" |
| echo "or with the AOSP source directory as its first parameter." |
| exit 1 |
| fi |
| |
| ################################################## |
| ################ Linaro hack ################### |
| ################################################## |
| url_lts_rc="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git" |
| |
| function merge_lts_rc(){ |
| local dir_local=$1 && shift |
| local branch_rc=$1 && shift |
| |
| cd ${dir_local} |
| remote_name="linux-stabe-rc" |
| git remote | grep ${remote_name} && git remote remove ${remote_name} |
| git remote add -t ${branch_rc} ${remote_name} ${url_lts_rc} && \ |
| git fetch ${remote_name} && \ |
| if ! git merge --no-edit remotes/${remote_name}/${branch_rc};then |
| git status |
| git diff |
| false |
| fi |
| cd - |
| } |
| |
| if [ -z "${BUILD_KERNEL_SRC_DIR}" ]; then |
| echo "BUILD_KERNEL_SRC_DIR is not specified" |
| echo "Please check and try again" |
| exit 1 |
| fi |
| if [ -z "${KERNEL_BRANCH_LTS_RC}" ]; then |
| echo "Please specify KERNEL_BRANCH_LTS_RC in the configs" |
| exit 1 |
| fi |
| merge_lts_rc "${BUILD_KERNEL_SRC_DIR}" ${KERNEL_BRANCH_LTS_RC} |
| |
| if [ -n "${BUILD_USE_KERNEL_GKI}" ] && ${BUILD_USE_KERNEL_GKI}; then |
| DIR_GKI_SRC=common |
| [ -n "${BUILD_KERNEL_GKI_SRC_DIR}" ] && DIR_GKI_SRC=${BUILD_KERNEL_GKI_SRC_DIR} |
| merge_lts_rc "${DIR_GKI_SRC}" ${KERNEL_BRANCH_LTS_RC} |
| fi |