mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
add fan-control station m3 (#4837)
This commit is contained in:
47
packages/blobs/station/firefly-fan-init
Executable file
47
packages/blobs/station/firefly-fan-init
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BOARD_VERSION=`cat /sys/firmware/devicetree/base/model | awk -F ' ' {'print $1'}`
|
||||
|
||||
RK3588_BOARD_VERSION=`cat /sys/firmware/devicetree/base/model | awk -F ' ' {'print $2'}`
|
||||
|
||||
sleep 3
|
||||
|
||||
if [ "$BOARD_VERSION" == "CS-R2-3399JD4-MAIN" ]; then
|
||||
#usb_net power on
|
||||
echo 1 > /sys/class/leds/HUB30_PWR_EN/brightness
|
||||
|
||||
/usr/bin/firefly_fan_control CS-R2-3399JD4-MAIN > /dev/null 2>&1 &
|
||||
|
||||
elif [ "$BOARD_VERSION" == "CS-R1-3399JD4-MAIN" ]; then
|
||||
echo 0 > /sys/class/pwm/pwmchip0/export
|
||||
/usr/bin/firefly_fan_control CS-R1-3399JD4-MAIN > /dev/null 2>&1 &
|
||||
|
||||
while true
|
||||
do
|
||||
if [ `cat /sys/class/pwm/pwmchip0/pwm0/enable` == "0" ]; then
|
||||
sleep 2
|
||||
echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
|
||||
elif [ `cat /sys/class/pwm/pwmchip0/pwm0/enable` == "1" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
elif [ "$RK3588_BOARD_VERSION" == "ROC-RK3588S-PC" ]; then
|
||||
/usr/bin/firefly_fan_control ROC-RK3588S-PC > /dev/null 2>&1 &
|
||||
|
||||
elif [ "$RK3588_BOARD_VERSION" == "ITX-3588J" ]; then
|
||||
/usr/bin/firefly_fan_control ITX-3588J > /dev/null 2>&1 &
|
||||
|
||||
elif [ "$RK3588_BOARD_VERSION" == "ROC-RK3588-PC" ]; then
|
||||
/usr/bin/firefly_fan_control ROC-RK3588-PC > /dev/null 2>&1 &
|
||||
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
exit 0
|
||||
9
packages/blobs/station/firefly-fan.service
Executable file
9
packages/blobs/station/firefly-fan.service
Executable file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=start firefly-fan service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/firefly-fan-init
|
||||
|
||||
[Install]
|
||||
WantedBy=local-fs.target
|
||||
BIN
packages/blobs/station/firefly_fan_control
Executable file
BIN
packages/blobs/station/firefly_fan_control
Executable file
Binary file not shown.
Reference in New Issue
Block a user