forked from pool/kernel-source
29 lines
596 B
Bash
29 lines
596 B
Bash
#! /bin/bash
|
|
|
|
# these are updated by the spec file
|
|
sourcedir=${0%/*}
|
|
|
|
filelist=$(mktemp -t ${0##*/}.XXXXXXXXXX)
|
|
trap "rm -f $filelist" EXIT
|
|
cat >"$filelist"
|
|
flavor=${1##*-}
|
|
|
|
/usr/lib/rpm/find-provides "$@" <"$filelist"
|
|
|
|
(
|
|
grep '\.ko$' "$filelist" | \
|
|
xargs -r $sourcedir/symsets.pl --list-exported-symbols;
|
|
grep '/Module\.symvers$' "$filelist" | while read f; do
|
|
$sourcedir/symsets.pl --list-exported-symbols --symvers-file="$f"
|
|
done
|
|
) | awk -v flavor="$flavor" '
|
|
{
|
|
sub(/^0x0*/, "", $1);
|
|
if (!$1)
|
|
$1 = "0";
|
|
printf "ksym(%s:%s) = %s\n", flavor, $2, $1
|
|
}'
|
|
|
|
exit 0
|
|
|