From 6f2838f5fdd6ad1b9e875840d55fe09c1661fa44 Mon Sep 17 00:00:00 2001 From: Sean Radigan Date: Sat, 20 Jan 2024 19:12:15 -0500 Subject: [PATCH] feat: add rtl8814au wifi driver (#9) * add rtl8814au driver spec files * add kernel version override to makefile --------- Co-authored-by: Sean Radigan --- staging/rtl8814au/rtl8814au-kmod.spec | 64 +++++++++++++++++++++++++++ staging/rtl8814au/rtl8814au.spec | 29 ++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 staging/rtl8814au/rtl8814au-kmod.spec create mode 100644 staging/rtl8814au/rtl8814au.spec diff --git a/staging/rtl8814au/rtl8814au-kmod.spec b/staging/rtl8814au/rtl8814au-kmod.spec new file mode 100644 index 0000000..661fd67 --- /dev/null +++ b/staging/rtl8814au/rtl8814au-kmod.spec @@ -0,0 +1,64 @@ +%global srccommit 866a9100c7b3f6508b81b31a22cae19dcacdacb9 +%global modname rtl8814au +%global srcname 8814au + +%if 0%{?fedora} +%global buildforkernels akmod +%global debug_package %{nil} +%endif + +# name should have a -kmod suffix +Name: %{modname}-kmod +# Version comes from include/rtw_version.h +Version: 5.8.5.1.git +Release: 1%{?dist} +Summary: Realtek RTL8814AU Driver +Group: System Environment/Kernel +License: GPLv2 +URL: https://github.com/morrownr/8814au +Source0: %{url}/archive/%{srccommit}.zip + +BuildRequires: kmodtool + +%{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } + +%description +Realtek RTL8814AU Driver + +%prep +# error out if there was something wrong with kmodtool +%{?kmodtool_check} + +# print kmodtool output for debugging purposes: +kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null + +%autosetup -c %{modname} + +for kernel_version in %{?kernel_versions} ; do + mkdir -p _kmod_build_${kernel_version%%___*} + cp -a %{srcname}-%{srccommit} _kmod_build_${kernel_version%%___*}/ +done + +%build +for kernel_version in %{?kernel_versions} ; do + pushd _kmod_build_${kernel_version%%___*}/ + cd %{srcname}-%{srccommit} + make clean + make KVER=${kernel_version%%___*} + # Rename the module to have rtl prefix for Realtek + mv %{srcname}.ko %{modname}.ko + popd +done + +%install +for kernel_version in %{?kernel_versions}; do + mkdir -p %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ + install -D -m 755 _kmod_build_${kernel_version%%___*}/%{srcname}-%{srccommit}/%{modname}.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ + chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/%{modname}.ko +done +%{?akmod_install} + +%clean +rm -rf "%{buildroot}" + +%changelog diff --git a/staging/rtl8814au/rtl8814au.spec b/staging/rtl8814au/rtl8814au.spec new file mode 100644 index 0000000..ed8266a --- /dev/null +++ b/staging/rtl8814au/rtl8814au.spec @@ -0,0 +1,29 @@ +%global modname rtl8814au + +%if 0%{?fedora} +%global debug_package %{nil} +%endif + +Name: %{modname} +Version: 5.8.5.1.git +Release: 1%{?dist} +Summary: Realtek RTL8814AU Driver +License: GPLv2 +URL: https://github.com/morrownr/8814au +Source0: https://raw.githubusercontent.com/morrownr/8814au/main/LICENSE + +Provides: %{name}-kmod-common = %{version} +Requires: %{name}-kmod >= %{version} + +BuildRequires: systemd-rpm-macros + +%description +Realtek RTL8814AU Driver + +%build +install -D -m 0644 %{SOURCE0} %{buildroot}%{_datarootdir}/licenses/%{modname}/LICENSE + +%files +%license LICENSE + +%changelog