adding powersafe off for wifi in rpis
This commit is contained in:
@@ -8,6 +8,8 @@ def _os_flavor():
|
|||||||
h = "Armbian"
|
h = "Armbian"
|
||||||
elif os.path.isdir('/etc/osmc'):
|
elif os.path.isdir('/etc/osmc'):
|
||||||
h = "OSMC"
|
h = "OSMC"
|
||||||
|
elif os.path.isfile('/etc/octopi_version'):
|
||||||
|
h = "OctoPi"
|
||||||
else:
|
else:
|
||||||
h = "Debian"
|
h = "Debian"
|
||||||
return h
|
return h
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ set has_fan = salt['pillar.get'](
|
|||||||
|
|
||||||
include:
|
include:
|
||||||
- .repo
|
- .repo
|
||||||
|
- .wifi
|
||||||
{%- if 'node_exporter' in has_promexporter %}
|
{%- if 'node_exporter' in has_promexporter %}
|
||||||
- .prometheus-exporter
|
- .prometheus-exporter
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# disable powersave
|
||||||
|
[connection]
|
||||||
|
wifi.powersave = 2
|
||||||
12
hardware/raspberrypi/wifi/files/wifi-powermanagement-off
Normal file
12
hardware/raspberrypi/wifi/files/wifi-powermanagement-off
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
IWCONFIG=/sbin/iwconfig
|
||||||
|
WLAN_IFACE=wlan0
|
||||||
|
|
||||||
|
if [ ! -x $IWCONFIG ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$IFACE" = $WLAN_IFACE ]; then
|
||||||
|
$IWCONFIG $IFACE power off
|
||||||
|
fi
|
||||||
22
hardware/raspberrypi/wifi/init.sls
Normal file
22
hardware/raspberrypi/wifi/init.sls
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# disable wifi powermanagement
|
||||||
|
|
||||||
|
nm-conf_d:
|
||||||
|
file.directory:
|
||||||
|
- name: /etc/NetworkManager/conf.d
|
||||||
|
|
||||||
|
nm-conf_powersave-off:
|
||||||
|
file.managed:
|
||||||
|
- name: /etc/NetworkManager/conf.d/default-wifi-powersave.conf
|
||||||
|
- source:
|
||||||
|
- salt://hardware/raspberrypi/wifi/files/default-wifi-powersave.conf
|
||||||
|
- require:
|
||||||
|
- file: /etc/NetworkManager/conf.d
|
||||||
|
|
||||||
|
if-up_powersave-off:
|
||||||
|
file.managed:
|
||||||
|
- name: /etc/network/if-up.d/wifi-powermanagement-off
|
||||||
|
- mode: 0755
|
||||||
|
- source:
|
||||||
|
- salt://hardware/raspberrypi/wifi/files/wifi-powermanagement-off
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user