Skip to content

Commit

Permalink
v146
Browse files Browse the repository at this point in the history
+ RPi Zero W | Now fully supported (including onboard WiFi/BT):
https://github.com/Fourdee/DietPi/issues/787

+ General | Wlan: 'disable power save' on boot, is now a service,
installed when WiFi is enabled in 'dietpi-config' or via
'dietpi-set_hardware'.

+ DietPi-Software | Syncthing-inotify: Installation updated to 0.8.5
(thanks John!)
  • Loading branch information
Fourdee committed Mar 8, 2017
1 parent 3e1bc63 commit 4c0063f
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ v146
(xx/03/17)

Changes / Improvements / Optimizations:
RPi Zero W | Now fully supported (including onboard WiFi/BT): https://github.com/Fourdee/DietPi/issues/787
General | Wlan: 'disable power save' on boot, is now a service, installed when WiFi is enabled in 'dietpi-config' or via 'dietpi-set_hardware'.
DietPi-Software | Syncthing-inotify: Installation updated to 0.8.5 (thanks John!)

Bug fixes:
General | RPi: Resolved an issue with sudo not having setuid bit set. Many thanks to @WolfganP for the fix: https://github.com/Fourdee/DietPi/issues/794
Expand Down
3 changes: 0 additions & 3 deletions dietpi/boot
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,6 @@ _EOF_
#Find first index number for network devices (checks 0-9)
/DietPi/dietpi/func/obtain_network_details
#----------------------------------------------------------------
#Disable WiFi power management (in addition to /etc/network/interfaces power options)
sleep 20 && iwconfig wlan$(sed -n 2p /DietPi/dietpi/.network) power off & #Delay: Only sets once WiFi is connected.
#----------------------------------------------------------------
#Ensure DietPi login and banner scripts always exists (eg: if user disables it)
if (( $(grep -ci -m1 '^/DietPi/dietpi/login' /root/.bashrc) == 0 )); then

Expand Down
7 changes: 4 additions & 3 deletions dietpi/dietpi-config
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model)
DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model)
HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model)
HW_ONBOARD_WIFI=$(sed -n 10p /DietPi/dietpi/.hw_model)

#/////////////////////////////////////////////////////////////////////////////////////
#Obtain Install Stage Index
Expand Down Expand Up @@ -1839,7 +1840,7 @@
ifup wlan$WIFI_INDEX

# disable power saving
iwconfig wlan$WIFI_INDEX power off
systemctl restart wifi_disable_powersave

fi

Expand Down Expand Up @@ -2454,8 +2455,8 @@ _EOF_

# - Onboard WiFi
local onboard_wifi_enabled=1
# RPi 3
if (( $HW_MODEL == 3 )); then
# RPi 3/ZeroW
if (( $HW_ONBOARD_WIFI == 1 )); then

if [ -f /etc/modprobe.d/disable_wifi_rpi3_onboard.conf ]; then

Expand Down
12 changes: 12 additions & 0 deletions dietpi/dietpi-obtain_hw_model
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
# - Line 9 - Group CPU's
# HW_CPUID 0 Not set
# HW_CPUID 1 H3
# - Line 10 - Onboard WiFi/BT Index
# HW_ONBOARD_WIFI 0 Not set
# HW_ONBOARD_WIFI 1 RPi3/ZeroW (BCM43438)
#////////////////////////////////////

#Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales.
Expand All @@ -88,6 +91,7 @@
HW_ARCH_DESCRIPTION='unknown'
IMAGE_ADDITIONAL_CREDITS=''
HW_CPUID=0
HW_ONBOARD_WIFI=0

ROOTFS_DEVICE_PATH=$(df | grep -m1 '/$' | awk '{print $1}')

Expand Down Expand Up @@ -322,6 +326,13 @@
HW_ARCH_DESCRIPTION+=' (Unknown)'
fi

#Onboard WiFi/BT Index:
if (( $HW_MODEL == 3 )) || [ "$HW_MODEL_DESCRIPTION" = "RPi Zero W" ]; then

HW_ONBOARD_WIFI=1

fi

# - Add HW arch to HW desc
HW_MODEL_DESCRIPTION+=" ($HW_ARCH_DESCRIPTION)"

Expand All @@ -336,6 +347,7 @@ $HW_ARCH
$HW_ARCH_DESCRIPTION
$IMAGE_ADDITIONAL_CREDITS
$HW_CPUID
$HW_ONBOARD_WIFI
_EOF_
#-----------------------------------------------------------------------------------
exit
Expand Down
6 changes: 3 additions & 3 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -5536,17 +5536,17 @@ _EOF_
# - armv6+
if (( $HW_ARCH >= 1 && $HW_ARCH < 10 )); then

INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing-inotify/releases/download/v0.8.4/syncthing-inotify-linux-arm-v0.8.4.tar.gz'
INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing-inotify/releases/download/v0.8.5/syncthing-inotify-linux-arm-v0.8.5.tar.gz'

# - arm64
elif (( $HW_ARCH == 10 )); then

INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing-inotify/releases/download/v0.8.4/syncthing-inotify-linux-arm-v0.8.4.tar.gz'
INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing-inotify/releases/download/v0.8.5/syncthing-inotify-linux-arm-v0.8.5.tar.gz'

# - x86_64
elif (( $HW_ARCH == 21 )); then

INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing-inotify/releases/download/v0.8.4/syncthing-inotify-linux-amd64-v0.8.4.tar.gz'
INSTALL_URL_ADDRESS='https://github.com/syncthing/syncthing-inotify/releases/download/v0.8.5/syncthing-inotify-linux-amd64-v0.8.5.tar.gz'

fi

Expand Down
30 changes: 26 additions & 4 deletions dietpi/func/dietpi-set_hardware
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model)
DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model)
HW_CPUID=$(sed -n 9p /DietPi/dietpi/.hw_model)
HW_ONBOARD_WIFI=$(sed -n 10p /DietPi/dietpi/.hw_model)

Unknown_Input_Name(){

Expand Down Expand Up @@ -1124,8 +1125,8 @@ _EOF_

fi

# + RPi 3
if (( $HW_MODEL == 3 )); then
# + RPi 3/ZeroW
if (( $HW_ONBOARD_WIFI == 1 )); then

#pi-bluetooth contains hciuart service and also pulls in firmware: https://github.com/Fourdee/DietPi/issues/693
# Installed by default as of v142
Expand Down Expand Up @@ -1257,6 +1258,10 @@ _EOF_

done

#Disable powersave being applied
systemctl disable wifi_disable_powersave
rm /etc/systemd/system/wifi_disable_powersave.service &> /dev/null

# - Enable
elif [ "$INPUT_DEVICE_VALUE" = "enable" ]; then

Expand All @@ -1283,20 +1288,37 @@ _EOF_
#Update our networking file (refresh active wlan index)
/DietPi/dietpi/func/obtain_network_details

#Disable powersave on boot service:
cat << _EOF_ > /etc/systemd/system/wifi_disable_powersave.service
[Unit]
Description=Disable WiFi power management
After=network.target network-online.target
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=/bin/bash -c 'sleep 20;iwconfig wlan$(sed -n 2p /DietPi/dietpi/.network) power off
[Install]
WantedBy=multi-user.target
_EOF_
systemctl daemon-reload
systemctl enable wifi_disable_powersave
systemctl start wifi_disable_powersave

elif [ "$INPUT_DEVICE_VALUE" = "onboard_enable" ]; then

#NB: Requires reboot
#NB: Do not change filenames, -f check used by DietPi-Config to obtain state

# - RPi 3
rm /etc/modprobe.d/disable_wifi_rpi3_onboard.conf &> /dev/null

elif [ "$INPUT_DEVICE_VALUE" = "onboard_disable" ]; then

#NB: Requires reboot
#NB: Do not change filenames, -f check used by DietPi-Config to obtain state

# - RPi 3
# - RPi 3/ZeroW
echo -e "blacklist brcmfmac" > /etc/modprobe.d/disable_wifi_rpi3_onboard.conf
echo -e "blacklist brcmutil" >> /etc/modprobe.d/disable_wifi_rpi3_onboard.conf

Expand Down
6 changes: 6 additions & 0 deletions dietpi/misc/rpi_boardinfo
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@
HW_PCB_REVISION='1.3'
MEMORY=512
MANUFACTURER='Sony'
elif [[ "$HW_REVISION" = *"9000c1" ]]; then
HW_RELEASE_DATE='Q1 2017'
HW_MODEL_NAME='Zero W'
HW_PCB_REVISION='1.1'
MEMORY=512
MANUFACTURER='Sony'
fi

#-----------------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions dietpi/patch_file
Original file line number Diff line number Diff line change
Expand Up @@ -2371,6 +2371,9 @@ _EOF_
#/usr/bin/sudo: https://github.com/Fourdee/DietPi/issues/794
chmod 4755 /usr/bin/sudo
#-------------------------------------------------------------------------------
#HW model script update:
/DietPi/dietpi/dietpi-obtain_hw_model
#-------------------------------------------------------------------------------

fi

Expand Down

0 comments on commit 4c0063f

Please sign in to comment.