From 42dd2e07d2ef334ad046b8be78f1b4621886cd07 Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Sun, 1 Jun 2025 20:20:29 +1000 Subject: [PATCH] device-google-sargo: Enable GNSS automatically Following the steps described here: https://gitlab.com/sdm670-mainline/linux/-/issues/4#note_2448131089 we can enable GNSS automatically at boot. Resolves: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/2788 Signed-off-by: Alistair Francis Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6588 --- device/community/device-google-sargo/APKBUILD | 13 ++++++++++++- .../device-google-sargo-openrc.post-install | 1 + .../community/device-google-sargo/modem-gnss.initd | 9 +++++++++ .../device-google-sargo/modem-gnss.service | 11 +++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 device/community/device-google-sargo/modem-gnss.initd create mode 100644 device/community/device-google-sargo/modem-gnss.service diff --git a/device/community/device-google-sargo/APKBUILD b/device/community/device-google-sargo/APKBUILD index c8d9d22de..39c1e0aa0 100644 --- a/device/community/device-google-sargo/APKBUILD +++ b/device/community/device-google-sargo/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Richard Acayan pkgname=device-google-sargo pkgdesc="Google Pixel 3a" -pkgver=12 +pkgver=13 pkgrel=0 url="https://postmarketos.org" license="MIT" @@ -29,6 +29,8 @@ source=" 81-libssc-google-sargo.rules deviceinfo hexagonrpcd.confd + modem-gnss.initd + modem-gnss.service modules-initfs no-hexagonrpcd-on-suspend.sh plasmacamerarc @@ -37,6 +39,7 @@ source=" subpackages=" $pkgname-openrc $pkgname-plasma-camera:plasma_camera + $pkgname-systemd " build() { @@ -56,6 +59,12 @@ package() { # 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 + + install -Dm755 "$srcdir"/modem-gnss.initd \ + "$pkgdir"/etc/init.d/modem-gnss + + install -Dm755 "$srcdir"/modem-gnss.service \ + -t "$pkgdir"/usr/lib/systemd/system } openrc() { @@ -80,6 +89,8 @@ sha512sums=" 089ce0acba4e1d789e337bedfca7570796a6416e7230ae9b8fc6b625747a40dbb064b1a707877cd6b7bdc73844c6571316e2ec0746a77060f13d98c52fdbfc00 81-libssc-google-sargo.rules ad032b1a35cfcd4fc0c8df988430ee97b711e785b86cca68b7552b23a9a2e2b6b97c327e3415a575db47ad6c1f86ded18df5553acaae63010057d89b8c16135e deviceinfo b6208c254b6e44ac4f6d748a38cc6b05da0db2c90235ada2011b138b82ccc3372687df2f5ad97e885e9eea135216a3c52266a08a7f4eb323e62e799f6f82ec7b hexagonrpcd.confd +99773091f2653f71d4365fdf4cce048a1904cd044a714778567ce0ff6c9c9d76ad537e6e49d1d02bf385f9d35c00794d093ece0fed046072ed5e1ea65baa5201 modem-gnss.initd +c55833c796804966ac8cae4a719aa41df3728b0fc080f11ee94dfb17807c2ff428ffe0061355f913317f5d44ccfa67bda535f1c0a9d9a895d6415a0f71109f92 modem-gnss.service 925d8b176a8f1b47a86a1026cc920ffae99ceb35c3e52c222654c15078907579d23c4d68ed65a98ab937f59aaba2bbdd74da8d273e8b9c1ac87a52f718d383d6 modules-initfs 2972005a9cf6ca57061965075593dddfa8ee479bc6c21cd41851b1a14768cb1cddbd31a17975ae17adc36d40d294ccbc6bf83defbd69fc7b363f638d8564fbbc no-hexagonrpcd-on-suspend.sh 53bec3338d875ecedf2ae981cf9a0f9066e276f09570b3bd06217414461126a76942b70e01c3bb18831fbefeb188621dd5a341ab2604e8fb0c6de8a3025177e2 plasmacamerarc diff --git a/device/community/device-google-sargo/device-google-sargo-openrc.post-install b/device/community/device-google-sargo/device-google-sargo-openrc.post-install index 0ab38f727..9aa74bb79 100644 --- a/device/community/device-google-sargo/device-google-sargo-openrc.post-install +++ b/device/community/device-google-sargo/device-google-sargo-openrc.post-install @@ -1,3 +1,4 @@ #!/bin/sh rc-update add hexagonrpcd-adsp-sensorspd +rc-update add modem-gnss default diff --git a/device/community/device-google-sargo/modem-gnss.initd b/device/community/device-google-sargo/modem-gnss.initd new file mode 100644 index 000000000..1d886a615 --- /dev/null +++ b/device/community/device-google-sargo/modem-gnss.initd @@ -0,0 +1,9 @@ +#!/sbin/openrc-run +name="Google Sargo (Pixel 3a) GNSS Modem Setup" + +start() +{ + qmicli -d qrtr://0 --loc-set-engine-lock=mt + qmicli -d qrtr://0 --loc-set-nmea-types=all + eend 0 +} diff --git a/device/community/device-google-sargo/modem-gnss.service b/device/community/device-google-sargo/modem-gnss.service new file mode 100644 index 000000000..82dd3e4cd --- /dev/null +++ b/device/community/device-google-sargo/modem-gnss.service @@ -0,0 +1,11 @@ +[Unit] +Description=Google Sargo (Pixel 3a) GNSS Modem Setup + +[Service] +ExecStart=qmicli -d qrtr://0 --loc-set-engine-lock=mt +ExecStart=qmicli -d qrtr://0 --loc-set-nmea-types=all +Type=oneshot + +[Install] +WantedBy=default.target +