File of Package kernel-firmware

# spec file for package kernel-firmware
# Copyright (c) 2020 SUSE LLC
# 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

%global flavor @BUILD_FLAVOR@%{nil}

%if 0%{?suse_version} < 1550
%define _firmwaredir /lib/firmware

%define __ksyms_path ^%{_firmwaredir}
%define version_unconverted @@VERSION@@

Name:           kernel-firmware
Version:        @@VERSION@@
Release:        0
Summary:        Linux kernel firmware files
License:        SUSE-Firmware AND GPL-2.0-only AND GPL-2.0-or-later AND MIT
Group:          System/Kernel
# Created with umask 022; cd /_tmp
# After git clone
# cd linux-firmware
# git archive --format=tar --prefix=kernel-firmware-$version/ -v master ./ | xz -9 -M 4G --check=crc32 -T 4 > /tmp/kernel-firmware-$version.tar.xz
Source0:        kernel-firmware-%{version}.tar.xz
Source1:        extrawhence
Source2:        ast_dp501_fw.bin
Source8:        ql2600_fw.bin
Source9:        ql2700_fw.bin
Source10:       ql8300_fw.bin
Source99:       %{name}-rpmlintrc
# install / build infrastructure
Source1004:     topics.list
Source1005:     licenses.list
Source1006:     aliases.list
Source1007:     topicdefs
Source1008:     topicprovs
BuildRequires:  fdupes
BuildRequires:  suse-module-tools
Requires(post): /usr/bin/mkdir /usr/bin/touch
Requires(postun): /usr/bin/mkdir /usr/bin/touch
BuildArch:      noarch
Provides:       compat-wireless-firmware = 4.4
Obsoletes:      compat-wireless-firmware < 4.4

# Force bzip2 instead of lzma compression (bsc#1176981)
%define _binary_payload w9.bzdio

This package contains the raw uncompressed firmware files for Linux kernel
drivers.  This package is provided only for compatibility with older kernels
that do not support the compressed format.

%package -n ucode-amd
Summary:        Microcode updates for AMD CPUs
Group:          System/Kernel
Requires(post): /usr/bin/mkdir /usr/bin/touch
Requires(postun): /usr/bin/mkdir /usr/bin/touch
# new style (after 3.12 kernel somewhen)
Supplements:    modalias(cpu:type%%3Ax86*ven0002*)
# old style (before 3.16 kernel)
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.

%package all
Summary:        Compatibility metapackage for kernel firmware files
Group:          System/Kernel
Requires(post): /usr/bin/mkdir /usr/bin/touch
Requires(postun): /usr/bin/mkdir /usr/bin/touch
Requires(post): dracut >= 049
Provides:       kernel-firmware = %{version}
Obsoletes:      kernel-firmware <= %{version}
Conflicts:      kernel < 5.3
Provides:       compat-wireless-firmware = 4.4
Obsoletes:      compat-wireless-firmware < 4.4

%description all
This package is a catch-all compatibility metapackage for providing
all files that have been provided by kernel-firmware package.


%setup -q
# additional firmwares
cat %{SOURCE1} >> WHENCE
cp %{SOURCE2} %{SOURCE8} %{SOURCE9} %{SOURCE10} .

# nothing to do

mkdir -p %{buildroot}%{_firmwaredir}
%if "%flavor" != "compressed"
sh ./ %{buildroot}%{_firmwaredir}
sh %{_sourcedir}/ -v %{_sourcedir}/topics.list %{buildroot} %{_firmwaredir} < WHENCE
sh %{_sourcedir}/ < %{_sourcedir}/licenses.list
%fdupes -s %{buildroot}

%if "%flavor" != "compressed"
@@POST@@ -n ucode-amd
@@POST@@ all

%if "%flavor" != "compressed"
%license GPL-2 GPL-3 LICEN[CS]E.*
%exclude %{_firmwaredir}/amd-ucode
%exclude %{_firmwaredir}/amd-ucode/*

%files -n ucode-amd
%license LICENSE.amd-ucode
%dir %{_firmwaredir}

%if "%flavor" == "compressed"
%files all


openSUSE Build Service is sponsored by