device-xiaomi-pyxis: Enable ADSP (sensors)

Mostly workarounds for OpenRC, works as-is with systemd.

Signed-off-by: Alicja Michalska <ellyqw@mainlining.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8021>
This commit is contained in:
Alicja Michalska 2026-02-21 20:51:48 +01:00 committed by The Friendly Meow (merge) Bot
parent 5ed3ef9b36
commit a591222a4a
No known key found for this signature in database
3 changed files with 30 additions and 1 deletions

View file

@ -2,7 +2,7 @@
maintainer="Alicja Michalska <ellyqw@mainlining.org>"
pkgname=device-xiaomi-pyxis
pkgdesc="Xiaomi Mi 9 Lite"
pkgver=3
pkgver=4
pkgrel=0
url="https://postmarketos.org"
license="MIT"
@ -27,12 +27,18 @@ depends="
unl0kr-fbforcerefresh
"
makedepends="devicepkg-dev"
install="$pkgname-openrc.post-install"
source="
81-libssc-xiaomi-pyxis.rules
deviceinfo
hexagonrpcd.confd
kernel-cmdline.conf
modules-initfs
no-hexagonrpcd-on-suspend.sh
"
subpackages="
$pkgname-openrc
"
build() {
@ -40,6 +46,7 @@ build() {
}
package() {
replaces="$pkgname-nonfree-firmware"
devicepkg_package $startdir $pkgname
# Sensors depend on ADSP firmware and the sensors registry served over FastRPC.
@ -49,10 +56,20 @@ package() {
"$pkgdir"/usr/lib/udev/rules.d/81-libssc-xiaomi-pyxis.rules
}
openrc() {
install_if="$pkgname=$pkgver-r$pkgrel openrc"
depends="hexagonrpcd-openrc openrc"
# The FastRPC service is only enabled when non-free firmware is installed.
install -Dm755 "$srcdir"/no-hexagonrpcd-on-suspend.sh \
-t "$subpkgdir"/usr/libexec/elogind/system-sleep
}
sha512sums="
41676f77528046ed5eb87b11daea228a9280d3f54e1cdb6e4f645b77fa51cdbffb3355cff289804763dd102bb4a4fff8052d1c4391b44ad55031c83cff3e00af 81-libssc-xiaomi-pyxis.rules
c774ea9c547f0dd6bdc577be116b0a575531dd5fc61ebb03fef58e0698dfbd9ffacb546e89b3c4a4b159a7f1e98e340ed3b74fb14807c5e55418d198b91632d7 deviceinfo
7b9cae334ac9f7467002ee43f3ffef7c174e28683082fdf71e292d3ecd23e341d6b65dcbe9084da28eaf2fab00b45cf1e1bdf836afce39908c697f47f60a2dd8 hexagonrpcd.confd
a9879d2e6c109c7b9ba9263703e88bd6664a63c340d25fa16fda465df5a57b819d0e7182ea505d6d0c8d831dda658d65040f9b9b079dc1afe0127b9dd4abb7e0 kernel-cmdline.conf
06dfc9f41ab196406300acddd411c95f8ba47f49be01a291b4a33767d56b88a16741306223ec767930b71ab08aab82a29f0dacbde2bb45c32de1728b6cb35b14 modules-initfs
2972005a9cf6ca57061965075593dddfa8ee479bc6c21cd41851b1a14768cb1cddbd31a17975ae17adc36d40d294ccbc6bf83defbd69fc7b363f638d8564fbbc no-hexagonrpcd-on-suspend.sh
"

View file

@ -0,0 +1,3 @@
#!/bin/sh
rc-update add hexagonrpcd-adsp-sensorspd

View file

@ -0,0 +1,9 @@
#!/bin/sh
if [ "$1" = "pre" ]
then
# If HexagonRPCD listens for a remote method call while the device is
# waking up, the DSP may crash. Assume that HexagonRPCD has fulfilled
# all incoming remote method invocations, and stop it.
rc-service hexagonrpcd-adsp-sensorspd stop
fi