forked from pool/kernel-source
This commit is contained in:
committed by
Git OBS Bridge
parent
f36efaf4f2
commit
faafcb6f8a
@@ -2,7 +2,6 @@
|
||||
|
||||
# these are updated by the spec file
|
||||
sourcedir=${0%/*}
|
||||
builddir="$sourcedir/../BUILD"
|
||||
|
||||
filelist=$(mktemp -t ${0##*/}.XXXXXXXXXX)
|
||||
trap "rm -f $filelist" EXIT
|
||||
@@ -11,34 +10,19 @@ flavor=${1##*-}
|
||||
|
||||
/usr/lib/rpm/find-provides "$@" <"$filelist"
|
||||
|
||||
# HACK: find out what subpackage is this and just print the symsets
|
||||
# computed in %build. We need to do it this way because the provided
|
||||
# symsets are computed from the modules AND the reference symsets, which
|
||||
# we don't see here.
|
||||
subpack=
|
||||
|
||||
samemodules()
|
||||
(
|
||||
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" '
|
||||
{
|
||||
cmp -s <(sed -rn 's:.*/([^/]*\.ko)$:\1:p' "$1" | sort) \
|
||||
<(sed -rn 's:.*/([^/]*\.ko)$:\1:p' "$2" | sort)
|
||||
}
|
||||
|
||||
if ! grep -q '\.ko$' "$filelist"; then
|
||||
# no modules, no symsets
|
||||
exit 0
|
||||
fi
|
||||
if samemodules "$builddir"/base-modules "$filelist"; then
|
||||
subpack=base
|
||||
elif samemodules "$builddir"/main-modules "$filelist"; then
|
||||
subpack=main
|
||||
elif samemodules "$builddir"/unsupported-modules "$filelist"; then
|
||||
subpack=extra
|
||||
else
|
||||
echo "find-provides: failed to determine which subpackage is this" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ls "$builddir/$subpack-symsets" | sed -rn 's/^(.+)\.([a-z0-9]{16})/kernel('$flavor':\1) = \2/p'
|
||||
sub(/^0x0*/, "", $1);
|
||||
if (!$1)
|
||||
$1 = "0";
|
||||
printf "ksym(%s:%s) = %s\n", flavor, $2, $1
|
||||
}'
|
||||
|
||||
exit 0
|
||||
|
||||
|
Reference in New Issue
Block a user