find-provides.ksyms: factor out the output sorting

To bring it more in line with the implementation in find-requires.ksyms.

Resolves: #2178935
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
This commit is contained in:
Eugene Syromiatnikov 2023-05-22 14:15:23 +02:00
parent 60d6d64fd3
commit a553de1c74
1 changed files with 4 additions and 5 deletions

View File

@ -43,8 +43,7 @@ for module in $(grep -E '/lib/modules/.+\.ko(\.gz|\.bz2|\.xz|\.zst)?$') "$@"; do
| awk \
-v 'dep_pfx='"$dep_pfx" \
--non-decimal-data \
'match($0, /^([0-9a-f]+) A __crc_(.+)/, a) { printf("%s(%s) = 0x%08x\n", dep_pfx, a[2], strtonum("0x" a[1])) }' \
| sort -u
'match($0, /^([0-9a-f]+) A __crc_(.+)/, a) { printf("%s(%s) = 0x%08x\n", dep_pfx, a[2], strtonum("0x" a[1])) }'
else
objdump -t "$module" \
| sed -n 's/^[0-9a-f][0-9a-f]* [gl]...... \(.*\) [0-9a-f][0-9a-f]* __crc_.*$/\1/p' \
@ -66,9 +65,9 @@ for module in $(grep -E '/lib/modules/.+\.ko(\.gz|\.bz2|\.xz|\.zst)?$') "$@"; do
-v 'sectname='"$sectname" \
--non-decimal-data \
'match($0, /^([0-9a-f]+) [gl]...... (.*) [0-9a-f]+ __crc_(.*)$/, a) && a[2] == sectname { printf("%s(%s) = 0x%08s\n", dep_pfx, a[3], substr(sectdata, (strtonum("0x" a[1]) * 2) + 1, 8)) }'
done \
| sort -u
done
fi
[ -z "$tmpfile" ] || rm -f -- "$tmpfile"
done
done \
| sort -k1,1 -u