From effccf042289ad997659591e9ffb5fc604b8dc24 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 12 Feb 2025 09:03:21 -0800 Subject: [PATCH] community/hexagonrpcd: improvements to how service is configured This drops the /etc/conf.d/* config from the openrc subpkg. Upstream states that the dir specified here is only for testing and that distros/admins should install config for device-specific paths. By having this default config in /etc/conf.d, it's more difficult for downstream (pmOS) to do this, we have to use `replaces=` everywhere we need to change this conf for the many different devices that need it. This also adds support for loading the fw path from /usr/share/hexagonrpc. pmOS can use this to install device-specific config into (and this will make it nicer to re-use this config on non-openrc init systems). The openrc init scripts for hexagonrpcd will use the path in /etc/conf.d if a sys admin/user installed it, then it'll try to load the path from /usr/share, and finally use the default value for that fw path if it fails to find any in those config files. Functionally there should be no impact over what path is used today. This change is done primarily to support downstream packaging of config for this service. --- community/hexagonrpcd/APKBUILD | 13 ++++--------- .../hexagonrpcd/hexagonrpcd-adsp-rootpd.initd | 15 ++++++++++++++- .../hexagonrpcd/hexagonrpcd-adsp-sensorspd.initd | 15 ++++++++++++++- community/hexagonrpcd/hexagonrpcd-sdsp.initd | 15 ++++++++++++++- community/hexagonrpcd/hexagonrpcd.confd | 4 ---- 5 files changed, 46 insertions(+), 16 deletions(-) delete mode 100644 community/hexagonrpcd/hexagonrpcd.confd diff --git a/community/hexagonrpcd/APKBUILD b/community/hexagonrpcd/APKBUILD index e64f17a0caa..f95872aabe9 100644 --- a/community/hexagonrpcd/APKBUILD +++ b/community/hexagonrpcd/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Dylan Van Assche pkgname=hexagonrpcd pkgver=0.3.2 -pkgrel=2 +pkgrel=3 pkgdesc="Qualcomm HexagonFS daemon" url="https://github.com/linux-msm/hexagonrpc" # s390x: fails on 1 test. Hexagonrpcd is specific to Qualcomm ARM SoCs, so let's ignore it for now. @@ -16,7 +16,6 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/linux-msm/hexagonrpc/archive $pkgname-adsp-rootpd.initd $pkgname-adsp-sensorspd.initd $pkgname-sdsp.initd - $pkgname.confd " builddir="$srcdir/hexagonrpc-$pkgver" @@ -41,17 +40,13 @@ package() { install -Dm755 "$srcdir"/$pkgname-adsp-rootpd.initd "$pkgdir"/etc/init.d/$pkgname-adsp-rootpd install -Dm755 "$srcdir"/$pkgname-adsp-sensorspd.initd "$pkgdir"/etc/init.d/$pkgname-adsp-sensorspd install -Dm755 "$srcdir"/$pkgname-sdsp.initd "$pkgdir"/etc/init.d/$pkgname-sdsp - install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname-sdsp - install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname-adsp-rootpd - install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname-adsp-sensorspd } sha512sums=" ae97a78fad238ab3bc452a5282cc2a78e6fb385934f0c595ae4b746699cc38cee1c24a612860f21fbaa2edaaca4b41dd0993b255d86df79f1d9871411c489c84 hexagonrpcd-0.3.2.tar.gz f931cf5f901a7c17ffb0eb194b5de2c532fd238692898bf264c484b13b93119c9727bd8f8daf6a7d1668cc9108a9a0662231d300c6f1376e3e4edd3ce41d235d 10-fastrpc.rules -4ccabf6579ff1bb42d1875a51eddb9884bc65ed60eed723f7747ac6abea7b3a7acf05cfe3bf66a13bec6e22f7bbf48e88b598457286d738fd03e0a69f9263b67 hexagonrpcd-adsp-rootpd.initd -971557a233b9bf7386a8c3641b318b81b38647004eb54687a69a1b5c44506acd7c7cc23d038f3a3ba5c8fcfe191440ce0a06d6e5f42d798da18b7683e2d89a8b hexagonrpcd-adsp-sensorspd.initd -7e9153046370f6a8dd6c6686702866be192364a111216900256a666d726ad97a0cda88f682b18476ea74532081c6e961018529c5213719e1f34f104257a9a4a1 hexagonrpcd-sdsp.initd -e989e45853e2abd17c16ec7cdf9990f4a4ade5a36bb798fb28d5ce8cd264fe693699b196b240cfe3c83949f6931488a59aa446d43b263e168fa3758a5754a71a hexagonrpcd.confd +758bc0d1b1f8c843247ba11bc1aa797914894bc78b97f440cabd08f16ce138b2251c0475e80d7b43841c6ef8528549c6fc8ab0fd67a9e9d8988bef692ddf6fb7 hexagonrpcd-adsp-rootpd.initd +3514e3d06d4e318bab623d49d3122b2c3ccb83b62958d53fad04d0f906ae7af143eebb2e3f82dc914f5f4a5256a79b60b7d2f8dda3d628729bbb760cb8f7dd88 hexagonrpcd-adsp-sensorspd.initd +c78e4c02904d359433b2d1c5c6daa9379fcf6afb1cb78bc04451b483e8e2060a2d29b186edb4346b6d61780faba8aa0e94247ece5f31d410ec76434ee5fa006d hexagonrpcd-sdsp.initd " diff --git a/community/hexagonrpcd/hexagonrpcd-adsp-rootpd.initd b/community/hexagonrpcd/hexagonrpcd-adsp-rootpd.initd index 4c24379d81e..f0bd0b916f4 100644 --- a/community/hexagonrpcd/hexagonrpcd-adsp-rootpd.initd +++ b/community/hexagonrpcd/hexagonrpcd-adsp-rootpd.initd @@ -5,5 +5,18 @@ name="Hexagonrpcd ADSP RootPD" description="Daemon to support Qualcomm Hexagon ADSP virtual filesystem for RootPD" command=/usr/bin/hexagonrpcd -command_args="-f /dev/fastrpc-adsp -d adsp -R ${hexagonrpcd_fw_dir}" command_user=fastrpc:fastrpc + +# Implement some conf loading heirarchy where the fw path is loaded from these +# locations in order of precedence: +# 1) /etc/conf.d/$RC_SVCNAME +# 2) /usr/share/hexagonrpcd/$RC_SVCNAME".conf +# 3) use default path (/usr/share/qcom) +if [ -z "$hexagonrpcd_fw_dir" ]; then + # note: /etc/conf.d is sourced automatically by openrc, so if the var is empty + # here then that conf doesn't exist + [ -f "/usr/share/hexagonrpcd/$RC_SVCNAME".conf ] && . "/usr/share/hexagonrpcd/$RC_SVCNAME".conf + hexagonrpcd_fw_dir="${hexagonrpcd_fw_dir:-/usr/share/qcom}" +fi + +command_args="-f /dev/fastrpc-adsp -d adsp -R ${hexagonrpcd_fw_dir}" diff --git a/community/hexagonrpcd/hexagonrpcd-adsp-sensorspd.initd b/community/hexagonrpcd/hexagonrpcd-adsp-sensorspd.initd index c313c092727..c7962f62396 100644 --- a/community/hexagonrpcd/hexagonrpcd-adsp-sensorspd.initd +++ b/community/hexagonrpcd/hexagonrpcd-adsp-sensorspd.initd @@ -5,5 +5,18 @@ name="Hexagonrpcd ADSP SensorPD" description="Daemon to support Qualcomm Hexagon ADSP virtual filesystem for SensorPD" command=/usr/bin/hexagonrpcd -command_args="-f /dev/fastrpc-adsp -d adsp -s -R ${hexagonrpcd_fw_dir}" command_user=fastrpc:fastrpc + +# Implement some conf loading heirarchy where the fw path is loaded from these +# locations in order of precedence: +# 1) /etc/conf.d/$RC_SVCNAME +# 2) /usr/share/hexagonrpcd/$RC_SVCNAME".conf +# 3) use default path (/usr/share/qcom) +if [ -z "$hexagonrpcd_fw_dir" ]; then + # note: /etc/conf.d is sourced automatically by openrc, so if the var is empty + # here then that conf doesn't exist + [ -f "/usr/share/hexagonrpcd/$RC_SVCNAME".conf ] && . "/usr/share/hexagonrpcd/$RC_SVCNAME".conf + hexagonrpcd_fw_dir="${hexagonrpcd_fw_dir:-/usr/share/qcom}" +fi + +command_args="-f /dev/fastrpc-adsp -d adsp -s -R ${hexagonrpcd_fw_dir}" diff --git a/community/hexagonrpcd/hexagonrpcd-sdsp.initd b/community/hexagonrpcd/hexagonrpcd-sdsp.initd index a81bb2f3b82..d601537a8e1 100644 --- a/community/hexagonrpcd/hexagonrpcd-sdsp.initd +++ b/community/hexagonrpcd/hexagonrpcd-sdsp.initd @@ -5,5 +5,18 @@ name="Hexagonrpcd SDSP" description="Daemon to support Qualcomm Hexagon SDSP virtual filesystem" command=/usr/bin/hexagonrpcd -command_args="-f /dev/fastrpc-sdsp -d sdsp -s -R ${hexagonrpcd_fw_dir}" command_user=fastrpc:fastrpc + +# Implement some conf loading heirarchy where the fw path is loaded from these +# locations in order of precedence: +# 1) /etc/conf.d/$RC_SVCNAME +# 2) /usr/share/hexagonrpcd/$RC_SVCNAME".conf +# 3) use default path (/usr/share/qcom) +if [ -z "$hexagonrpcd_fw_dir" ]; then + # note: /etc/conf.d is sourced automatically by openrc, so if the var is empty + # here then that conf doesn't exist + [ -f "/usr/share/hexagonrpcd/$RC_SVCNAME".conf ] && . "/usr/share/hexagonrpcd/$RC_SVCNAME".conf + hexagonrpcd_fw_dir="${hexagonrpcd_fw_dir:-/usr/share/qcom}" +fi + +command_args="-f /dev/fastrpc-sdsp -d sdsp -s -R ${hexagonrpcd_fw_dir}" diff --git a/community/hexagonrpcd/hexagonrpcd.confd b/community/hexagonrpcd/hexagonrpcd.confd deleted file mode 100644 index f1ff0213b94..00000000000 --- a/community/hexagonrpcd/hexagonrpcd.confd +++ /dev/null @@ -1,4 +0,0 @@ -# By default, hexagonrpcd searches for firmware in /usr/share/qcom. -# But it can be overrided using the hexagonrpcd_fw_dir option below. -# To learn more, kindly refer to https://gitlab.com/sdm670-mainline/hexagonrpc#hexagonfs. -hexagonrpcd_fw_dir="/usr/share/qcom"