Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rtl8814au wifi driver #9

Merged
merged 2 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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