mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-19 19:54:40 +02:00
Added Void Linux support (runit)
This commit is contained in:
parent
3807d6d4a2
commit
5a4d8f7bf3
@ -132,6 +132,22 @@ function tool_install {
|
|||||||
separator
|
separator
|
||||||
complete_msg
|
complete_msg
|
||||||
separator
|
separator
|
||||||
|
# Void Linux
|
||||||
|
elif [ -f /etc/os-release ] && eval "$(cat /etc/os-release)" && [[ $ID == "void"* ]]; then
|
||||||
|
separator
|
||||||
|
echo -e "\nDetected Void Linux ditribution\n"
|
||||||
|
separator
|
||||||
|
echo -e "\nSetting up Python environment\n"
|
||||||
|
xbps-install -Suy python3 python3-pip python3-devel python3-setuptools base-devel dmidecode
|
||||||
|
separator
|
||||||
|
echo -e "\nInstalling necessary Python packages\n"
|
||||||
|
pip_pkg_install
|
||||||
|
separator
|
||||||
|
echo -e "\ninstalling auto-cpufreq tool\n"
|
||||||
|
install
|
||||||
|
separator
|
||||||
|
complete_msg
|
||||||
|
separator
|
||||||
# Other
|
# Other
|
||||||
else
|
else
|
||||||
separator
|
separator
|
||||||
|
@ -11,6 +11,27 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Install script for runit
|
||||||
|
if [ -f /etc/os-release ] && eval "$(cat /etc/os-release)" && [[ $ID == "void"* ]]; then
|
||||||
|
echo -e "\n* Deploy auto-cpufreq runit unit file"
|
||||||
|
mkdir /etc/sv/auto-cpufreq
|
||||||
|
cp /usr/local/share/auto-cpufreq/scripts/run /etc/sv/auto-cpufreq
|
||||||
|
chmod +x /etc/sv/auto-cpufreq/run
|
||||||
|
|
||||||
|
echo -e "\n* Creating symbolic link (/var/service/auto-cpufreq -> /etc/sv/auto-cpufreq)"
|
||||||
|
ln -s /etc/sv/auto-cpufreq /var/service
|
||||||
|
|
||||||
|
echo -e "\n* Stopping auto-cpufreq daemon (runit) service"
|
||||||
|
sv stop auto-cpufreq
|
||||||
|
|
||||||
|
echo -e "\n* Starting auto-cpufreq daemon (runit) service"
|
||||||
|
sv start auto-cpufreq
|
||||||
|
sv up auto-cpufreq
|
||||||
|
|
||||||
|
|
||||||
|
# Install script for systemd
|
||||||
|
else
|
||||||
echo -e "\n* Deploy auto-cpufreq systemd unit file"
|
echo -e "\n* Deploy auto-cpufreq systemd unit file"
|
||||||
cp /usr/local/share/auto-cpufreq/scripts/auto-cpufreq.service /etc/systemd/system/auto-cpufreq.service
|
cp /usr/local/share/auto-cpufreq/scripts/auto-cpufreq.service /etc/systemd/system/auto-cpufreq.service
|
||||||
|
|
||||||
@ -25,3 +46,4 @@ systemctl start auto-cpufreq
|
|||||||
|
|
||||||
echo -e "\n* Enabling auto-cpufreq daemon (systemd) service at boot"
|
echo -e "\n* Enabling auto-cpufreq daemon (systemd) service at boot"
|
||||||
systemctl enable auto-cpufreq
|
systemctl enable auto-cpufreq
|
||||||
|
fi
|
||||||
|
@ -11,6 +11,16 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f /etc/os-release ] && eval "$(cat /etc/os-release)" && [[ $ID == "void"* ]]; then
|
||||||
|
echo -e "\n* Stopping auto-cpufreq daemon (runit) service"
|
||||||
|
sv stop auto-cpufreq
|
||||||
|
|
||||||
|
echo -e "\n* Removing auto-cpufreq daemon (runit) unit files"
|
||||||
|
rm -rf /etc/sv/auto-cpufreq
|
||||||
|
rm -rf /var/service/auto-cpufreq
|
||||||
|
|
||||||
|
else
|
||||||
echo -e "\n* Stopping auto-cpufreq daemon (systemd) service"
|
echo -e "\n* Stopping auto-cpufreq daemon (systemd) service"
|
||||||
systemctl stop auto-cpufreq
|
systemctl stop auto-cpufreq
|
||||||
|
|
||||||
@ -25,3 +35,4 @@ systemctl daemon-reload
|
|||||||
|
|
||||||
echo -e "reset failed"
|
echo -e "reset failed"
|
||||||
systemctl reset-failed
|
systemctl reset-failed
|
||||||
|
fi
|
||||||
|
2
scripts/run
Executable file
2
scripts/run
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
exec /usr/bin/auto-cpufreq --daemon
|
Loading…
x
Reference in New Issue
Block a user