debuginfo: Show warnings if .debug sections are absent

Actually, `.debug_line` section is checked (implicitly by debugedit)
which should go together with all `.debug_*` sections. This
simplification will make check faster.

Note: Only non-stripped binaries are checked.

Spelling fixes, usage of `Warning' function, and redirect to stderr is
suggested by Dmitry V. Levin <ldv@altlinux.org>.
This commit is contained in:
Виталий Чикунов 2020-08-21 18:37:48 +03:00
parent 0175090680
commit deaca8d8e3
2 changed files with 11 additions and 0 deletions

View File

@ -77,3 +77,13 @@ while read -r l; do
mkdir -p .debuginfo/links/"${debugf%/*}"
printf '%s\n' "${debugl#.}" >>.debuginfo/links/"$debugf"
done <.tmp/flist
if [ -s .tmp/no_debug_info ]; then
howmuch=$(wc -l < .tmp/no_debug_info)
Warning "$howmuch non-stripped binaries don't contain .debug sections making -debuginfo"
Warning "package less relevant. An excerpt from the list of affected files follows:"
sed 's/^/ /; 10q' < .tmp/no_debug_info >&2
if egrep -q '/lib/modules/.*(/vmlinux|\.ko)$' .tmp/no_debug_info; then
Warning "Please enable CONFIG_DEBUG_INFO=y in the kernel package!"
fi
fi

View File

@ -84,6 +84,7 @@ while read -r src; do
fi
printf '%s\n' /usr/src/debug/"$src"
done >.debuginfo/src/"$f"
[ -s .tmp/src.$$ ] || printf '%s\n' "$f" >> .tmp/no_debug_info
rm .tmp/src.$$
if [ -n "$rezip" ]; then