1
0
forked from pool/kernel-source
kernel-source/find-provides

38 lines
599 B
Plaintext
Raw Normal View History

#! /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"
case `uname -m` in
ia64)
image="vmlinuz"
;;
*)
image="vmlinux"
esac
while read f; do
test -e "$f" || continue
case "$f" in
*.ko | */$image* )
echo "$f"
esac
done <"$filelist" | \
xargs -r $sourcedir/symsets.pl --list-exported-symbols | \
awk -v flavor="$flavor" '
{
sub(/^0x0*/, "", $1);
if (!$1)
$1 = "0";
printf "ksym(%s:%s) = %s\n", flavor, $2, $1
}'
exit 0