blob: 4bbc1f365b7188660b8117f4a66403511d550bf9 (
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
#!/bin/bash
set -e
source "${BUILD_SCRIPT_ROOT}"/helpers
setup-repo-vars
#Translate
# https://android-build.linaro.org/jenkins/job/doanac_build-script-generation/6/
# into
# http://snapshots.linaro.org/android/~doanac/build-script-generation/6/
SNAPSHOT_URL=${BUILD_URL/http*jenkins\/job\//http://snapshots.linaro.org/android/~}
# change the dash in doanac_build... to doanac/build...
SNAPSHOT_URL=${SNAPSHOT_URL/_/\/}
header()
{
cat <<EOF
#!/bin/bash
set -e
EXACT=1
DIR=linaro-kernel
CPUS=\`grep -c processor /proc/cpuinfo\`
usage()
{
echo 'Usage: \$0 [ -t -d directory ]'
echo " -t Reproduce the from the tip of the branch rather than doing"
echo " an exact replica build"
echo " -d <directory> The directory to download code and build from"
echo " Default: \${DIR}"
exit 1
}
while getopts "d:ht" optn; do
case \$optn in
d ) DIR=\$OPTARG;;
t ) EXACT=0;;
h ) usage; exit 1;;
esac
done
EOF
}
sync_commands()
{
GITINFO=`PYTHONPATH=../.repo/repo ${BUILD_SCRIPT_ROOT}/repo_project_info.py -d ../`
GITURL=`echo $GITINFO | cut -d\| -f1`
GITREV=`echo $GITINFO | cut -d\| -f2`
cat <<EOF
# download the kernel
if [ -d \${DIR} ] ; then
echo "Directory \${DIR} exists. If the kernel code exists in this directory you may continue without cloning the git repository for the kernel. Are you sure you want to do this? (y/n) "
read CONTINUE
[ \${CONTINUE} == y ] || exit 1
else
git clone $GITURL \$DIR
fi
cd \$DIR
git checkout $GITREV
# download the kernel config
curl -q $SNAPSHOT_URL/kernel_config > linaro_kernel_config
EOF
}
build_commands()
{
cat <<EOF
# build the code
CROSS_COMPILE=\`which arm-linux-gnueabi-gcc |sed -e 's,gcc,,'\`
[ -d out ] || mkdir out
[ -f out/.config ] || cp linaro_kernel_config out/.config
make -j\${CPUS} O=out ARCH=arm CROSS_COMPILE=\$CROSS_COMPILE uImage modules
mkdir out/modules_for_android
make O=out ARCH=arm modules_install INSTALL_MOD_PATH=modules_for_android
EOF
}
{
header
sync_commands
build_commands
} > linaro_kernel_build_cmds.sh
chmod +x linaro_kernel_build_cmds.sh
|