armbian-build/packages/bsp/helios64/disable_auto_poweron
Aditya Prayoga a3beb9b5a3
Helios64: Update fan configuration, enable network LED and enable UPS timer (#2376)
* update fancontrol configuration

* Enable network activity led, default to eth0

* Do not disable auto poweron on power loss event

* Added UPS timer

Provide timer to poweroff system after 600 s (10 minutes) of power loss
event. If power restored within that time window, cancel the timer.

* Use different service for legacy

LK 4.4 does not have ledtrig-netdev, so it will cause the service to
fail.

* Use 10m instead 600 seconds in UPS timer

Systemd time can use m suffix for minutes. Use this to make it easier to
read.
2020-11-25 14:18:29 +07:00

22 lines
504 B
Bash
Executable File

#!/bin/bash
online=$(cat /sys/class/power_supply/gpio-charger/online)
[[ $online == 0 ]] && exit 0
# Export GPIO
# AUTO_ON_D
echo 153 > /sys/class/gpio/export
# AUTO_EN_CLK
echo 154 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio153/direction
echo out > /sys/class/gpio/gpio154/direction
# Toggling the D Flip-Flop
echo 0 > /sys/class/gpio/gpio153/value
echo 0 > /sys/class/gpio/gpio154/value
sleep 0.1
echo 1 > /sys/class/gpio/gpio154/value
sleep 0.1
echo 0 > /sys/class/gpio/gpio154/value