summaryrefslogtreecommitdiff
path: root/lkft-merge-linux-stable-rc
blob: bfcca57f9a78ee1fcf59405b11ad1ad5ac2a243e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/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