Skip to content

Commit

Permalink
feat: add rtl8814au wifi driver (#9)
Browse files Browse the repository at this point in the history
* add rtl8814au driver spec files

* add kernel version override to makefile

---------

Co-authored-by: Sean Radigan <[email protected]>
  • Loading branch information
sradigan and Sean Radigan authored Jan 21, 2024
1 parent a6f5155 commit 6f2838f
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
64 changes: 64 additions & 0 deletions staging/rtl8814au/rtl8814au-kmod.spec
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions staging/rtl8814au/rtl8814au.spec
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6f2838f

Please sign in to comment.