Added Void Linux support (runit)
This commit is contained in:
parent
3807d6d4a2
commit
5a4d8f7bf3
|
@ -132,6 +132,22 @@ function tool_install {
|
|||
separator
|
||||
complete_msg
|
||||
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
|
||||
else
|
||||
separator
|
||||
|
|
|
@ -11,17 +11,39 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
echo -e "\n* Reloading systemd manager configuration"
|
||||
systemctl daemon-reload
|
||||
# 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* Stopping auto-cpufreq daemon (systemd) service"
|
||||
systemctl stop auto-cpufreq
|
||||
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* Starting auto-cpufreq daemon (systemd) service"
|
||||
systemctl start auto-cpufreq
|
||||
echo -e "\n* Stopping auto-cpufreq daemon (runit) service"
|
||||
sv stop auto-cpufreq
|
||||
|
||||
echo -e "\n* Enabling auto-cpufreq daemon (systemd) service at boot"
|
||||
systemctl enable 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"
|
||||
cp /usr/local/share/auto-cpufreq/scripts/auto-cpufreq.service /etc/systemd/system/auto-cpufreq.service
|
||||
|
||||
echo -e "\n* Reloading systemd manager configuration"
|
||||
systemctl daemon-reload
|
||||
|
||||
echo -e "\n* Stopping auto-cpufreq daemon (systemd) service"
|
||||
systemctl stop auto-cpufreq
|
||||
|
||||
echo -e "\n* Starting auto-cpufreq daemon (systemd) service"
|
||||
systemctl start auto-cpufreq
|
||||
|
||||
echo -e "\n* Enabling auto-cpufreq daemon (systemd) service at boot"
|
||||
systemctl enable auto-cpufreq
|
||||
fi
|
||||
|
|
|
@ -11,17 +11,28 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "\n* Stopping auto-cpufreq daemon (systemd) service"
|
||||
systemctl stop auto-cpufreq
|
||||
|
||||
echo -e "\n* Disabling auto-cpufreq daemon (systemd) at boot"
|
||||
systemctl disable auto-cpufreq
|
||||
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 (systemd) unit file"
|
||||
rm /etc/systemd/system/auto-cpufreq.service
|
||||
echo -e "\n* Removing auto-cpufreq daemon (runit) unit files"
|
||||
rm -rf /etc/sv/auto-cpufreq
|
||||
rm -rf /var/service/auto-cpufreq
|
||||
|
||||
echo -e "\n* Reloading systemd manager configuration"
|
||||
systemctl daemon-reload
|
||||
else
|
||||
echo -e "\n* Stopping auto-cpufreq daemon (systemd) service"
|
||||
systemctl stop auto-cpufreq
|
||||
|
||||
echo -e "reset failed"
|
||||
systemctl reset-failed
|
||||
echo -e "\n* Disabling auto-cpufreq daemon (systemd) at boot"
|
||||
systemctl disable auto-cpufreq
|
||||
|
||||
echo -e "\n* Removing auto-cpufreq daemon (systemd) unit file"
|
||||
rm /etc/systemd/system/auto-cpufreq.service
|
||||
|
||||
echo -e "\n* Reloading systemd manager configuration"
|
||||
systemctl daemon-reload
|
||||
|
||||
echo -e "reset failed"
|
||||
systemctl reset-failed
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
exec /usr/bin/auto-cpufreq --daemon
|
Loading…
Reference in New Issue