summaryrefslogtreecommitdiff
path: root/lkft-android12-5.10-hikey960
blob: b3401acf6a68ff8b74b98bb5ff8ebe29dada2a72 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash

. $(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

function apply_android_review_mainline_patch(){
    local commit_id=$1 && shift
    local dst_dir="common"
    if [ -n "$1" ]; then
        dst_dir="$1"
    fi

    if [ -d "${dst_dir}" ]; then
        curl_am https://android-git.linaro.org/kernel/common.git/patch/?id=${commit_id} "${dst_dir}"
    else
        echo "${dst_dir} does not exist, skip to apply commit:${commit_id}"
    fi
}

function apply_gerrit_kernel_common_patch(){
    local patch_on_linaro=$1 && shift
    local gerrit_id=$1 && shift
    local dst_dir="common"
    if [ -n "$1" ]; then
        dst_dir="$1"
    fi

    if [ -d "${dst_dir}" ]; then
        if [ -n "${patch_on_linaro}" ] && [ "X${patch_on_linaro}" = "Xfalse" ]; then
            apply --local ${dst_dir} --remote kernel/common ${gerrit_id}
        else
            apply --linaro --local ${dst_dir} --remote kernel/common ${gerrit_id}
        fi
    else
        echo "${dst_dir} does not exist, skip to apply commit:${commit_id}"
    fi
}

function apply_android_review_kernel_common_patch(){
    local gerrit_id=$1 && shift
    local dst_dir="common"
    if [ -n "$1" ]; then
        dst_dir="$1"
    fi
    apply_gerrit_kernel_common_patch true "${gerrit_id}" "${dst_dir}"
}

function apply_google_review_kernel_common_patch(){
    local gerrit_id=$1 && shift
    local dst_dir="common"
    if [ -n "$1" ]; then
        dst_dir="$1"
    fi
    apply_gerrit_kernel_common_patch false "${gerrit_id}" "${dst_dir}"
}
##################################################
################ Linaro hack   ###################
##################################################