Skip to content

Commit

Permalink
builddeb: put the dbg files into the correct directory
Browse files Browse the repository at this point in the history
Since the conversion of objtree to use relative pathnames (commit
7e1c047, "kbuild: Use relative path for $(objtree)"), the debug
info files have been ending up in /debian/dbgtmp/ in the regular
linux-image package instead of the debug files package. Fix up the
paths so that the debug files end up in the -dbg package.

This is based on a similar patch by Darrick.

Reported-and-tested-by: "Darrick J. Wong" <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
michal42 committed Aug 26, 2014
1 parent 8e17065 commit 2d08713
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions scripts/package/builddeb
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
rmdir "$tmpdir/lib/modules/$version"
fi
if [ -n "$BUILD_DEBUG" ] ; then
(
cd $tmpdir
for module in $(find lib/modules/ -name *.ko); do
mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
# only keep debug symbols in the debug file
$OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module
# strip original module from debug symbols
$OBJCOPY --strip-debug $module
# then add a link to those
$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module
done
)
for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do
module=lib/modules/$module
mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
# only keep debug symbols in the debug file
$OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/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=$dbg_dir/usr/lib/debug/$module $tmpdir/$module
done
fi
fi

Expand Down

0 comments on commit 2d08713

Please sign in to comment.