Autodetect adapter and save result in /etc/wfb.yaml -> wireless -> wl… (#1840)

pull/1841/head
Ihor Ivlev 2025-07-04 11:19:43 +02:00 committed by GitHub
parent 94009f51a5
commit a908ba29d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -24,6 +24,7 @@ load_config() {
}
load_modules() {
adapter_id=""
for card in $(lsusb | awk '{print $6}' | uniq); do
case "$card" in
"0bda:8812" | "0bda:881a" | "0b05:17d2" | "2357:0101" | "2604:0012")
@ -32,10 +33,12 @@ load_modules() {
"0bda:a81a")
driver=8812eu
adapter_id="bl-m8812eu2"
;;
"0bda:f72b" | "0bda:b733")
driver=8733bu
adapter_id="bl-m8731bu4"
;;
esac
done
@ -61,6 +64,11 @@ load_modules() {
echo_log "Wireless driver not found!"
exit 1
fi
# Set .wireless.wlan_adapter in /etc/wfb.yaml if adapter_id is set
if [ -n "$adapter_id" ]; then
yaml-cli-multi -i /etc/wfb.yaml -s .wireless.wlan_adapter "$adapter_id"
fi
}
load_mlink() {