From 6c27c1c4606ccc6beae44e28788a4d6e6d5436d6 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Sat, 29 Apr 2023 23:09:49 +0100 Subject: [PATCH] soc-qcom-sdm845: encapsulate cellular specific stuff (MR 4047) The upcoming db845c doesn't have cellular modem capabilities, but still has wifi. Avoid installing modem related configs and services by default and only install it for devices that need it. --- .../device-oneplus-enchilada/APKBUILD | 5 ++- .../community/device-oneplus-fajita/APKBUILD | 5 ++- .../community/device-shift-axolotl/APKBUILD | 5 ++- .../device-xiaomi-beryllium/APKBUILD | 5 ++- device/community/soc-qcom-sdm845/APKBUILD | 39 ++++++++++++------- .../soc-qcom-sdm845-modem.post-install | 3 ++ .../soc-qcom-sdm845-modem.post-upgrade | 1 + ...-qcom-sdm845-nonfree-firmware.post-install | 2 - device/testing/device-google-sargo/APKBUILD | 5 ++- device/testing/device-xiaomi-polaris/APKBUILD | 5 ++- device/testing/soc-qcom-msm8998/APKBUILD | 3 +- 11 files changed, 49 insertions(+), 29 deletions(-) create mode 100644 device/community/soc-qcom-sdm845/soc-qcom-sdm845-modem.post-install create mode 120000 device/community/soc-qcom-sdm845/soc-qcom-sdm845-modem.post-upgrade diff --git a/device/community/device-oneplus-enchilada/APKBUILD b/device/community/device-oneplus-enchilada/APKBUILD index 7129d0c20..2cb61d136 100644 --- a/device/community/device-oneplus-enchilada/APKBUILD +++ b/device/community/device-oneplus-enchilada/APKBUILD @@ -4,7 +4,7 @@ pkgname=device-oneplus-enchilada pkgdesc="OnePlus 6" pkgver=9 -pkgrel=0 +pkgrel=1 url="https://postmarketos.org" license="MIT" arch="aarch64" @@ -36,7 +36,8 @@ package() { nonfree_firmware() { pkgdesc="Modem, WiFi and GPU Firmware, also needed for osk-sdl" - depends="firmware-oneplus-sdm845 firmware-oneplus-sdm845-initramfs soc-qcom-sdm845-nonfree-firmware" + depends="firmware-oneplus-sdm845 firmware-oneplus-sdm845-initramfs + soc-qcom-sdm845-nonfree-firmware soc-qcom-sdm845-modem" mkdir "$subpkgdir" install -Dm644 q6voiced.conf "$subpkgdir"/etc/conf.d/q6voiced diff --git a/device/community/device-oneplus-fajita/APKBUILD b/device/community/device-oneplus-fajita/APKBUILD index 67f8ed41e..c5f47fec6 100644 --- a/device/community/device-oneplus-fajita/APKBUILD +++ b/device/community/device-oneplus-fajita/APKBUILD @@ -4,7 +4,7 @@ pkgname=device-oneplus-fajita pkgdesc="OnePlus 6T" pkgver=9 -pkgrel=0 +pkgrel=1 url="https://postmarketos.org" license="MIT" arch="aarch64" @@ -36,7 +36,8 @@ package() { nonfree_firmware() { pkgdesc="Modem, WiFi and GPU Firmware, also needed for osk-sdl" - depends="firmware-oneplus-sdm845 firmware-oneplus-sdm845-initramfs soc-qcom-sdm845-nonfree-firmware" + depends="firmware-oneplus-sdm845 firmware-oneplus-sdm845-initramfs + soc-qcom-sdm845-nonfree-firmware soc-qcom-sdm845-modem" mkdir "$subpkgdir" install -Dm644 q6voiced.conf "$subpkgdir"/etc/conf.d/q6voiced diff --git a/device/community/device-shift-axolotl/APKBUILD b/device/community/device-shift-axolotl/APKBUILD index 646186a11..54ad0a212 100644 --- a/device/community/device-shift-axolotl/APKBUILD +++ b/device/community/device-shift-axolotl/APKBUILD @@ -5,7 +5,7 @@ pkgname=device-shift-axolotl pkgdesc="SHIFT6mq" pkgver=8 -pkgrel=0 +pkgrel=1 url="https://postmarketos.org" license="MIT" arch="aarch64" @@ -42,7 +42,8 @@ package() { nonfree_firmware() { pkgdesc="Modem, GPU and WiFi Firmware, also needed for osk-sdl" - depends="firmware-shift-sdm845 firmware-shift-sdm845-initramfs soc-qcom-sdm845-nonfree-firmware" + depends="firmware-shift-sdm845 firmware-shift-sdm845-initramfs + soc-qcom-sdm845-nonfree-firmware soc-qcom-sdm845-modem" mkdir "$subpkgdir" install -Dm644 q6voiced.conf "$subpkgdir"/etc/conf.d/q6voiced diff --git a/device/community/device-xiaomi-beryllium/APKBUILD b/device/community/device-xiaomi-beryllium/APKBUILD index 392c05706..a0b6aaac3 100644 --- a/device/community/device-xiaomi-beryllium/APKBUILD +++ b/device/community/device-xiaomi-beryllium/APKBUILD @@ -4,7 +4,7 @@ pkgname=device-xiaomi-beryllium pkgdesc="Xiaomi Poco F1" pkgver=8 -pkgrel=0 +pkgrel=1 url="https://postmarketos.org" license="MIT" arch="aarch64" @@ -40,7 +40,8 @@ package() { nonfree_firmware() { pkgdesc="GPU, venus, modem firmware" - depends="firmware-xiaomi-beryllium soc-qcom-sdm845-nonfree-firmware" + depends="firmware-xiaomi-beryllium soc-qcom-sdm845-nonfree-firmware + soc-qcom-sdm845-modem" mkdir "$subpkgdir" install -Dm644 q6voiced.conf "$subpkgdir"/etc/conf.d/q6voiced diff --git a/device/community/soc-qcom-sdm845/APKBUILD b/device/community/soc-qcom-sdm845/APKBUILD index f866c594b..fb1cc824f 100644 --- a/device/community/soc-qcom-sdm845/APKBUILD +++ b/device/community/soc-qcom-sdm845/APKBUILD @@ -3,7 +3,7 @@ pkgname=soc-qcom-sdm845 pkgdesc="Common package for Qualcomm SDM845 devices" pkgver=14 -pkgrel=1 +pkgrel=2 url="https://postmarketos.org" license="BSD-3-Clause" arch="aarch64" @@ -13,6 +13,7 @@ depends=" " replaces="upower" subpackages=" + $pkgname-modem $pkgname-nonfree-firmware:nonfree_firmware $pkgname-qbootctl $pkgname-ucm @@ -40,20 +41,14 @@ package() { "$pkgdir"/etc/UPower/UPower.conf } -nonfree_firmware() { - pkgdesc="Modem, WiFi and GPU Firmware" +modem() { + pkgdesc="Modem services and configuration" depends=" - pd-mapper - pd-mapper-openrc - tqftpserv - tqftpserv-openrc - q6voiced - q6voiced-openrc - msm-modem - msm-modem-uim-selection - bootmac - alsa-utils -" + q6voiced + q6voiced-openrc + msm-modem-uim-selection + " + install="$subpkgname.post-install $subpkgname.post-upgrade" mkdir "$subpkgdir" @@ -72,6 +67,22 @@ nonfree_firmware() { "$subpkgdir"/etc/conf.d/call_audio_idle_suspend_workaround } +nonfree_firmware() { + pkgdesc="Modem, WiFi and GPU Firmware" + depends=" + pd-mapper + pd-mapper-openrc + tqftpserv + tqftpserv-openrc + msm-modem + bootmac + alsa-utils + " + + install="$subpkgname.post-install $subpkgname.post-upgrade" + mkdir "$subpkgdir" +} + ucm() { provides="alsa-ucm-conf" provider_priority=1 diff --git a/device/community/soc-qcom-sdm845/soc-qcom-sdm845-modem.post-install b/device/community/soc-qcom-sdm845/soc-qcom-sdm845-modem.post-install new file mode 100644 index 000000000..5b68137c4 --- /dev/null +++ b/device/community/soc-qcom-sdm845/soc-qcom-sdm845-modem.post-install @@ -0,0 +1,3 @@ +#!/bin/sh +rc-update add q6voiced default +rc-update add call_audio_idle_suspend_workaround default diff --git a/device/community/soc-qcom-sdm845/soc-qcom-sdm845-modem.post-upgrade b/device/community/soc-qcom-sdm845/soc-qcom-sdm845-modem.post-upgrade new file mode 120000 index 000000000..bea1020d6 --- /dev/null +++ b/device/community/soc-qcom-sdm845/soc-qcom-sdm845-modem.post-upgrade @@ -0,0 +1 @@ +soc-qcom-sdm845-modem.post-install \ No newline at end of file diff --git a/device/community/soc-qcom-sdm845/soc-qcom-sdm845-nonfree-firmware.post-install b/device/community/soc-qcom-sdm845/soc-qcom-sdm845-nonfree-firmware.post-install index 11eb098bd..70b9e0efe 100644 --- a/device/community/soc-qcom-sdm845/soc-qcom-sdm845-nonfree-firmware.post-install +++ b/device/community/soc-qcom-sdm845/soc-qcom-sdm845-nonfree-firmware.post-install @@ -1,5 +1,3 @@ #!/bin/sh rc-update add tqftpserv boot rc-update add pd-mapper boot -rc-update add q6voiced default -rc-update add call_audio_idle_suspend_workaround default diff --git a/device/testing/device-google-sargo/APKBUILD b/device/testing/device-google-sargo/APKBUILD index 281cd8784..1b340a4b5 100644 --- a/device/testing/device-google-sargo/APKBUILD +++ b/device/testing/device-google-sargo/APKBUILD @@ -3,7 +3,7 @@ pkgname=device-google-sargo pkgdesc="Google Pixel 3a" pkgver=0.4 -pkgrel=0 +pkgrel=1 url="https://postmarketos.org" license="MIT" arch="aarch64" @@ -31,7 +31,8 @@ package() { nonfree_firmware() { pkgdesc="Proprietary firmware blobs for the Google Pixel 3a" - depends="firmware-google-sargo linux-firmware-qca linux-firmware-qcom msm-firmware-loader soc-qcom-sdm845-nonfree-firmware" + depends="firmware-google-sargo linux-firmware-qca linux-firmware-qcom + msm-firmware-loader soc-qcom-sdm845-modem soc-qcom-sdm845-nonfree-firmware" # Create an empty sub-package directory because this sub-package is empty mkdir "$subpkgdir" diff --git a/device/testing/device-xiaomi-polaris/APKBUILD b/device/testing/device-xiaomi-polaris/APKBUILD index 1053ca4d4..6881db980 100644 --- a/device/testing/device-xiaomi-polaris/APKBUILD +++ b/device/testing/device-xiaomi-polaris/APKBUILD @@ -4,7 +4,7 @@ pkgname=device-xiaomi-polaris pkgdesc="Xiaomi Mi Mix 2S" pkgver=0.1 -pkgrel=1 +pkgrel=2 url="https://postmarketos.org" license="MIT" arch="aarch64" @@ -37,7 +37,8 @@ package() { nonfree_firmware() { pkgdesc="Modem, WiFi and GPU Firmware, also needed for osk-sdl" - depends="firmware-xiaomi-polaris firmware-xiaomi-polaris-initramfs soc-qcom-sdm845-nonfree-firmware" + depends="firmware-xiaomi-polaris firmware-xiaomi-polaris-initramfs + soc-qcom-sdm845-nonfree-firmware soc-qcom-sdm845-modem" mkdir "$subpkgdir" } diff --git a/device/testing/soc-qcom-msm8998/APKBUILD b/device/testing/soc-qcom-msm8998/APKBUILD index e67cd77e7..3eb559200 100644 --- a/device/testing/soc-qcom-msm8998/APKBUILD +++ b/device/testing/soc-qcom-msm8998/APKBUILD @@ -2,7 +2,7 @@ pkgname=soc-qcom-msm8998 pkgdesc="Common package for Qualcomm MSM8998 devices" pkgver=1 -pkgrel=0 +pkgrel=1 url="https://postmarketos.org" license="BSD-3-Clause" arch="aarch64" @@ -18,6 +18,7 @@ package() { nonfree_firmware() { pkgdesc="Modem, WiFi and GPU Firmware" depends=" + soc-qcom-sdm845-modem soc-qcom-sdm845-nonfree-firmware qcom-diag qcom-diag-openrc