[bfa-firmware/f17] update to 3.1.2.1

Kyle McMartin kyle at fedoraproject.org
Fri Jan 18 17:12:12 UTC 2013


commit 3aac131c58873add1175fdbd81fb38e26ab8ef74
Author: Kyle McMartin <kmcmarti at redhat.com>
Date:   Fri Jan 11 14:40:10 2013 -0500

    update to 3.1.2.1
    
    move some things around a bit so we have to change fewer lines to add
    new firmware files for the kernel.

 .gitignore        |    6 +-
 bfa-firmware.spec |  110 ++++++++++++++++++++++++++++++++++++-----------------
 sources           |    1 +
 3 files changed, 79 insertions(+), 38 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 5445864..e484f0b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
 cbfw.bin
 ctfw.bin
-/cbfw_fc.bin
-/ctfw_cna.bin
-/ctfw_fc.bin
+ct2fw.bin
 /bfa_firmware_linux-3.0.0.0-0.tgz
+/bfa_firmware_linux-3.0.3.1-0.tgz
+/bfa_fw_update_to_v3.1.2.1.tgz
diff --git a/bfa-firmware.spec b/bfa-firmware.spec
index 584a821..eef9642 100644
--- a/bfa-firmware.spec
+++ b/bfa-firmware.spec
@@ -1,16 +1,16 @@
 Name:		bfa-firmware
 Summary:	Brocade Fibre Channel HBA Firmware
-Version:	3.0.3.1
+Version:	3.1.2.1
 Release:	1%{?dist}
 License:	Redistributable, no modification permitted
 Group:		System Environment/Kernel
+Source0:	LICENSE
 # These files were taken from:
 # http://www.brocade.com/sites/dotcom/services-support/drivers-downloads/CNA/Linux.page
 # No direct link is available.
-Source0:	bfa_firmware_linux-%{version}-0.tgz
-# We need to keep the old 3.0.0.0 firmware around for RHEL builds
 Source1:	bfa_firmware_linux-3.0.0.0-0.tgz
-Source3:	LICENSE
+Source2:	bfa_firmware_linux-3.0.3.1-0.tgz
+Source3:	bfa_fw_update_to_v3.1.2.1.tgz
 URL:		http://www.brocade.com/sites/dotcom/services-support/drivers-downloads/CNA/Linux.page
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:	noarch
@@ -21,41 +21,70 @@ Requires:	udev
 Brocade Fibre Channel HBA Firmware.
 
 %prep
-%setup -c -n %{name}-%{version} -q
-cp %{SOURCE3} .
-# RHEL needs to also have the old 3.0.0.0 firmware present, to ensure
-# compatibility for the pre-6.4 kernels. These firmware files are not versioned.
-# When the upstream driver change to use a versioned firmware lands in Fedora
-# we will need to apply the renaming changes universally.
-%if 0%{?rhel}
-# Rename the new files to embed version in the way that the RHEL 6.4 driver
-# is expecting.
-mv cbfw.bin cbfw-%{version}.bin
-mv ct2fw.bin ct2fw-%{version}.bin
-mv ctfw.bin ctfw-%{version}.bin
-# Unpack the old source into 3.0_GA_firwmare_image/
-tar xvf %{SOURCE1}
-%endif
+unpack_bfa_firmware() {
+	filename=$1
+	version=$2
+	dir=$3
+	installversion=${4:-$version}
+
+	tar xvf $RPM_SOURCE_DIR/$1
+	pushd $3
+	for i in cbfw ctfw ct2fw; do
+		if [ -f $i.bin ]; then
+			mv $i.bin $i-$installversion.bin;
+		elif [ -f $i-$version.bin ]; then
+			mv -u $i-$version.bin $i-$installversion.bin
+		fi
+	done
+	popd
+}
+
+unpack_bfa_firmware bfa_fw_update_to_v3.1.2.1.tgz 3.1.0.0 bfa_fw_v3.1.2.1 3.1.2.1
+unpack_bfa_firmware bfa_firmware_linux-3.0.3.1-0.tgz 3.0.3.1 .
+unpack_bfa_firmware bfa_firmware_linux-3.0.0.0-0.tgz 3.0.0.0 3.0_GA_firwmare_image
+
+cp %{SOURCE0} ./
 
 %build
 # Firmware, do nothing.
 
 %install
+install_bfa_firmware() {
+	ver=$1
+	dir=$2
+
+	pushd $dir
+	install -m0644 cbfw-$ver.bin ct2fw-$ver.bin ctfw-$ver.bin %{buildroot}/lib/firmware/
+	popd
+}
+
+link_bfa_firmware() {
+	dstver=$2
+	srcver=$1
+
+	pushd %{buildroot}/lib/firmware/
+		ln -s cbfw$srcver.bin cbfw$dstver.bin
+		ln -s ct2fw$srcver.bin ct2fw$dstver.bin
+		ln -s ctfw$srcver.bin ctfw$dstver.bin
+	popd
+}
+
 rm -rf %{buildroot}
 mkdir -p %{buildroot}/lib/firmware/
 
+install_bfa_firmware 3.1.2.1 bfa_fw_v3.1.2.1
+link_bfa_firmware "-3.1.2.1" "-3.1.0.0"
+install_bfa_firmware 3.0.3.1 .
+
+# RHEL 6.3 uses unversioned filenames
+# RHEL 6.4 starting with 3.0.3.1 uses versioned filenames
 %if 0%{?rhel}
-install -m0644 cbfw-%{version}.bin ct2fw-%{version}.bin ctfw-%{version}.bin %{buildroot}/lib/firmware/
-pushd 3.0_GA_firwmare_image
-install -m0644 cbfw.bin ct2fw.bin ctfw.bin %{buildroot}/lib/firmware/
-popd
-pushd %{buildroot}/lib/firmware/
-ln -s cbfw.bin cbfw-3.0.0.0.bin
-ln -s ct2fw.bin ct2fw-3.0.0.0.bin
-ln -s ctfw.bin ctfw-3.0.0.0.bin
-popd
+	install_bfa_firmware 3.0.0.0 3.0_GA_firwmare_image
+	link_bfa_firmware "-3.0.0.0"
 %else
-install -m0644 cbfw.bin ct2fw.bin ctfw.bin %{buildroot}/lib/firmware/
+# Upstream starting with 3.1.0.0 uses versioned filenames
+#  so link the old version to the old names as expected
+	link_bfa_firmware "-3.0.3.1"
 %endif
 
 %clean
@@ -64,19 +93,30 @@ rm -rf %{buildroot}
 %files
 %defattr(-,root,root,-)
 %doc LICENSE
+/lib/firmware/cbfw.bin
+/lib/firmware/ctfw.bin
+/lib/firmware/ct2fw.bin
+/lib/firmware/cbfw-3.1.0.0.bin
+/lib/firmware/ctfw-3.1.0.0.bin
+/lib/firmware/ct2fw-3.1.0.0.bin
+/lib/firmware/cbfw-3.1.2.1.bin
+/lib/firmware/ctfw-3.1.2.1.bin
+/lib/firmware/ct2fw-3.1.2.1.bin
+/lib/firmware/cbfw-3.0.3.1.bin
+/lib/firmware/ctfw-3.0.3.1.bin
+/lib/firmware/ct2fw-3.0.3.1.bin
 %if 0%{?rhel}
-/lib/firmware/cbfw-%{version}.bin
-/lib/firmware/ctfw-%{version}.bin
-/lib/firmware/ct2fw-%{version}.bin
 /lib/firmware/cbfw-3.0.0.0.bin
 /lib/firmware/ctfw-3.0.0.0.bin
 /lib/firmware/ct2fw-3.0.0.0.bin
 %endif
-/lib/firmware/cbfw.bin
-/lib/firmware/ctfw.bin
-/lib/firmware/ct2fw.bin
 
 %changelog
+* Fri Jan 11 2013 Kyle McMartin <kmcmarti at redhat.com> 3.1.2.1-1
+- update to 3.1.2.1
+- add some shell functions to make life easier for multi-versioned firmware
+  filenames that are now upstream
+
 * Thu Sep  6 2012 Tom Callaway <spot at fedoraproject.org> 3.0.3.1-1
 - update to 3.0.3.1
 
diff --git a/sources b/sources
index e48eec7..2eefdec 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,3 @@
 708d4ca63e9fb9d7d951d5d382fbd362  bfa_firmware_linux-3.0.3.1-0.tgz
 f76ddb414a67f70c60a7d9aea92a4d2f  bfa_firmware_linux-3.0.0.0-0.tgz
+95b8fd4c8f2c6706f9cb98a5ef332d13  bfa_fw_update_to_v3.1.2.1.tgz


More information about the scm-commits mailing list