Last active
April 21, 2022 06:48
-
-
Save valmat/6f59f9a087a01c133a82345869d2f043 to your computer and use it in GitHub Desktop.
Fix DELL freezes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: fixdell | |
# Required-Start: $local_fs $syslog $named | |
# Required-Stop: $local_fs $syslog $named | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Fix DELL freezes | |
# Description: startup script for Fix DELL freezes | |
### END INIT INFO | |
# | |
# /etc/init.d/fixdell -- startup script | |
# | |
# move this file to `/etc/init.d` | |
# Then do `chmod +x /etc/init.d/fixdell` | |
# update-rc.d fixdell defaults | |
# | |
# To remove do: | |
# update-rc.d fixdell remove | |
# | |
if [ "$UID" != "0" ] | |
then | |
echo "You must be root" | |
exit; | |
fi | |
case "$1" in | |
start) | |
for file in `ls /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor`; do | |
echo performance > $file | |
done; | |
# echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor | |
;; | |
check) | |
nom=0 | |
for file in `ls /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor`; do | |
echo "[$nom] $file : `cat $file`" | |
let "nom = nom + 1" | |
done; | |
# echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor | |
;; | |
reset) | |
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor | |
;; | |
stop) | |
;; | |
restart) | |
;; | |
*) | |
echo "Please use start, stop, check, restart or reset as first argument" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have two DELL laptops. And both are freeze randomly.
This startup script fixes freezes.
I found solving on following pages:
https://blog.hosni.me/2018/07/fix-linux-freezing-problem-on-dell.html
https://ixnfo.com/en/changing-cpu-scaling-governor-on-linux.html