Files
mi8-platina-linux/scripts/phone-battery-guard.openrc
T
shenlei 4f3fe1f94b
Offline project checks / check (push) Canceled after 0s
Fix candidate build metadata and runtime safeguards
Repair kernel patch formatting and refresh kernel/camera package revisions and checksums. Integrate battery guard into generated images, correct charging controls and emergency shutdown handling, and reject invalid camera authentication configuration.

Extend recipe validation and regression coverage, and update build and installation documentation. Kernel, camera and image compilation remain pending on the build server.
2026-11-09 10:49:22 +09:00

22 lines
685 B
Plaintext
Executable File

#!/sbin/openrc-run
description="Platina battery health and emergency shutdown daemon (50-65% SoC, auto-poweroff <= 5%)"
command="/usr/local/sbin/platina-battery-guard"
command_user="root:root"
command_args="--low ${low:-50} --high ${high:-65} --max-temp ${max_temp:-45} --shutdown-at ${shutdown_at:-5} --interval ${interval:-60}"
supervisor="supervise-daemon"
respawn_delay=5
respawn_max=5
respawn_period=1800
pidfile="/run/platina-battery-guard.pid"
output_log="/var/log/platina-battery-guard.log"
error_log="/var/log/platina-battery-guard.log"
depend() {
need localmount
after udev-trigger
}
start_pre() {
checkpath --file --mode 0640 --owner root:root "$output_log"
}