File r8101.spec of Package r8101
#
# spec file for package r8101
#
# Copyright (c) 2025 SUSE LINUX Products 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 http://bugs.opensuse.org/
# norootforbuild
# needssslcertforbuild
Name: r8101
Version: 1.039.00
Release: 83.112
Summary: Kernel module for RealTek RTL8101E, RTL8102E and RTL8103E Fast Ethernet PCI-Express Controllers
License: GPL-2.0+
Group: Hardware/Other
Url: https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100m-fast-ethernet-pci-express-software
Source0: %{name}-%{version}.tar.bz2
Source1: preamble
Source2: Module.supported
Patch1: leap155.patch
Patch2: leap156.patch
Patch3: kernel615.patch
BuildRequires: %kernel_module_package_buildreqs
BuildRequires: pesign-obs-integration
BuildRequires: bc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 x86_64
%kernel_module_package -n r8101 -x debug -x trace -c %_sourcedir/_projectcert.crt -p %_sourcedir/preamble
%description
This is the Linux device driver released for RealTek RTL8101E, RTL8102E(L) and RTL8103E(L), the Fast Ethernet controller with PCI-Express interface.
RTL8100E/RTL8101E/RTL8102E-GR/RTL8103E(L)
RTL8102E(L)/RTL8101E/RTL8103T
RTL8401/RTL8401P/RTL8105E
RTL8402/RTL8106E/RTL8106EUS
%package blacklist-r8169
Summary: To favour r8101 blacklist the r8169 device driver
Group: Hardware/Wifi
Requires: %{name}-kmp = %{version}
%description blacklist-r8169
On many Realtek Ethernet controllers the old device driver r8169 does
not work reliably. To solve this the r8169 kernel module has to be
blacklisted to enable the system to load the new device driver r8101.
%prep
%setup -q
%if 0%{?sle_version} == 150500
%patch -P 1 -p1
%endif
%patch -P 2 -p1
%patch -P 3 -p1
cp %{S:1} .
cp %{S:2} .
%build
ln -sf $(type -p kmod) modinfo
%{__mkdir} obj
for flavor in %{flavors_to_build}
do
%{__rm} -rf obj/$flavor
%{__cp} -rp src obj/$flavor
%{__make} -C %{kernel_source $flavor} M=$PWD/obj/$flavor modules
./modinfo -F alias $(find $PWD/obj/$flavor/ -name '%{name}.ko')
done
%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
export BRP_PESIGN_FILES='*.ko'
export BRP_PESIGN_COMPRESS_MODULE="xz"
for flavor in %flavors_to_build; do
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
M=$PWD/obj/$flavor
done
%{__mkdir_p} %{buildroot}%{_sysconfdir}/modprobe.d/
cat > %{buildroot}%{_sysconfdir}/modprobe.d/60-blacklist-r8169.conf<<-'EOF'
# On many Realtek Ethernet controllers the old device driver r8169 does
# not work reliably. To solve this the r8169 kernel module has to be
# blacklisted to enable the system to load the new device driver r8101.
blacklist r8169
EOF
%clean
%{__rm} -rf %{buildroot}
%files blacklist-r8169
%defattr(-, root, root)
%config %{_sysconfdir}/modprobe.d/60-blacklist-r8169.conf
%changelog