diff --git a/firmware.sh b/firmware.sh index 7d33340..1ccae17 100644 --- a/firmware.sh +++ b/firmware.sh @@ -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) diff --git a/kernel-firmware.changes b/kernel-firmware.changes index c5529a2..85c1158 100644 --- a/kernel-firmware.changes +++ b/kernel-firmware.changes @@ -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 diff --git a/kernel-firmware.spec b/kernel-firmware.spec index dbd1f0e..f81012d 100644 --- a/kernel-firmware.spec +++ b/kernel-firmware.spec @@ -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}