diff options
author | Jiang, Yunhong <yunhong.jiang@intel.com> | 2017-05-15 14:34:57 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-05-15 14:34:57 +0000 |
commit | 4bfeded9ee7ddc1cf05f6bd2c388894a7d736291 (patch) | |
tree | 06448cb2192141adca849d9ccf9b9480df5d7d47 /ci | |
parent | 2bf84b75999440debecf456168a7c3bb0750dd06 (diff) | |
parent | 2fde080c8c418c0474b285b823e9d7f2346f05a3 (diff) |
Merge "To generate debug rpm and debian package for kvmfornfv kernel"
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/build.sh | 17 | ||||
-rwxr-xr-x | ci/kernel_build.sh | 2 | ||||
-rwxr-xr-x | ci/kernel_debug.sh | 16 |
3 files changed, 34 insertions, 1 deletions
diff --git a/ci/build.sh b/ci/build.sh index ef06a716c..a52055940 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -119,6 +119,8 @@ then output_dir=$WORKSPACE/build_output fi +job_type=`echo $JOB_NAME | cut -d '-' -f 2` + echo "" echo "Building for $type package in $output_dir" echo "" @@ -139,3 +141,18 @@ if [ ${apex_build_flag} -eq 1 ];then variable=`ls kvmfornfv-* | grep "devel" | awk -F "_" '{print $3}' | awk -F "." '{print $1}'` rename "s/${variable}/centos/" kvmfornfv-* fi + +# Uploading rpms only for daily job +if [ $job_type == "verify" ]; then + if [ $type == "centos" ]; then + echo "Removing kernel-debuginfo rpm from output_dir" + rm -f ${output_dir}/kernel-debug* + echo "Checking packages in output_dir" + ls -lrth ${output_dir} + else + echo "Removing debug debian from output_dir" + rm -f ${output_dir}/*dbg* + echo "Checking packages in output_dir" + ls -lrth ${output_dir} + fi +fi
\ No newline at end of file diff --git a/ci/kernel_build.sh b/ci/kernel_build.sh index 91e8b7765..6071ca760 100755 --- a/ci/kernel_build.sh +++ b/ci/kernel_build.sh @@ -50,7 +50,7 @@ EOF # Build the kernel debs make-kpkg clean -fakeroot make-kpkg --initrd --revision=$VERSION kernel_image kernel_headers +fakeroot make-kpkg --initrd --revision=$VERSION kernel_image kernel_headers kernel_debug -j$(nproc) make mv /root/kvmfornfv/linux-* /root/kvmfornfv/build_output } diff --git a/ci/kernel_debug.sh b/ci/kernel_debug.sh new file mode 100755 index 000000000..5ccf1af76 --- /dev/null +++ b/ci/kernel_debug.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +tmpdir=$1 #/tmp/kvmfornfv_rpmbuild.1/BUILD/kernel-4.4.50_rt62nfv +OBJCOPY=objcopy +if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then +for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do + module=lib/modules/$module + mkdir -p $(dirname $tmpdir/usr/lib/debug/$module) + # only keep debug symbols in the debug file + $OBJCOPY --only-keep-debug $tmpdir/$module $tmpdir/usr/lib/debug/$module + # strip original module from debug symbols + $OBJCOPY --strip-debug $tmpdir/$module + # then add a link to those + $OBJCOPY --add-gnu-debuglink=$tmpdir/usr/lib/debug/$module $tmpdir/$module + done +fi
\ No newline at end of file |