Skip to content

Commit

Permalink
Remove all powersave options, its part of the network module
Browse files Browse the repository at this point in the history
  • Loading branch information
guysoft committed Oct 19, 2024
1 parent baf6d1c commit 0c9fc3a
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 268 deletions.
12 changes: 0 additions & 12 deletions src/modules/headless_nm/config
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@

# shellcheck disable=all

# Use disable power save for wifi module
[ -n "$HEADLESS_NM_DISABLE_PWRSAVE" ] || HEADLESS_NM_DISABLE_PWRSAVE=yes

# Type of power save rclocal/service/udev
# rclocal - backwards compatibility, runs via rc.local
# service - will add an systemd.service to enable or disable behavior
# on reboots
# udev - creates a udev rules that should affect all wifi devices.

[ -n "$HEADLESS_NM_PWRSAVE_TYPE" ] || HEADLESS_NM_PWRSAVE_TYPE=udev


# DO NOT MODIFY BELOW THIS LINE UNLESS YOU KNOW CONSEQUENCES...

[ -n "$HEADLESS_NM_DEPS" ] || HEADLESS_NM_DEPS="network-manager dos2unix uuid"

This file was deleted.

This file was deleted.

90 changes: 0 additions & 90 deletions src/modules/headless_nm/filesystem/usr/local/bin/pwrsave

This file was deleted.

104 changes: 0 additions & 104 deletions src/modules/headless_nm/filesystem/usr/local/bin/pwrsave-udev

This file was deleted.

36 changes: 0 additions & 36 deletions src/modules/headless_nm/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,3 @@ systemctl_if_exists enable headless_nm.service
if [ -f "/boot/WiFi-README.txt" ]; then
sed -i 's|OS_NAME|'"${DIST_NAME}"'|g' /boot/WiFi-README.txt
fi

# Install powersave option
if [ "$HEADLESS_NM_DISABLE_PWRSAVE" == "yes" ]; then

# Use rc.local
if [ "$HEADLESS_NM_PWRSAVE_TYPE" == "rclocal" ]; then
echo_green "Modifying /etc/rc.local ..."
sed -i 's@exit 0@@' /etc/rc.local
(echo "# Disable WiFi Power Management"; \
echo 'echo "Disabling power management for wlan0 ..."' ; \
echo "/usr/local/bin/pwrsave off"; echo "exit 0") >> /etc/rc.local
fi
# Use service
if [ "$HEADLESS_NM_PWRSAVE_TYPE" == "service" ]; then
echo_green "Installing disable-wifi-pwr-mgmt service ..."
unpack filesystem/etc/systemd/system /etc/systemd/system root
systemctl_if_exists enable disable-wifi-pwr-mgmt.service
fi
# Use udev rule
if [ "$HEADLESS_NM_PWRSAVE_TYPE" == "udev" ]; then
echo_green "Installing WiFi Power Management udev rule ..."
unpack filesystem/etc/udev/rules.d /etc/udev/rules.d root
fi
# strip out unneeded script, depending on choose
if [ "$HEADLESS_NM_PWRSAVE_TYPE" != "udev" ]; then
rm -f /usr/local/bin/pwrsave-udev
else
rm -f /usr/local/bin/pwrsave
fi
fi

# Remove scripts if powersave option is not used.
if [ "$HEADLESS_NM_DISABLE_PWRSAVE" == "no" ]; then
rm -f /usr/local/bin/pwrsave-udev
rm -f /usr/local/bin/pwrsave
fi

0 comments on commit 0c9fc3a

Please sign in to comment.