Commit 4bb182eb authored by Michal Marek's avatar Michal Marek Committed by Luis Henriques

builddeb: put the dbg files into the correct directory

commit 2d087139 upstream.

Since the conversion of objtree to use relative pathnames (commit
7e1c0477, "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: default avatar"Darrick J. Wong" <darrick.wong@oracle.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 09756c1a
...@@ -152,18 +152,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then ...@@ -152,18 +152,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
rmdir "$tmpdir/lib/modules/$version" rmdir "$tmpdir/lib/modules/$version"
fi fi
if [ -n "$BUILD_DEBUG" ] ; then if [ -n "$BUILD_DEBUG" ] ; then
( for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do
cd $tmpdir module=lib/modules/$module
for module in $(find lib/modules/ -name *.ko); do mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module)
mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module) # only keep debug symbols in the debug file
# only keep debug symbols in the debug file $OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module
$OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module # strip original module from debug symbols
# strip original module from debug symbols $OBJCOPY --strip-debug $tmpdir/$module
$OBJCOPY --strip-debug $module # then add a link to those
# then add a link to those $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module
$OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module done
done
)
fi fi
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment