diff options
author | Jiang, Yunhong <yunhong.jiang@intel.com> | 2017-05-23 18:04:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-05-23 18:04:21 +0000 |
commit | 8d94a940b92c834e7ae59b0a70a9efabe506449a (patch) | |
tree | ecd9c7b0f4c74bf742c97e2a10932895da2d0005 /kernel | |
parent | 0f6296e038b5c299654d596026e7bee5aa723e56 (diff) | |
parent | 97ce15b604f05bb22c9b73e4d1d8c5621ce1f825 (diff) |
Merge "Placing kernel_debug.sh in kvmfornfv kernel module"
Diffstat (limited to 'kernel')
-rwxr-xr-x | kernel/scripts/kernel_debug.sh | 16 | ||||
-rwxr-xr-x | kernel/scripts/package/mkspec | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/kernel/scripts/kernel_debug.sh b/kernel/scripts/kernel_debug.sh new file mode 100755 index 000000000..5ccf1af76 --- /dev/null +++ b/kernel/scripts/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 diff --git a/kernel/scripts/package/mkspec b/kernel/scripts/package/mkspec index 0f96d4f8d..401b948ba 100755 --- a/kernel/scripts/package/mkspec +++ b/kernel/scripts/package/mkspec @@ -92,7 +92,7 @@ echo "%endif" echo 'mkdir -p $RPM_BUILD_ROOT'"/lib/firmware/$KERNELRELEASE" echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{?_smp_mflags} KBUILD_SRC= mod-fw= modules_install' -echo '/opt/kvmfornfv/ci/kernel_debug.sh $RPM_BUILD_ROOT' +echo '$RPM_SOURCE_DIR/scripts/kernel_debug.sh $RPM_BUILD_ROOT' echo 'INSTALL_FW_PATH=$RPM_BUILD_ROOT'"/lib/firmware/$KERNELRELEASE" echo 'make INSTALL_FW_PATH=$INSTALL_FW_PATH' firmware_install echo "%ifarch ia64" |