main/shutdown-clear-rtc-wakealarm: new aport (MR 3905)

This contains an OpenRC service that clears the RTC wake alarm.
Users who don't want the RTC wake alarm to power on their phone from
powered-off state can use this service to clear the alarm during shutdown.

Fixes #1970

[ci:skip-build] already built successfully in CI
This commit is contained in:
Arnavion 2023-02-27 10:02:01 -08:00 committed by Clayton Craft
parent c30dd812f2
commit 69773b8cc5
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
3 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,20 @@
# Maintainer: Arnav Singh <me@arnavion.dev>
pkgname=shutdown-clear-rtc-wakealarm
pkgver=1.0.0
pkgrel=0
pkgdesc="Pre-shutdown service to clear RTC wake alarm"
url="https://wiki.postmarketos.org/wiki/Shutdown-clear-rtc-wakealarm"
arch="noarch"
license="MIT"
source="
clear-rtc-wakealarm.shutdown.initd
"
install="$pkgname.post-install"
package() {
install -Dm755 "$srcdir"/clear-rtc-wakealarm.shutdown.initd "$pkgdir"/etc/init.d/clear-rtc-wakealarm
}
sha512sums="
5e19659b9e8d2ab182ea8658a752d08c950c526546864288c5387a3e28f7973baebcf0d49350bfced1387160f4dde963c6f921f5cd4e3730940b88ae3e443cba clear-rtc-wakealarm.shutdown.initd
"

View file

@ -0,0 +1,7 @@
#!/sbin/openrc-run
description="Clear RTC wake alarm during shutdown"
start() {
echo 0 >/sys/class/rtc/rtc0/wakealarm
}

View file

@ -0,0 +1,12 @@
#!/bin/sh
# Print usage instructions
cat << __EOF__
*
* To use this service, add it to the shutdown runlevel with:
*
* rc-update add clear-rtc-wakealarm shutdown
*
__EOF__
exit 0