From 8d66e5a915b28c17cbc390f4fec00a04af237b0c Mon Sep 17 00:00:00 2001 From: Drew Short Date: Sat, 12 Sep 2015 00:22:28 +0000 Subject: [PATCH] Added odroid xu4 specific system files --- hardware_specific/odroid-xu4/README | 13 +++++++++++ .../odroid-xu4/update-fans.service | 6 +++++ hardware_specific/odroid-xu4/update-fans.sh | 22 +++++++++++++++++++ .../odroid-xu4/update-fans.timer | 8 +++++++ .../installers/install_tools_arch.sh | 0 5 files changed, 49 insertions(+) create mode 100644 hardware_specific/odroid-xu4/README create mode 100644 hardware_specific/odroid-xu4/update-fans.service create mode 100755 hardware_specific/odroid-xu4/update-fans.sh create mode 100644 hardware_specific/odroid-xu4/update-fans.timer rename install_tools_arch.sh => scripts/installers/install_tools_arch.sh (100%) diff --git a/hardware_specific/odroid-xu4/README b/hardware_specific/odroid-xu4/README new file mode 100644 index 0000000..0cf7123 --- /dev/null +++ b/hardware_specific/odroid-xu4/README @@ -0,0 +1,13 @@ +Included are the the following files to more gracefully handle temperatures on the odroid xu4 running with systemd. + +update-fans.sh is the script that actually updates the system files for the fan. Namely the fan speed and temperature settings. +It gets installed into /usr/local/bin/ + +update-fans.service is the service that calls the script to update the fans +update-fans.timer is the systemd timer that updates the fan speeds 5 seconds after systemd starts. + +These should be placed in /usr/lib/systemd/system or wherever your systemd services and timers are stored + +Finally the timer should be activated with "systemctl enable update-fans.timer". +If you don't feel like restarting to change the fan settings immediately, you can run "systemctl start update-fans.service" + diff --git a/hardware_specific/odroid-xu4/update-fans.service b/hardware_specific/odroid-xu4/update-fans.service new file mode 100644 index 0000000..24d528b --- /dev/null +++ b/hardware_specific/odroid-xu4/update-fans.service @@ -0,0 +1,6 @@ +[Unit] +Description=update-fans + +[Service] +Type=simple +ExecStart=/usr/local/bin/update-fans.sh diff --git a/hardware_specific/odroid-xu4/update-fans.sh b/hardware_specific/odroid-xu4/update-fans.sh new file mode 100755 index 0000000..df201e0 --- /dev/null +++ b/hardware_specific/odroid-xu4/update-fans.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# +# Run as root as a systemd service at startup +# + +# Set the triggering temp levels to 40/75/85 +# Supposedly continuous operation at over 85C is not recommended +echo "40 75 85" > /sys/devices/odroid_fan.13/temp_levels +# Set the fan speeds to: +# 1 at below 40C (Off) +# 28% above 40C and below 75C +# 75% above 75C and below 85C +# 100% above 85C +echo "1 28 75 100" > /sys/devices/odroid_fan.13/fan_speeds + +# Display the current fan speed and temperature +# +# Sensor 2 seems to be the processor, or atleast the one that triggers the fan speeds +# +# Sensor 4 is always lower than the other sensors and doesn't change as fast under CPU load. Possibly memory controller? +#cat /sys/devices/odroid_fan.13/pwm_duty && sudo cat /sys/devices/10060000.tmu/temp diff --git a/hardware_specific/odroid-xu4/update-fans.timer b/hardware_specific/odroid-xu4/update-fans.timer new file mode 100644 index 0000000..bf74017 --- /dev/null +++ b/hardware_specific/odroid-xu4/update-fans.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Update the system fan and temperature setting at startup + +[Timer] +OnStartupSec=5 + +[Install] +WantedBy=multi-user.target diff --git a/install_tools_arch.sh b/scripts/installers/install_tools_arch.sh similarity index 100% rename from install_tools_arch.sh rename to scripts/installers/install_tools_arch.sh