ShadowDance Posted November 27, 2020 Posted November 27, 2020 If you want the fans of your Helios64 to start spinning earlier, look no further. This will allow the fans to spin at a constant speed from the earliest stage of initrd until fancontrol is started by the system. My use-case is for full disk encryption and recovery in initramfs, sometimes I can have the machine powered on for quite a while before fancontrol starts. Or, if the boot process encounters an error the fans may never start, this prevents that. Step 1: Tell initramfs to include the pwm-fan module echo pwm-fan | sudo tee -a /etc/initramfs-tools/modules Step 2: Create a new file at /etc/initramfs-tools/scripts/init-top/fan with the following contents: #!/bin/sh PREREQ="" prereqs() { echo "$PREREQ" } case $1 in prereqs) prereqs exit 0 ;; esac . /scripts/functions modprobe pwm-fan for pwm in /sys/devices/platform/p*-fan/hwmon/hwmon*/pwm1; do echo 150 >$pwm done exit 0 Feel free to change the value 150 anywhere between 1-255, it decides how fast the fans will spin. Step 3: Enable the fan script for inclusion in initramfs and update the initramfs image: sudo chmod +x /etc/initramfs-tools/scripts/init-top/fan sudo update-initramfs -u -k all Step 4: Reboot and ejoy the cool breeze. 3
barnumbirr Posted November 27, 2020 Posted November 27, 2020 This is actually really smart. @gprovost could something along these lines be added to the default setup?
gprovost Posted November 30, 2020 Posted November 30, 2020 Nice approach and you right it is something we should implement in baseline. We will work on that.
Recommended Posts