pyavitz / debian-image-builder

Debian image builder for single board computers
Other
141 stars 33 forks source link

Modified script to further reduce impact on current CPU freq #37

Closed 0n3man closed 2 years ago

0n3man commented 2 years ago

Script needs root privileges to check /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq. The act of running sudo impacts this value on lower end boards. Since root permission are always required to run this script, if the script isn't run as root I have the script run itself with sudo. This removes the need for sudo to be inline with the check for cpuinfo_cur_freq. In addition since the script is now running as root I also removed any other sudo calls. An alternative approach would be to have this script use scaling_cur_freq instead of cpuinfo_cur_freq. Scaling _cur_freq is maintained by the linux kernel, while cpuinfo_cur_freq actually pulls the value from the hardware.