1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

detect Firmware rejected country setting

This commit is contained in:
Jerry Vonau 2025-01-20 08:27:49 -06:00
parent 8e7888a51a
commit 0994a5786d
2 changed files with 24 additions and 3 deletions

View file

@ -71,6 +71,7 @@ iiab_lan_iface: none
discovered_lan_iface: none
discovered_wired_iface: none
discovered_wireless_iface: none
host_country_code_found: unset
# Red Hat
#iiab_wired_lan_iface: "none"

View file

@ -243,12 +243,16 @@
shell: iw reg get | grep country | grep -v UNSET | awk '{print $2}' | sed "s|:||"
register: REG_DOM
ignore_errors: True
when: wifi_up_down and can_be_ap and has_wifi_gateway is defined
- name: Set host_country_code_found
set_fact:
host_country_code_found: "{{ REG_DOM.stdout }}"
when: REG_DOM.stdout is defined and REG_DOM.stdout | length > 0
- name: Set Wifi Region country to {{ REG_DOM.stdout }} for hostapd when present
set_fact:
host_country_code: "{{ REG_DOM.stdout }}"
when: REG_DOM.stdout is defined and REG_DOM.stdout | length > 0
when: REG_DOM.stdout is defined and REG_DOM.stdout | length > 0 and wifi_up_down and can_be_ap and has_wifi_gateway is defined
- name: Detect current Wifi channel
shell: iw {{ discovered_wireless_iface }} info | grep channel | cut -d' ' -f2
@ -260,6 +264,11 @@
wifi_up_down: False
when: rpi3bplus_rpi4_wifi_firmware == "24"
- name: Detect "Firmware rejected country setting" in dmesg
shell: dmesg | grep ieee80211 | grep "Firmware rejected country setting"
register: FW_rejected_country
ignore_errors: True
- name: In VM disable LAN - needs local_vars entry to activate
set_fact:
iiab_lan_iface: none
@ -317,7 +326,7 @@
- option: can_be_ap
value: "{{ can_be_ap }}"
- option: host_country_code_found
value: "{{ host_country_code }}"
value: "{{ host_country_code_found }}"
- option: wifi_firmware_43430
value: "{{ rpizerow_rpi3_wifi_firmware }}"
- option: wifi_firmware_43455
@ -334,6 +343,17 @@
value: "{{ current_client_channel.stdout }}"
when: current_client_channel.stdout is defined
- name: Add 'detected_network' variable 'FW_rejected_country' value if defined, to {{ iiab_ini_file }}
ini_file:
dest: "{{ iiab_ini_file }}"
section: detected_network
option: "{{ item.option }}"
value: "{{ item.value | string }}"
with_items:
- option: FW_rejected_country
value: "{{ host_country_code_found }}"
when: FW_rejected_country.stdout is defined
# well if there ever was a point to tell the user things are FUBAR this is it.
# limit 2 network adapters wifi wired
- name: I'm not guessing declare gateway please