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:
parent
8e7888a51a
commit
0994a5786d
2 changed files with 24 additions and 3 deletions
|
@ -71,6 +71,7 @@ iiab_lan_iface: none
|
||||||
discovered_lan_iface: none
|
discovered_lan_iface: none
|
||||||
discovered_wired_iface: none
|
discovered_wired_iface: none
|
||||||
discovered_wireless_iface: none
|
discovered_wireless_iface: none
|
||||||
|
host_country_code_found: unset
|
||||||
|
|
||||||
# Red Hat
|
# Red Hat
|
||||||
#iiab_wired_lan_iface: "none"
|
#iiab_wired_lan_iface: "none"
|
||||||
|
|
|
@ -243,12 +243,16 @@
|
||||||
shell: iw reg get | grep country | grep -v UNSET | awk '{print $2}' | sed "s|:||"
|
shell: iw reg get | grep country | grep -v UNSET | awk '{print $2}' | sed "s|:||"
|
||||||
register: REG_DOM
|
register: REG_DOM
|
||||||
ignore_errors: True
|
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
|
- name: Set Wifi Region country to {{ REG_DOM.stdout }} for hostapd when present
|
||||||
set_fact:
|
set_fact:
|
||||||
host_country_code: "{{ REG_DOM.stdout }}"
|
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
|
- name: Detect current Wifi channel
|
||||||
shell: iw {{ discovered_wireless_iface }} info | grep channel | cut -d' ' -f2
|
shell: iw {{ discovered_wireless_iface }} info | grep channel | cut -d' ' -f2
|
||||||
|
@ -260,6 +264,11 @@
|
||||||
wifi_up_down: False
|
wifi_up_down: False
|
||||||
when: rpi3bplus_rpi4_wifi_firmware == "24"
|
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
|
- name: In VM disable LAN - needs local_vars entry to activate
|
||||||
set_fact:
|
set_fact:
|
||||||
iiab_lan_iface: none
|
iiab_lan_iface: none
|
||||||
|
@ -317,7 +326,7 @@
|
||||||
- option: can_be_ap
|
- option: can_be_ap
|
||||||
value: "{{ can_be_ap }}"
|
value: "{{ can_be_ap }}"
|
||||||
- option: host_country_code_found
|
- option: host_country_code_found
|
||||||
value: "{{ host_country_code }}"
|
value: "{{ host_country_code_found }}"
|
||||||
- option: wifi_firmware_43430
|
- option: wifi_firmware_43430
|
||||||
value: "{{ rpizerow_rpi3_wifi_firmware }}"
|
value: "{{ rpizerow_rpi3_wifi_firmware }}"
|
||||||
- option: wifi_firmware_43455
|
- option: wifi_firmware_43455
|
||||||
|
@ -334,6 +343,17 @@
|
||||||
value: "{{ current_client_channel.stdout }}"
|
value: "{{ current_client_channel.stdout }}"
|
||||||
when: current_client_channel.stdout is defined
|
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.
|
# well if there ever was a point to tell the user things are FUBAR this is it.
|
||||||
# limit 2 network adapters wifi wired
|
# limit 2 network adapters wifi wired
|
||||||
- name: I'm not guessing declare gateway please
|
- name: I'm not guessing declare gateway please
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue