udev: Always enumerate wifi phys from 0

At least RPI4 this enumaration feels pretty random.
This commit is contained in:
Mattias Walström
2026-01-19 14:54:37 +01:00
parent 9ba1d45c9a
commit bf1eca0567
2 changed files with 9 additions and 1 deletions
@@ -1,3 +1,3 @@
# Rename WiFi PHY devices from phy0 to radio0 to avoid name clashes
SUBSYSTEM=="ieee80211", ACTION=="add", KERNEL=="phy*", \
RUN+="/bin/sh -c '/usr/sbin/iw phy %k set name radio%n'"
RUN+="/usr/libexec/infix/rename-wifi-phy %k"
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
# Rename WiFi PHY to radio{N}, enumerating from 0
phy="$1"
n=0
while [ -d "/sys/class/ieee80211/radio$n" ]; do
n=$((n + 1))
done
/usr/sbin/iw phy "$phy" set name "radio$n"