#!/bin/sh
# Mark the running A/B slot successful once the system is up -- runit is in
# stage 2 and sshd runs -- so the bootloader stops counting its retries down
# (qcom-ab-slot, docs/BOOT.md).  A slot that was flashed and set active
# starts unproven again (retry 7, not successful) until this has run.
# Its output goes to the kernel log; then the service idles, so runsv does
# not run it again.
sv check sshd >/dev/null 2>&1 || exit 1
/usr/bin/qcom-ab-slot mark-successful 2>&1 |
	while IFS= read -r l; do echo "qcom-ab-slot: $l" > /dev/kmsg; done
exec pause
