From 30bc5085b84afdcd8734354a1a0ed7acbd35d39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Migu=C3=A9ns=20Iglesias?= Date: Tue, 23 Apr 2024 12:14:54 +0200 Subject: [PATCH] rtl8852bu: init at f6aaa3c --- pkgs/os-specific/linux/rtl8852bu/default.nix | 51 ++++++++++++++++++++ pkgs/top-level/linux-kernels.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/os-specific/linux/rtl8852bu/default.nix diff --git a/pkgs/os-specific/linux/rtl8852bu/default.nix b/pkgs/os-specific/linux/rtl8852bu/default.nix new file mode 100644 index 0000000000000..cc0f495b8122f --- /dev/null +++ b/pkgs/os-specific/linux/rtl8852bu/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchFromGitHub, kernel, bc, nukeReferences }: + +stdenv.mkDerivation { + pname = "rtl8852bu"; + version = "${kernel.version}-unstable-2024-03-28"; + + src = fetchFromGitHub { + owner = "morrownr"; + repo = "rtl8852bu"; + rev = "f6aaa3c0094c541d9b0347926c76c1e9cc4a49d1"; + hash = "sha256-Jbd6nixo873LU74klhhQU1qD3ahxEnywdqcF89LTRxc="; + }; + + nativeBuildInputs = [ bc nukeReferences ] ++ kernel.moduleBuildDependencies; + hardeningDisable = [ "pic" "format" ]; + + postPatch = '' + substituteInPlace ./Makefile \ + --replace-fail /sbin/depmod \# \ + --replace-fail '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" + substituteInPlace ./platform/i386_pc.mk \ + --replace-fail /lib/modules "${kernel.dev}/lib/modules" + ''; + + makeFlags = [ + "ARCH=${stdenv.hostPlatform.linuxArch}" + ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) + ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; + + preInstall = '' + mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" + mkdir -p "$out/usr/lib/systemd/system-sleep" + ''; + + postInstall = '' + nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko + ''; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Driver for Realtek rtl8852au and rtl8832bu chipsets, provides the 8852au mod"; + homepage = "https://github.com/morrownr/rtl8852bu"; + license = licenses.gpl2Only; + platforms = platforms.linux; + maintainers = with maintainers; [ lonyelon ]; + }; +} diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index 33ef16e22c8f9..91a8c2f539267 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -443,6 +443,8 @@ in { rtl8852au = callPackage ../os-specific/linux/rtl8852au { }; + rtl8852bu = callPackage ../os-specific/linux/rtl8852bu { }; + rtl88xxau-aircrack = callPackage ../os-specific/linux/rtl88xxau-aircrack {}; rtl8821au = callPackage ../os-specific/linux/rtl8821au { };