diff --git a/config/boards/khadas-vim4.wip b/config/boards/khadas-vim4.wip index b24c7cfcff..a3d1bfb103 100644 --- a/config/boards/khadas-vim4.wip +++ b/config/boards/khadas-vim4.wip @@ -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 +} diff --git a/config/sources/families/meson-s4t7.conf b/config/sources/families/meson-s4t7.conf index 557c3fa3ba..1f7ec747e2 100644 --- a/config/sources/families/meson-s4t7.conf +++ b/config/sources/families/meson-s4t7.conf @@ -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 +} diff --git a/packages/bsp/meson-s4t7/fan.service b/packages/bsp/meson-s4t7/fan.service new file mode 100644 index 0000000000..e815d82a7b --- /dev/null +++ b/packages/bsp/meson-s4t7/fan.service @@ -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