summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNavya <navyax.bathula@intel.com>2017-05-19 11:04:34 +0530
committerNavya Bathula <navyax.bathula@intel.com>2017-05-22 11:36:51 +0000
commit97ce15b604f05bb22c9b73e4d1d8c5621ce1f825 (patch)
tree2611ce60e6674cb75bc656ca1e6a90a811e9cdda
parentc4d68bc45aa6aa8b7fe39bce206cb17c2cb2d365 (diff)
Placing kernel_debug.sh in kvmfornfv kernel module
This patch includes placing the kernel_debug.sh script in kvmfornfv kernel module as the script consists code purely related to kernel. Change-Id: I7b89e1a192e2ae5c3d0aff037b92f78757032aed Signed-off-by: Navya Bathula <navyax.bathula@intel.com>
-rwxr-xr-xkernel/scripts/kernel_debug.sh16
-rwxr-xr-xkernel/scripts/package/mkspec2
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"