File kernel-firmware.spec of Package kernel-firmware.6702

# spec file for package kernel-firmware
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%define __find_supplements bash %{_sourcedir}/ --find-supplements
%define __ksyms_supplements bash %{_sourcedir}/ --cache %{_builddir}/%{?buildsubdir}/find_supplements.cache --find-supplements
%define __ksyms_path ^/lib/firmware
%define version_unconverted 20170530

Name:           kernel-firmware
Version:        20170530
Release:        0
Summary:        Linux kernel firmware files
License:        SUSE-Firmware and GPL-2.0 and GPL-2.0+ and MIT
Group:          System/Kernel
# Created with umask 022; cd /_tmp
# After git clone
# cd linux-firmware
# git archive --format=tar --prefix=linux-firmware-$version/ -v master ./ | xz -9 -M 4G --check=crc32 -T 4 > /tmp/linux-firmware-$version.tar.xz
Source0:        kernel-firmware-%{version}.tar.xz
# ast_dp501_fw.bin generated from header file of xf86-video-ast: MIT/X11 License
Source2:        ast_dp501_fw.bin
Source8:        ql2600_fw.bin
Source9:        ql2700_fw.bin
Source10:       ql8300_fw.bin
# Upstream change bsc#1045856
Source11:       hfi1_dc8051.fw
Source99:       %{name}-rpmlintrc
# Intel WiFi firmware updates
Source100:      iwlwifi-3160-17.ucode
Source101:      iwlwifi-7260-17.ucode
Source102:      iwlwifi-7265-17.ucode
# bsc#1077355, CVE-2015-1142857
Source111:      bnx2x-e1-
Source112:      bnx2x-e1h-
Source113:      bnx2x-e2-
# CVE-2017-5715
Source200:      microcode_amd_fam17h.bin
# PATCH-FIX-UPSTREAM Update-Intel-OPA-hfi1-firmware.patch bsc#1045856
Patch1:         Update-Intel-OPA-hfi1-firmware.patch
Patch2:         WHNCE-iwlwifi-update.patch
BuildRequires:  fdupes
BuildRequires:  kernel-default
BuildRequires:  suse-module-tools
Requires(post): coreutils
Requires(postun): coreutils
Provides:       bcm43xx-firmware:/lib/firmware/brcm/brcmfmac43430-sdio.bin
Provides:       qlogic-firmware
Obsoletes:      qlogic-firmware
Provides:       cxgb3-firmware
Obsoletes:      cxgb3-firmware
Provides:       ralink-firmware
Obsoletes:      ralink-firmware
Provides:       iwl1000-ucode
Obsoletes:      iwl1000-ucode
Provides:       iwl3945-ucode
Obsoletes:      iwl3945-ucode
Provides:       iwl4965-ucode
Obsoletes:      iwl4965-ucode
Provides:       iwl5000-ucode
Obsoletes:      iwl5000-ucode
Provides:       iwl5150-ucode
Obsoletes:      iwl5150-ucode
Provides:       iwl100-ucode
Obsoletes:      iwl100-ucode
Provides:       iwl1000-ucode
Obsoletes:      iwl1000-ucode
Provides:       iwl6000-ucode
Obsoletes:      iwl6000-ucode
Provides:       iwl6050-ucode
Obsoletes:      iwl6050-ucode
Provides:       iwl6000g2-ucode
Obsoletes:      iwl6000g2-ucode
Provides:       ath3k-firmware
Obsoletes:      ath3k-firmware
Provides:       compat-wireless-firmware = 4.4
Obsoletes:      compat-wireless-firmware < 4.4
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
ExcludeArch:    %ix86 s390

This package contains the firmware for in-kernel drivers that was
previously included in the kernel. It is shared by all kernels >=

%package -n ucode-amd
Summary:        Microcode updates for AMD CPUs
Group:          System/Kernel
Requires(post): coreutils
Requires(postun): coreutils
Supplements:    modalias(x86cpu:vendor%%3A0002%%3Afamily%%3A*%%3Amodel%%3A*%%3Afeature%%3A*)

%description -n ucode-amd
This package contains the microcode files used by AMD CPUs.

%setup -q
cp %{S:2} %{S:8} %{S:9} %{S:10} .
# hfi1 revert (upstream change, bsc#1045856)
%patch1 -p1
cp %{S:11} .
rm -f WHENCE.orig
# Intel WiFi updates
cp %{S:100} .
cp %{S:101} .
cp %{S:102} .
%patch2 -p1
cp %{S:111} %{S:112} %{S:113} bnx2x/

# nothing to do

mkdir -p %{buildroot}/lib/firmware
cp -avf * %{buildroot}/lib/firmware
rm -f %{buildroot}/lib/firmware/WHENCE
bash %{_sourcedir}/ --kill-duplicates %{buildroot}/lib/firmware/
# CVE-2017-5715 fix
cp %{SOURCE200} %{buildroot}/lib/firmware/amd-ucode/
%fdupes %{buildroot}
rm -f find_supplements.cache
# In alsa-firmware
rm -f %{buildroot}/lib/firmware/ctefx.bin
rm -f %{buildroot}/lib/firmware/ctspeq.bin
# Devel files
rm -rf %{buildroot}/lib/firmware/carl9170fw
# Devel files
rm -f %{buildroot}/lib/firmware/isci/{Makefile,README}
rm -f %{buildroot}/lib/firmware/isci/*.[ch]


%post -n ucode-amd


%postun -n ucode-amd


%posttrans -n ucode-amd

%exclude /lib/firmware/amd-ucode
%exclude /lib/firmware/LICENSE.amd-ucode

%files -n ucode-amd

openSUSE Build Service is sponsored by