guysoft / CustomPiOS

A Raspberry Pi and other ARM devices distribution builder
GNU General Public License v3.0
508 stars 146 forks source link

feat: add pwrsave script to network module #168

Closed KwadFan closed 2 years ago

KwadFan commented 2 years ago

This changes allow to customize behavior of network modules power save for wifi.

The used method spits out an error if the device has no wifi built in, which confuses the user.

To prevent that I implemented a simple solution that the user only get a warning if no wifi device present.

Also added functionality to disable the whole mechanism. You can choose a standard rc.local entry or a systemd service to manipulate behavior on reboots (Enable/Disable the service)

Signed-off-by: Stephan Wendel me@stephanwe.de

KwadFan commented 2 years ago

Prove of concept:

https://github.com/KwadFan/MainsailOS/actions/runs/2560281839 -> with rc.local option https://github.com/KwadFan/MainsailOS/actions/runs/2560248574 -> with service option

Test runs will be removed after merge, for future visitors, it works :)

meteyou commented 2 years ago

this is a "screenshot" from a PI 2 with this service: PXL_20220625_143852846

guysoft commented 2 years ago

Looks good, though just a thought - perhaps its a better idea to make it go in the udev rules setting - that way it would also act better on the rpi2 output @meteyou gave. Something along the lines of: https://superuser.com/a/629263/268425

Its better than the rclocal we have now.

KwadFan commented 2 years ago

How about adding a third option to use udev rule? My intention was to provide something simple, useable for the "enduser" but not to go far away from a existing solution to not break something that uses rc.local style. Personally I like the udev method, that should also provide something simple like an systemctl disable wifi.....

guysoft commented 2 years ago

@KwadFan Sure, if you are up for it that would be great!

KwadFan commented 2 years ago

@KwadFan Sure, if you are up for it that would be great!

Could be take a few days, because I am o Vacation but will do.

KwadFan commented 2 years ago

@guysoft I think I did what you thought about as a better solution. The rule and the script itself works fine. Didnt test a build yet.

guysoft commented 2 years ago

Thanks for doing that. Merged :) Lets see how it works out

KwadFan commented 2 years ago

Mentioning #169 and #170