Mediatek MT7902 WIFI [SOLVED Debian 13]
Hi, i was having trouble on making my mediatek mt7902 wifi work. Here's how i solved it.
(Sorry for my english, not native)
First, find your kernel version with: uname -r.
You NEED a kernel version 6.14 or over, but DON'T WORRY.
I am a Debian 13 Trixie user so i had a 6.12.88 version right now, on debian you can make a backport, so you can actually have moderns version.
Add the backport repositories, put this on your terminal:
echo "deb http://deb.debian.org/debian trixie-backports main contrib non-free non-free-firmware" | sudo tee /etc/apt/sources.list.d/backports.list
Make sure to sudo apt update and upgrade.
And install newest version available:
sudo apt install -t trixie-backports linux-image-amd64 linux-headers-amd64 bc zstd git build-essential -y
Once you have done all this. Reboot your pc. (Make sure while you make this to have secure boot disabled).
Now, just git clone the repository for the driver on your directorie of preference: https://github.com/OnlineLearningTutorials/mt7902_temp
Follow the README, and CRITICAL THING:
I had some trouble on the fix_my_wifi.sh, so I had to compile it manually using GCC:
(my directory was on Downloads):
cd ~/Downloads/mt7902_temp
SCRIPT_DIR=$(pwd)
LINUX_DIR="$SCRIPT_DIR/linux-$(uname -r | cut -d'.' -f1,2)"
WIFI_DIR="$LINUX_DIR/drivers/net/wireless/mediatek/mt76"
cd $WIFI_DIR
make CC=gcc module_compile
After that had to do this because wifi won't persist after rebooting, so it stays forever:
sudo mkdir -p /lib/modules/mt7902_custom/
sudo cp *.ko /lib/modules/mt7902_custom/
sudo cp mt7921/*.ko /lib/modules/mt7902_custom/
Also, to always boot on your new kernel version you must edit your grub:
sudo nano /etc/default/grub
Change: GRUB_DEFAULT=saved
To: GRUB_DEFAULT=0
Finally run: sudo update-grub
Have a great time finally not having headaches!! :))