diff --git a/auto-cpufreq-installer b/auto-cpufreq-installer index 7bad7f4..b16cbba 100755 --- a/auto-cpufreq-installer +++ b/auto-cpufreq-installer @@ -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 diff --git a/scripts/auto-cpufreq-install.sh b/scripts/auto-cpufreq-install.sh index c800e60..330a5c5 100755 --- a/scripts/auto-cpufreq-install.sh +++ b/scripts/auto-cpufreq-install.sh @@ -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 \ No newline at end of file + 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 diff --git a/scripts/auto-cpufreq-remove.sh b/scripts/auto-cpufreq-remove.sh index a387c33..704ba4e 100755 --- a/scripts/auto-cpufreq-remove.sh +++ b/scripts/auto-cpufreq-remove.sh @@ -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 \ No newline at end of file + 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 diff --git a/scripts/run b/scripts/run new file mode 100755 index 0000000..153a02a --- /dev/null +++ b/scripts/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/auto-cpufreq --daemon