I am writing a custom OpenWRT image [24.10] and I need to disable uci control of the radios in order to support a MorseMicro WiFi-Halow device (This is an out-of-tree driver). I am able to successfully disable the radios at runtime using
uci set wireless.radio0.disabled='1'
uci commit wireless
But all of my attempts to do so using uci-defaults scripts have failed. After they run and the system boots, uci get wireless.radio0.disabled always returns 0. Is there a specific mechanism in 24.10 that triggers a forced re-detection regardless of the existing config? How can I permanently blacklist these physical paths from being managed by the standard wireless subsystem? Notice that all of the snippets below are triggered by an if statement which looks for the specific device.
Technical Details
OpenWrt 24.10 (Kernel 6.6.109)
OverlayFS (Verified rw via mount)
What I have tried
Dynamical disabling (Disable all radios using uci show wireless)
if lsusb | grep -q "325b:8100"; then
RADIOS=$(uci show wireless | grep "=wifi-device" | cut -d. -f2 | cut -d= -f1)
for R in $RADIOS; do
uci set wireless.${R}.disabled='1'
done
uci commit wireless
Disable by index
if lsusb | grep -q "325b:8100"; then
index=0
while uci get wireless.radio${index} >/dev/null 2>&1; do
uci set wireless.radio${index}.disabled='1'
index=$((index + 1))
done
uci commit wireless
Brute force disable (hardcoded values)
if lsusb | grep -q "325b:8100"; then
# 1. Manually disable specific radio indices to clear UCI management [cite: 533, 964]
uci set wireless.radio0.disabled='1'
uci set wireless.radio1.disabled='1'
uci set wireless.radio2.disabled='1'
uci set wireless.radio3.disabled='1'
uci commit wireless
Wipe the entire wireless config
if lsusb | grep -q "325b:8100"; then
true > /etc/config/wireless
Enter dummy values
if lsusb | grep -q "325b:8100"; then
cat <<EOF > /etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option disabled '1'
config wifi-device 'radio1'
option type 'mac80211'
option disabled '1'
EOF
Do you mean that literally, or do you just want the radio(s) disabled?
The uci-defaults are burnt into the flash and reside in ROM, so your attempts must be put into a custom image eg via the Firmware Selector or the Imagebuilder.
So unless you have done this then yes, your attempts will fail.
That is fine, but an out of tree driver will not effect the existing "built into the image" drivers, so why do you need to disable them?
In addition, the default OpenWrt build will have wireless disabled anyway. So a simple answer will be "Don't enable the wireless, then you won't have to disable it".
after reading your original post again ... my bet is on the permissions. any one of those scripts should do, test it manually fist, if it works from command line in should work from uci-defaults. Just make sure the script has executable permissions
But the OP has not explained why/how he has enabled the radios in the first place, given "disabled" is the default.
I suspect he is trying to undo someone else's work in a non-standard image.
You are probably aware, so for the benefit of others; when building a package, the package makefile can set permissions, depending on what you are trying to do.
I'm just disabling UCI interaction with the radios. I am using a Morse Micro 802.11ah radio which is managed by wpa_supplicant_s1g. So we're just telling uci "don't touch this radio"
Yes this is a part of a custom image package which loads these uci-defaults scripts into the actual .gz firmware image. I have many other uci-defaults scripts that are working just fine such as firewall control, amixer sound control, etc.
I need to disable them because I am using the Morse Micro Wifi Halow card, and the standard UCI wireless system does not know how to correctly manage it. So, instead I am using wpa_supplicant_s1g. But for that to work you don't want uci to be fighting it.
However, I want the user to be able to hot-swap for standard 2.4GHz+ wireless modules, hence the if statement at the start of my examples. We first check to see if the HaLoW card is installed then and only then do we disable UCI on startup
As for what I'm not telling you, yes I am trying not to reveal all of the information about my design. But if there is specific information that would help address this issue, please let me know and I will divulge if possible.