Skip to content

Instantly share code, notes, and snippets.

@rmoriz
Last active September 19, 2023 02:04
Show Gist options
  • Save rmoriz/3cd396c14bfee6592a46a2f880b321a4 to your computer and use it in GitHub Desktop.
Save rmoriz/3cd396c14bfee6592a46a2f880b321a4 to your computer and use it in GitHub Desktop.
build rtl8812au driver running Raspbian on Raspberry Pi 3 and Zero (both tested, should work on all)
#!/bin/sh
mkdir -p /tmp/rtl8812au
cd /tmp/rtl8812au
apt-get install -y \
git \
dkms \
raspberrypi-kernel-headers \
raspberrypi-kernel
# probably also build-essential
git clone https://github.com/aircrack-ng/rtl8812au .
cat > Makefile.patch <<EOL
diff --git a/Makefile b/Makefile
index 4baac3d..4c1174d 100755
--- a/Makefile
+++ b/Makefile
@@ -99,8 +99,8 @@ CONFIG_RTW_SDIO_PM_KEEP_POWER = y
###################### MP HW TX MODE FOR VHT #######################
CONFIG_MP_VHT_HW_TX_MODE = n
###################### Platform Related #######################
-CONFIG_PLATFORM_I386_PC = y
-CONFIG_PLATFORM_ARM_RPI = n
+CONFIG_PLATFORM_I386_PC = n
+CONFIG_PLATFORM_ARM_RPI = y
CONFIG_PLATFORM_ARM64_RPI = n
CONFIG_PLATFORM_ANDROID_X86 = n
CONFIG_PLATFORM_ANDROID_INTEL_X86 = n
EOL
patch -p1 < Makefile.patch
# workaround for:
#
# make ARCH=armv6l CROSS_COMPILE= -C /lib/modules/4.14.79+/build M=/var/lib/dkms/rtl8812au/5.2.20.2/build modules
# make[1]: Entering directory '/usr/src/linux-headers-4.14.79+'
# Makefile:644: arch/armv6l/Makefile: No such file or directory
# make[1]: *** No rule to make target 'arch/armv6l/Makefile'. Stop.
#
ln -s /usr/src/linux-headers-$(uname -r)/arch/arm /usr/src/linux-headers-$(uname -r)/arch/$(uname -m)
./dkms-install.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment