diff options
-rw-r--r-- | scripts/package/builddeb | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 35d5a5877d04..7c0e6e46905d 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb | |||
@@ -152,18 +152,16 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then | |||
152 | rmdir "$tmpdir/lib/modules/$version" | 152 | rmdir "$tmpdir/lib/modules/$version" |
153 | fi | 153 | fi |
154 | if [ -n "$BUILD_DEBUG" ] ; then | 154 | if [ -n "$BUILD_DEBUG" ] ; then |
155 | ( | 155 | for module in $(find $tmpdir/lib/modules/ -name *.ko -printf '%P\n'); do |
156 | cd $tmpdir | 156 | module=lib/modules/$module |
157 | for module in $(find lib/modules/ -name *.ko); do | 157 | mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module) |
158 | mkdir -p $(dirname $dbg_dir/usr/lib/debug/$module) | 158 | # only keep debug symbols in the debug file |
159 | # only keep debug symbols in the debug file | 159 | $OBJCOPY --only-keep-debug $tmpdir/$module $dbg_dir/usr/lib/debug/$module |
160 | $OBJCOPY --only-keep-debug $module $dbg_dir/usr/lib/debug/$module | 160 | # strip original module from debug symbols |
161 | # strip original module from debug symbols | 161 | $OBJCOPY --strip-debug $tmpdir/$module |
162 | $OBJCOPY --strip-debug $module | 162 | # then add a link to those |
163 | # then add a link to those | 163 | $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $tmpdir/$module |
164 | $OBJCOPY --add-gnu-debuglink=$dbg_dir/usr/lib/debug/$module $module | 164 | done |
165 | done | ||
166 | ) | ||
167 | fi | 165 | fi |
168 | fi | 166 | fi |
169 | 167 | ||