summaryrefslogtreecommitdiff
path: root/jenkins_kernel_build_inst
diff options
context:
space:
mode:
authordeeptik <deepti.kalakeri@linaro.org>2011-08-26 13:17:40 +0000
committerdeeptik <deepti.kalakeri@linaro.org>2011-08-26 13:17:40 +0000
commit3d3507c0cac4caed2ffadc2f483ab6bf6beb9e64 (patch)
tree1c1fb0704ef913a87602e8be2dc68916c175609d /jenkins_kernel_build_inst
parent993fdf4091480563fbc3ee95521d0a486be528cc (diff)
Adding jenkins job kernel build and testing scripts
Diffstat (limited to 'jenkins_kernel_build_inst')
-rwxr-xr-xjenkins_kernel_build_inst59
1 files changed, 59 insertions, 0 deletions
diff --git a/jenkins_kernel_build_inst b/jenkins_kernel_build_inst
new file mode 100755
index 0000000..877a356
--- /dev/null
+++ b/jenkins_kernel_build_inst
@@ -0,0 +1,59 @@
+#! /bin/sh
+# kernel_config='omap2plus_defconfig'
+# export board_type='panda'
+# kernel_flavour='omap4'
+# rootfs_type='nano'
+set -x
+
+START=$(date +%s)
+kernel_config=$1
+export board_type=$2 # This needs to be exported, so that it is available as a env var to the scripts
+kernel_flavour=$3
+rootfs_type=$4
+bundle_stream_name=`echo $JOB_NAME | sed -e 's/_.*//' -e 's/\./_/g'`
+kernel_version=`git describe --match='v*' | sed -e 's/^v//'``echo -${kernel_config}-${kernel_flavour} | sed -e 's/_/-/g'`
+cpu_count=`cat /proc/cpuinfo | grep processor | wc -l`
+if test x$cpu_count = x; then
+ cpu_count=1
+fi
+j_count=`expr $cpu_count '*' 2`
+
+rm -f ../linux-image*${kernel_version}*.deb
+rm -f linux-image*${kernel_version}*.deb
+cp scripts/package/builddeb scripts/package/builddeb.orig
+cp builddeb scripts/package/builddeb
+make ARCH=arm KERNELVERSION="$kernel_version" CROSS_COMPILE=arm-linux-gnueabi- $kernel_config
+make ARCH=arm KERNELVERSION="$kernel_version" CROSS_COMPILE=arm-linux-gnueabi- -j$j_count uImage
+make ARCH=arm KERNELVERSION="$kernel_version" CROSS_COMPILE=arm-linux-gnueabi- -j$j_count modules
+make ARCH=arm KERNELVERSION="$kernel_version" CROSS_COMPILE=arm-linux-gnueabi- KBUILD_DEBARCH=armel V=1 deb-pkg
+END=$(date +%s)
+EXECUTION_TIME_IN_SEC=$(( $END - $START ))
+latest_kernel=`python ci_scripts_for_kb/get_latest_slo_hwpack`
+latest_hwpack_name=`basename $latest_kernel`
+cp ../linux-image*${kernel_version}*.deb .
+wget -c $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`
+use_hwpack_name=`basename $new_hwpack_name`
+log_info=$BUILD_URL"consoleText"
+# Below is the list of values that will be used in the json files
+echo > hwpack_info # start with empty
+echo KERNEL_CONFIG=$kernel_config >> hwpack_info
+echo EXECUTION_TIME_IN_SEC=$(( $END - $START )) >> 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 HWPACK_NAME=$use_hwpack_name >> hwpack_info
+echo URL=$JENKINS_HOME/jobs/$JOB_NAME/workspace/$use_hwpack_name >> 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=`dpkg -s gcc-arm-linux-gnueabi | grep Version | cut -d ' ' -f2` >> hwpack_info
+echo BOARD_TYPE=$board_type >> hwpack_info
+echo ROOTFS_TYPE=$rootfs_type >> hwpack_info
+echo BUNDLE_STREAM_NAME="/anonymous/ci-$bundle_stream_name/" >> hwpack_info
+echo JOB_URL=http://ci.linaro.org/kernel_hwpack/ >> hwpack_info
+echo KERNEL_VERSION=$kernel_version >> hwpack_info
+echo KERNEL_GIT=$GIT_BRANCH >> hwpack_info
+echo KERNEL_COMMIT=$GIT_COMMIT >> hwpack_info
+echo COMMIT_TIME=`git show -s --format=%cD HEAD` >> hwpack_info
+echo KERNEL_NAME=$BUNDLE_STREAM_NAME >> hwpack_info