blob: 9300397c6310590f5086fa8a97bb6af8acc280e5 (
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
#!/bin/bash
# Global Variables
bundle_stream_name_path="/private/team/linaro/ci-$bundle_stream_name/"
log_info=$BUILD_URL"consoleText"
pkg_dir=$kernel_version"_output_dir"
echo > hwpack_info # start with empty
echo KERNEL_CONFIG=$kernel_config >> hwpack_info
echo OS_INFO=`cat /etc/lsb-release | grep DISTRIB_DESCRIPTION | cut -d '=' -f 2` >> hwpack_info
echo LOG=$log_info >> hwpack_info
echo BUILD_ID=$BUILD_NUMBER >> hwpack_info
echo GCC_VERSION=`dpkg -s gcc | grep Version | cut -d ' ' -f2` >> hwpack_info
echo GCC_CROSS_COMPILER=$gcc_cc_version >> hwpack_info
echo BOARD_TYPE=$board_type >> hwpack_info
echo HWPACK_TYPE=$hwpack_type >> hwpack_info
echo ROOTFS_TYPE=$rootfs_type >> hwpack_info
echo BUNDLE_STREAM_NAME=$bundle_stream_name_path >> hwpack_info
echo JOB_URL=http://snapshots.linaro.org/kernel-hwpack/ >> hwpack_info
echo KERNEL_VERSION=`git describe --match='v*'` >> hwpack_info
echo KERNEL_GIT=$KERNEL_GIT >> hwpack_info
echo KERNEL_COMMIT=$KERNEL_COMMIT >> hwpack_info
echo COMMIT_TIME=`git show -s --format=%cD HEAD` >> hwpack_info
echo KERNEL_NAME=$bundle_stream_name >> hwpack_info
echo SUBMIT_LAVA_JOB=$submit_job >> hwpack_info
echo LAVA_TEST_PLAN=$lava_test_plan >> hwpack_info
echo KERNEL_BUILD_URL=$BUILD_URL >> hwpack_info
echo KERNEL_BRANCH=`git branch | grep -e '*' | cut -d '*' -f 2` >> hwpack_info
echo KERNEL_JOB_NAME=$JOB_NAME >> hwpack_info
echo GIT_LOG=`git log -n1 --pretty=oneline` >> hwpack_info
echo GIT_WEB_URL=$git_web_url >> hwpack_info
if test -n "$device_tags"; then
echo DEVICE_TAGS=$device_tags >> hwpack_info
fi
build_setup()
{
rm -f *.deb
# The builddeb has the changes to successfully build for armhf in linux-linaro-tracking tree.
# Hence copy the modified builddeb for other trees only, which is required to do armhf builds.
repo_name="linux-linaro-tracking"
if [[ ! "$KERNEL_GIT" =~ "$repo_name" ]]
then
if [[ -e $WORKSPACE/lci-build-tools/build-scripts/builddeb ]]
then
echo "Copying the local builddeb..."
cp scripts/package/builddeb scripts/package/builddeb.orig
cp $WORKSPACE/lci-build-tools/build-scripts/builddeb scripts/package/builddeb
else
echo "Missing builddeb file"
fi
else
echo "Using the builddeb available in the tree..."
fi
cpu_count=`cat /proc/cpuinfo | grep processor | wc -l`
if test x$cpu_count = x; then
cpu_count=1
fi
export j_count=`expr $cpu_count '*' 2`
rm -rf $pkg_dir
mkdir $pkg_dir
}
create_config_using_config_fragments() {
ARCH=arm scripts/kconfig/merge_config.sh "$conf_filenames"
for cname in `find . -name \.config `
do
mv $cname $WORKSPACE/$pkg_dir/
done
}
build_instructions()
{
# Calling the function build setup to create build env
build_setup
START=$(date +%s)
if test $use_config_fragment -eq 1 ; then
create_config_using_config_fragments
echo "CONFIG_MODULES=y" >> $WORKSPACE/$pkg_dir/.config
make ARCH=arm clean mrproper
else
make ARCH=arm clean mrproper
make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" $kernel_config
# Enabling the THUMB2 kernel option as the THUMB kernel does not seem to work
# well with THUMB2 userspace. This fixes the reboot issue(bug: 860556) we have seen
# for THUMB Kernel working with THUMB2 userspace.
echo "CONFIG_ARCH_OMAP2=n" >> $WORKSPACE/$pkg_dir/.config
echo "CONFIG_THUMB2_KERNEL=y" >> $WORKSPACE/$pkg_dir/.config
fi
yes "" | make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" oldconfig
make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" -j$j_count uImage
make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" -j$j_count modules
if [ "$MAKE_DTBS" = "true" ]; then
echo "Building with DTBS support..."
make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" dtbs
fi
make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE="$TOOLCHAIN_PREFIX" KBUILD_DEBARCH=armhf V=1 deb-pkg
END=$(date +%s)
EXECUTION_TIME_IN_SEC=$(( $END - $START ))
latest_kernel=`python lci-build-tools/get_latest_slo_hwpack`
latest_hwpack_name=`basename $latest_kernel`
python lci-build-tools/download_file $latest_kernel
rm -rf linaro-image-tools
bzr branch lp:linaro-image-tools
new_hwpack_name=`python linaro-image-tools/linaro-hwpack-replace -t $latest_hwpack_name -p ./linux-image*${kernel_version}*.deb -r linux-image -n $BUILD_NUMBER`
use_hwpack_name=`basename $new_hwpack_name`
echo HWPACK_NAME=$use_hwpack_name >> hwpack_info
echo URL=$JENKINS_HOME/jobs/$JOB_NAME/workspace/$use_hwpack_name >> hwpack_info
echo EXECUTION_TIME_IN_SEC=$(( $END - $START )) >> hwpack_info
echo HWPACK_BUILD_DATE=`echo $use_hwpack_name | cut -d '_' -f3` >>hwpack_info
rm -rf $latest_hwpack_name
# Restore the orig buildeb, which was copied to build non linux-linaro-tracking tree
repo_name="linux-linaro-tracking"
if [[ ! "$KERNEL_GIT" =~ "$repo_name" ]]
then
if [[ -e scripts/package/builddeb.orig ]]
then
echo "Copying back the builddeb that was replaced.."
cp scripts/package/builddeb.orig scripts/package/builddeb
fi
fi
}
|