2009-01-10 14:03:47 +01:00
|
|
|
#! /bin/bash
|
2008-07-18 12:15:21 +02:00
|
|
|
|
2010-06-29 18:25:47 +02:00
|
|
|
set -x
|
2010-06-22 17:48:26 +02:00
|
|
|
builddir="$1"
|
|
|
|
shift
|
|
|
|
|
2009-01-10 14:03:47 +01:00
|
|
|
filelist=$(mktemp -t ${0##*/}.XXXXXXXXXX)
|
2010-06-22 17:48:26 +02:00
|
|
|
trap "rm -f $filelist" EXIT
|
|
|
|
cat >"$filelist"
|
|
|
|
flavor=${1##*-}
|
|
|
|
|
|
|
|
grep -v '\.ko$' | /usr/lib/rpm/find-provides "$@" | grep -v '^ksym('
|
|
|
|
|
|
|
|
# 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()
|
|
|
|
{
|
|
|
|
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
|
2010-06-29 18:25:47 +02:00
|
|
|
symsets=("$builddir/base-symsets")
|
2010-06-22 17:48:26 +02:00
|
|
|
elif samemodules "$builddir"/main-modules "$filelist"; then
|
2010-06-29 18:25:47 +02:00
|
|
|
symsets=("$builddir/base-symsets" "$builddir/main-symsets")
|
2010-06-22 17:48:26 +02:00
|
|
|
elif samemodules "$builddir"/unsupported-modules "$filelist"; then
|
2010-06-29 18:25:47 +02:00
|
|
|
symsets=("$builddir/extra-symsets")
|
2009-07-09 04:41:55 +02:00
|
|
|
else
|
2010-06-22 17:48:26 +02:00
|
|
|
echo "find-provides: failed to determine which subpackage is this" >&2
|
|
|
|
exit 1
|
2009-07-09 04:41:55 +02:00
|
|
|
fi
|
2008-11-23 08:54:06 +01:00
|
|
|
|
2010-06-29 18:25:47 +02:00
|
|
|
find "${symsets[@]}" -type f -printf '%f\n' | \
|
2010-06-22 17:48:26 +02:00
|
|
|
sed -rn 's/^\.?(.+)\.([a-z0-9]{16})(\.fake)?$/kernel('$flavor':\1) = \2/p'
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|