1
0
Fork 0
mirror of https://gitlab.postmarketos.org/postmarketOS/pmaports.git synced 2025-07-12 16:19:48 +03:00

google-bonito: mirror sargo changes

Mirror some of the changes to the Pixel 3a:

    device-google-sargo: add sensors support (MR 5329)
    google-sargo: add gpi to modules-initfs to fix fde (MR 5347)
    google-sargo: do not enable HexagonRPCD on every upgrade (MR 5400)
    google-sargo: stop HexagonRPCD on suspend (MR 5400)
    google-sargo: make necessary userspace changes for kernel v6.10.2
    device-google-sargo: remove nonfree_firmware subpkg (MR 6107)
    device-google-sargo: Fix hexagonrpcd on systemd (MR 6147)
    device-google-sargo: install hexagonrpcd conf to new location (MR 6217)
    device/*: explicitly depend on openrc if install scripts call rc-update

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6718
This commit is contained in:
Richard Acayan 2024-09-30 18:15:02 -04:00 committed by Anjandev Momi
parent ac28c52eef
commit d1f8b4179f
No known key found for this signature in database
GPG key ID: 74482A13A109255D
6 changed files with 58 additions and 15 deletions

View file

@ -0,0 +1,8 @@
# Invert the acceleration so it is directed downwards, at rest on a planet.
# This is for compatibility with iio-sensor-proxy.
#
# https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/375
SUBSYSTEM=="misc", KERNEL=="fastrpc-adsp*", ENV{ACCEL_MOUNT_MATRIX}="-1, 0, 0; 0, -1, 0; 0, 0, -1"
# Be compatible with the fix to CVE 2024-41024.
SUBSYSTEM=="misc", KERNEL=="fastrpc-adsp-secure", SYMLINK="fastrpc-adsp"

View file

@ -2,7 +2,7 @@
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=device-google-bonito
pkgdesc="Google Pixel 3a XL"
pkgver=5
pkgver=6
pkgrel=0
url="https://postmarketos.org"
license="MIT"
@ -10,23 +10,32 @@ arch="aarch64"
options="!check !archcheck"
depends="
alsa-ucm-conf-qcom-sdm670
firmware-google-sargo
hexagonrpcd
linux-firmware-ath10k
linux-firmware-qca
linux-firmware-qcom
make-dynpart-mappings
mkbootimg
postmarketos-base
soc-qcom
soc-qcom-modem
soc-qcom-qbootctl
unl0kr-fbforcerefresh
"
makedepends="devicepkg-dev"
source="
81-libssc-google-sargo.rules
deviceinfo
hexagonrpcd-adsp-sensorspd.confd
modules-initfs
no-hexagonrpcd-on-suspend.sh
q6voiced.conf
"
subpackages="
$pkgname-kernel-sdc:kernel_sdc
$pkgname-kernel-tianma:kernel_tianma
$pkgname-nonfree-firmware:nonfree_firmware
$pkgname-openrc:openrc
"
build() {
@ -34,7 +43,18 @@ build() {
}
package() {
replaces="$pkgname-nonfree-firmware"
devicepkg_package $startdir $pkgname
# Sensors depend on ADSP firmware and the sensors registry served over FastRPC.
install -Dm644 "$srcdir"/hexagonrpcd-adsp-sensorspd.confd \
"$pkgdir"/usr/share/hexagonrpcd/hexagonrpcd-adsp-sensorspd.conf
install -Dm644 "$srcdir"/81-libssc-google-sargo.rules \
"$pkgdir"/usr/lib/udev/rules.d/81-libssc-google-sargo.rules
# The q6voiced configuration can only be used if the ADSP is brought up
# via non-free firmware.
install -Dm644 "$srcdir"/q6voiced.conf "$pkgdir"/etc/conf.d/q6voiced
}
kernel_sdc() {
@ -51,23 +71,23 @@ kernel_tianma() {
devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}
nonfree_firmware() {
pkgdesc="Proprietary firmware blobs for the Google Pixel 3a XL"
depends="
firmware-google-sargo
linux-firmware-ath10k
linux-firmware-qca
linux-firmware-qcom
soc-qcom-modem
"
openrc() {
install_if="$pkgname=$pkgver-r$pkgrel openrc"
# Enable HexagonRPCD by default, but not if the user installed this
# package then disabled it.
install="$subpkgname.post-install"
depends="hexagonrpcd-openrc openrc"
# The q6voiced configuration can only be used if the ADSP is brought up
# via non-free firmware.
install -Dm644 "$srcdir"/q6voiced.conf "$subpkgdir"/etc/conf.d/q6voiced
# The FastRPC service is only enabled when non-free firmware is installed.
install -Dm755 "$srcdir"/no-hexagonrpcd-on-suspend.sh \
"$subpkgdir"/etc/elogind/system-sleep/no-hexagonrpcd-on-suspend.sh
}
sha512sums="
089ce0acba4e1d789e337bedfca7570796a6416e7230ae9b8fc6b625747a40dbb064b1a707877cd6b7bdc73844c6571316e2ec0746a77060f13d98c52fdbfc00 81-libssc-google-sargo.rules
e417f9a4da0dd595e34c520c10aef89e480336d9d57b66284a98777afce1dbc3dcda30f8a3a1c625b5e5e19aae4a95f28e00ca47e5d0e993ca922da5107bd837 deviceinfo
1eb5f138619f499fab31ea64f63ee9f8984f195528708ec6a01ddc533c74cfb71d1442b97905ae15db24b8faac259fa3e89db357ca9c747ce3ee598c2d681639 modules-initfs
b6208c254b6e44ac4f6d748a38cc6b05da0db2c90235ada2011b138b82ccc3372687df2f5ad97e885e9eea135216a3c52266a08a7f4eb323e62e799f6f82ec7b hexagonrpcd-adsp-sensorspd.confd
0253ff4688b789aa7cdbffb22e7ff9497aabe083adc44bf33fa52617215a1f48fc722bd61aa13a35d109eff1e69202eb599dccff029e39c0a390dcab11dd9b76 modules-initfs
2972005a9cf6ca57061965075593dddfa8ee479bc6c21cd41851b1a14768cb1cddbd31a17975ae17adc36d40d294ccbc6bf83defbd69fc7b363f638d8564fbbc no-hexagonrpcd-on-suspend.sh
3a4a9322839d4b3ef9d79668a37840a9f444954759ae3c512e694051d2f9a2573db42ad6c4c1a5c75eeb861232a27ba1a8cef9b503decd54ead25a96e3dd6f98 q6voiced.conf
"

View file

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

View file

@ -0,0 +1,2 @@
# HexagonFS root directory for served files.
hexagonrpcd_fw_dir="/usr/share/qcom/sdm670/Google/sargo"

View file

@ -1,3 +1,4 @@
gpi
i2c_qcom_geni
rmi_core
rmi_i2c

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