- fix supplements generation with rpm-4.9

OBS-URL: https://build.opensuse.org/package/show/Kernel:HEAD/kernel-firmware?expand=0&rev=39
This commit is contained in:
Michael Schröder 2011-08-25 16:04:51 +00:00 committed by Git OBS Bridge
parent 8ab1fef1ca
commit 6d8d26ec13
3 changed files with 31 additions and 1 deletions

View File

@ -54,6 +54,29 @@ get_kernel_dir()
usage
}
cache=
if test "$1" = "--cache" ; then
cache=$2
shift
shift
fi
if test "$1" = "--find-supplements" -a -n "$cache" ; then
if ! test -e "$cache"; then
get_kernel_dir
echo "Using $kernel" >&2
find "$kernel" -name '*.ko' -type f | while read ko; do
/sbin/modinfo -F firmware "$ko" | sed -e "s@\$@ $ko@"
done > $cache
fi
while read fw ; do
sed -n -e "s@^${fw#$RPM_BUILD_ROOT/lib/firmware/} @@p" < "$cache"
done | sort | \
RPMBUILD_SPECFILE=/dev/null /usr/lib/rpm/find-supplements.ksyms | \
sed 's/^modalias(kernel-[^:]*:/modalias(/' # strip the kernel-$flavor: prefix
exit 0
fi
trap 'rm -rf "$tmp"' EXIT
tmp=$(mktemp -d)

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Aug 25 18:04:35 CEST 2011 - mls@suse.de
- fix supplements generation with rpm-4.9
-------------------------------------------------------------------
Fri Aug 12 14:57:20 CEST 2011 - dmueller@suse.de

View File

@ -31,6 +31,8 @@ Source2: qlogic.tar.bz2
Source3: iwlwifi-4965-1.ucode
Source4: t4fw.bin
%define __find_supplements bash %_sourcedir/firmware.sh --find-supplements
%define __ksyms_supplements bash %_sourcedir/firmware.sh --cache %{_builddir}/%{?buildsubdir}/find_supplements.cache --find-supplements
%define __ksyms_path ^/lib/firmware
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
Provides: qlogic-firmware
@ -61,7 +63,6 @@ Provides: iwl6000g2-ucode
Obsoletes: iwl6000g2-ucode
Provides: ath3k-firmware
Obsoletes: ath3k-firmware
AutoReq: off
%description
This package contains the firmware for in-kernel drivers that was
@ -84,6 +85,7 @@ cp -avf * %{buildroot}/lib/firmware
rm -f %{buildroot}/lib/firmware/WHENCE
bash %_sourcedir/firmware.sh --kill-duplicates %buildroot/lib/firmware/
%fdupes %{buildroot}
rm -f find_supplements.cache
%clean
rm -rf %{buildroot}