diff options
author | Deepti B. Kalakeri <deepti.kalakeri@linaro.org> | 2011-11-09 07:24:15 +0000 |
---|---|---|
committer | Deepti B. Kalakeri <deepti.kalakeri@linaro.org> | 2011-11-09 07:24:15 +0000 |
commit | 1279b6fa40152516ff7e315f530071d2942c8b1d (patch) | |
tree | 028b5d9f81d2280f23d8e9ae4c05c102e8c60f76 /jenkins_maintainers_kernel_build_inst | |
parent | 359a1b4dfe2a3059f65d5bb3d6f0926068edf9d9 (diff) |
Refactor jenkins script to reuse common code
Diffstat (limited to 'jenkins_maintainers_kernel_build_inst')
-rwxr-xr-x | jenkins_maintainers_kernel_build_inst | 77 |
1 files changed, 8 insertions, 69 deletions
diff --git a/jenkins_maintainers_kernel_build_inst b/jenkins_maintainers_kernel_build_inst index 840ae79..5df9031 100755 --- a/jenkins_maintainers_kernel_build_inst +++ b/jenkins_maintainers_kernel_build_inst @@ -10,7 +10,6 @@ trap cleanup EXIT cleanup() { - if test "$matching_remote_trees" = "$remote_tree_alias_name" ; then # Cleaning up remote tree that was added git remote rm "$remote_tree_alias_name" @@ -43,76 +42,16 @@ matching_remote_trees=`git remote -v | grep "$remote_tree_alias_name" | awk '{ p git checkout -b $remote_branch_name $GIT_REMOTE_REF matching_remote_branch=`git branch | grep "$remote_branch_name" | awk -F ' ' '{ print $2}'` -bundle_stream_name=`echo $JOB_NAME | sed -e 's/_.*//' -e 's/\./_/g'` +export rootfs_type +export bundle_stream_name=`echo $JOB_NAME | sed -e 's/_.*//' -e 's/\./_/g'` kernel_config_name=`echo ${kernel_config} | sed -e 's/_defconfig//g'` -kernel_version=`git describe --match='v*' | sed -e 's/^v//'``echo -${kernel_config_name}-linaro-${kernel_flavour} | sed -e 's/_/-/g'` +export kernel_version=`git describe --match='v*' | sed -e 's/^v//'``echo -${kernel_config_name}-linaro-${kernel_flavour} | sed -e 's/_/-/g'` # Below is the list of values that will be used in the json files -log_info=$BUILD_URL"consoleText" -bundle_stream_name_path="/anonymous/ci-$bundle_stream_name/" -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=`dpkg -s gcc-arm-linux-gnueabi | grep Version | cut -d ' ' -f2` >> 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://ci.linaro.org/kernel_hwpack/ >> hwpack_info -echo KERNEL_VERSION=`git describe --match='v*'` >> hwpack_info -echo KERNEL_GIT=$git_remote_url >> hwpack_info -echo KERNEL_COMMIT=`git rev-parse HEAD` >> 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 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 - -rm -f *.deb -cp scripts/package/builddeb scripts/package/builddeb.orig -cp builddeb scripts/package/builddeb -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` - -pkg_dir=$kernel_version"_output_dir" -rm -rf $pkg_dir -mkdir $pkg_dir - +export KERNEL_GIT=$GIT_REMOTE_URL +export KERNEL_COMMIT="`git rev-parse HEAD`" echo "DEBUG: The remote branch: $remote_branch_name will be built now for the commit id $KERNEL_VERSION" -START=$(date +%s) -make ARCH=arm clean mrproper -make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE=arm-linux-gnueabi- $kernel_config -yes "" | make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE=arm-linux-gnueabi- oldconfig - -# 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 -yes "" | make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE=arm-linux-gnueabi- oldconfig -make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE=arm-linux-gnueabi- -j$j_count uImage -make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE=arm-linux-gnueabi- -j$j_count modules -make ARCH=arm O=$pkg_dir KERNELVERSION="$kernel_version" KERNELRELEASE="$kernel_version" CROSS_COMPILE=arm-linux-gnueabi- KBUILD_DEBARCH=armel V=1 deb-pkg -END=$(date +%s) -EXECUTION_TIME_IN_SEC=$(( $END - $START )) +. $WORKSPACE/lci-build-tools/jenkins_common_lib -latest_kernel=`python lci-build-tools/get_latest_slo_hwpack` -latest_hwpack_name=`basename $latest_kernel` -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 -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 +#Calling the function build_instructions which includes the kernel build instructions +build_instructions |