diff --git a/README.md b/README.md index edca995..f4c6ae9 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,8 @@ PCSCF= ``` Find it in a stock-firmware capture or your carrier's IMS documentation, then -`systemctl restart imsd`. See the +`systemctl restart imsd` (the service is enabled at boot and waits for this +file to exist). See the [imsd README](https://forgejo.catcrafts.net/Catcrafts/imsd) for the full variable reference and carrier assumptions. diff --git a/aports/device/fp6-no-suspend/APKBUILD b/aports/device/fp6-no-suspend/APKBUILD new file mode 100644 index 0000000..91de06c --- /dev/null +++ b/aports/device/fp6-no-suspend/APKBUILD @@ -0,0 +1,21 @@ +# The FP6's wifi and BT share the WCN combo chip; systemd idle-suspend (and +# BT-off) resets the shared firmware and kills wifi for ~40 minutes. Mask +# the sleep targets declaratively - shipped as /dev/null symlinks, the same +# state 'systemctl mask' produces. +maintainer="Jorijn van der Graaf " +pkgname=fp6-no-suspend +pkgver=1 +pkgrel=0 +pkgdesc="Mask systemd sleep targets (suspend kills wifi on the FP6)" +url="https://forgejo.catcrafts.net/Catcrafts/fp6-img" +arch="noarch" +license="MIT" +options="!check" + +package() { + for t in sleep suspend hibernate hybrid-sleep; do + mkdir -p "$pkgdir/etc/systemd/system" + ln -s /dev/null "$pkgdir/etc/systemd/system/$t.target" + done +} +sha512sums="" diff --git a/aports/modem/imsd/80-imsd.preset b/aports/modem/imsd/80-imsd.preset new file mode 100644 index 0000000..9ee121f --- /dev/null +++ b/aports/modem/imsd/80-imsd.preset @@ -0,0 +1 @@ +enable imsd.service diff --git a/aports/modem/imsd/APKBUILD b/aports/modem/imsd/APKBUILD index 1a9238b..8314201 100644 --- a/aports/modem/imsd/APKBUILD +++ b/aports/modem/imsd/APKBUILD @@ -31,6 +31,7 @@ _commit="REPLACED_BY_CI" source=" imsd-$_commit.tar.gz org.kde.modem.daemon.desktop + 80-imsd.preset " builddir="$srcdir/$pkgname" @@ -46,6 +47,18 @@ package() { make install DESTDIR="$pkgdir" install -Dm644 "$srcdir"/org.kde.modem.daemon.desktop \ "$pkgdir"/etc/skel/.config/autostart/org.kde.modem.daemon.desktop + # enabled by preset: the unit is a no-op until /etc/imsd.env exists, and + # VoLTE surviving reboots must not depend on a manual systemctl enable + install -Dm644 "$srcdir"/80-imsd.preset \ + "$pkgdir"/usr/lib/systemd/system-preset/80-imsd.preset + mkdir -p "$pkgdir"/etc/systemd/system/multi-user.target.wants + ln -s /usr/lib/systemd/system/imsd.service \ + "$pkgdir"/etc/systemd/system/multi-user.target.wants/imsd.service + # ...but only actually start once the carrier config exists, so + # unconfigured systems don't boot into a failing unit + mkdir -p "$pkgdir"/usr/lib/systemd/system/imsd.service.d + printf '[Unit]\nConditionPathExists=/etc/imsd.env\n' \ + > "$pkgdir"/usr/lib/systemd/system/imsd.service.d/10-require-config.conf } systemd() { @@ -57,4 +70,5 @@ systemd() { sha512sums=" REPLACED_BY_CI imsd-REPLACED_BY_CI.tar.gz REPLACED_BY_CI org.kde.modem.daemon.desktop +REPLACED_BY_CI 80-imsd.preset " diff --git a/build.sh b/build.sh index 911f6c8..95dbedc 100755 --- a/build.sh +++ b/build.sh @@ -100,6 +100,7 @@ mkdir -p "$WORK/pmaports/temp" cp -r aports/device/linux-postmarketos-qcom-milos "$WORK/pmaports/device/testing/" cp -r aports/device/soc-fairphone-fp6-audio "$WORK/pmaports/device/" cp -r aports/device/callaudioshim "$WORK/pmaports/device/" +cp -r aports/device/fp6-no-suspend "$WORK/pmaports/device/" cp -r aports/main/postmarketos-config-nftables "$WORK/pmaports/main/" cp -r aports/modem/imsd "$WORK/pmaports/modem/" # Alpine forks carrying the GNSS patches (libqmi !470 unreleased; MM !1463 @@ -150,7 +151,7 @@ aports = $WORK/pmaports device = fairphone-fp6 ui = plasma-mobile systemd = always -extra_packages = soc-fairphone-fp6-audio,callaudioshim,imsd +extra_packages = soc-fairphone-fp6-audio,callaudioshim,imsd,fp6-no-suspend EOF pmbootstrap checksum linux-postmarketos-qcom-milos