mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
meson-s4t7: add systemd service to enable fan in automatic mode
The service is only enabled by default on Vim4 as that board heats a lot and a fan is absolutely necessary. Service will be available on vim1s as well and if someone has purchased the fan for it, they would be able to enable it themselves. The service is only added for legacy kernel right now as I am not sure if the upcoming 5.15 kernel will have same sysfs interface for fan.
This commit is contained in:
@@ -25,3 +25,10 @@ function post_family_tweaks_bsp__kvim4_isp_modprobe() {
|
||||
softdep iv009_isp pre: iv009_isp_iq iv009_isp_lens iv009_isp_sensor
|
||||
EOD
|
||||
}
|
||||
|
||||
function post_family_tweaks_bsp__enable_fan_service() {
|
||||
if [[ ${BRANCH} = "legacy" ]]; then
|
||||
run_host_command_logged mkdir -p "${destination}"/etc/systemd/system/mutli-user.target.wants
|
||||
run_host_command_logged ln -sf /etc/systemd/system/fan.service "${destination}"/etc/systemd/system/mutli-user.target.wants/fan.service
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -106,3 +106,10 @@ function image_specific_armbian_env_ready__force_16x9_display() {
|
||||
run_host_command_logged echo "force_16x9_display=true" >>${SDCARD}/boot/armbianEnv.txt
|
||||
fi
|
||||
}
|
||||
|
||||
function post_family_tweaks_bsp__add_fan_service() {
|
||||
if [[ ${BRANCH} = "legacy" ]]; then
|
||||
run_host_command_logged mkdir -p "${destination}"/etc/systemd/system
|
||||
run_host_command_logged cp "${SRC}"/packages/bsp/meson-s4t7/fan.service "${destination}"/etc/systemd/system
|
||||
fi
|
||||
}
|
||||
|
||||
11
packages/bsp/meson-s4t7/fan.service
Normal file
11
packages/bsp/meson-s4t7/fan.service
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Automatic Fan Control Service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=Yes
|
||||
ExecStart=/bin/sh -c "echo 1 > /sys/class/fan/mode"
|
||||
ExecStart=/bin/sh -c "echo 1 > /sys/class/fan/enable"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user