2026-09-01 23:20:04 +02:00
|
|
|
#!/bin/sh -eu
|
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
2026-09-01 23:31:27 +02:00
|
|
|
# CI package build: cross-compile imsd for aarch64 with crafter-build (the
|
README, AGENTS.md: a short README for people, the detail in AGENTS.md
The README had grown to 422 lines: the device and carrier table came
after 61 lines of architecture, and the configuration section after 237
lines of architecture, that table, build, run and packaging notes and
GNOME Calls detail.
AGENTS.md, a file for coding agents, takes that detail and adds to it: a
reference to the tree at this commit, written from the code and the
bench record. The README is now what a person needs: what imsd is and
its status, the verified device/carrier table, what it needs, how to
install and enable it, the two dialers, a status check for the installed
daemon, a `Not there yet` list, and where the rest is.
In-tree comments that sent readers to README sections which moved — the
cross-compiling flow (the CI workflow, build-package.sh,
APKBUILD.binary), GNOME Calls' known gaps (imsd-ofono-restart-calls.sh),
the D-Bus ABI (main.cpp) and the Configuration section (imsd.service) —
point at AGENTS.md's sections now.
2026-10-03 19:36:52 +02:00
|
|
|
# cross-compiling flow of AGENTS.md §4.3), run the test suite natively, and package
|
2026-09-01 23:31:27 +02:00
|
|
|
# the result via packaging/APKBUILD.binary. Expects an x86_64 Alpine
|
|
|
|
|
# environment with root — the workflow runs it in an alpine:edge job
|
packaging, ci: build the apks with the Crafter.Build Flatpak
Crafter.Build's CI publishes a Flatpak and nothing else since
2026-10-02: the rolling `latest` release's
`crafter-build-linux-x86_64-musl-v2.tar.gz` that build-package.sh
fetched is gone (404 since 2026-10-03), so a push of a release would
fail at `fetch crafter-build` and publish nothing.
Install the Flatpak (`net.catcrafts.CrafterBuild//stable` from
flatpak.catcrafts.net) in the job container and run it as crafter-build.
bubblewrap inside the container needs a privileged runner, so the job
runs on the `flatpak` label. The sysroot stays Alpine edge and gains
llvm-runtimes, the package with the std module source of its own libc++
(libc++-dev ships none). make-sysroot.sh adds its list with --upgrade:
run over a sysroot from before this change (libc++ 22.1.8, no std module
source) a plain add installed llvm-runtimes 23.1.2 alone, and its
std.cppm did not compile against the 22.1.8 headers (`'text_encoding'
file not found`); with --upgrade libc++, libc++-dev and llvm-runtimes
came out at 23.1.2 and it compiled.
AGENTS.md §4.1, §4.3, §8.3 and §9.4 describe the route as it runs, and
the README's Building section carries the install lines. Three comments
in the files this touches said what is not so and are corrected:
package.yml had fp6-img install the package by a pinned version and
sha256 (it takes the newest in the registry), build-package.sh had
fp6-img's image build run `make check` on the aarch64 binaries (it
builds no imsd: no suite runs on them), and make-sysroot.sh's usage line
lacked the --march without which the cross build fails on an x86 host.
Tested: build-package.sh run end to end on this commit in a privileged
alpine:edge container (podman) on the workstation.
2026-10-04 01:23:23 +02:00
|
|
|
# container on the privileged `flatpak` runner: crafter-build is the
|
|
|
|
|
# Crafter.Build Flatpak, and bubblewrap inside the container needs the
|
|
|
|
|
# privilege. Root only installs packages and hands off to a scratch user: the
|
|
|
|
|
# sysroot is built with apk.static --usermode (which refuses root) and abuild
|
|
|
|
|
# wants a user too.
|
2026-09-01 23:20:04 +02:00
|
|
|
#
|
2026-09-01 23:31:27 +02:00
|
|
|
# Built packages land in /home/build/.local/share/abuild/*/aarch64/imsd*.apk;
|
|
|
|
|
# the workflow's publish step uploads them to the Forgejo Alpine registry.
|
2026-09-01 23:20:04 +02:00
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
packaging, ci: build the apks with the Crafter.Build Flatpak
Crafter.Build's CI publishes a Flatpak and nothing else since
2026-10-02: the rolling `latest` release's
`crafter-build-linux-x86_64-musl-v2.tar.gz` that build-package.sh
fetched is gone (404 since 2026-10-03), so a push of a release would
fail at `fetch crafter-build` and publish nothing.
Install the Flatpak (`net.catcrafts.CrafterBuild//stable` from
flatpak.catcrafts.net) in the job container and run it as crafter-build.
bubblewrap inside the container needs a privileged runner, so the job
runs on the `flatpak` label. The sysroot stays Alpine edge and gains
llvm-runtimes, the package with the std module source of its own libc++
(libc++-dev ships none). make-sysroot.sh adds its list with --upgrade:
run over a sysroot from before this change (libc++ 22.1.8, no std module
source) a plain add installed llvm-runtimes 23.1.2 alone, and its
std.cppm did not compile against the 22.1.8 headers (`'text_encoding'
file not found`); with --upgrade libc++, libc++-dev and llvm-runtimes
came out at 23.1.2 and it compiled.
AGENTS.md §4.1, §4.3, §8.3 and §9.4 describe the route as it runs, and
the README's Building section carries the install lines. Three comments
in the files this touches said what is not so and are corrected:
package.yml had fp6-img install the package by a pinned version and
sha256 (it takes the newest in the registry), build-package.sh had
fp6-img's image build run `make check` on the aarch64 binaries (it
builds no imsd: no suite runs on them), and make-sysroot.sh's usage line
lacked the --march without which the cross build fails on an x86 host.
Tested: build-package.sh run end to end on this commit in a privileged
alpine:edge container (podman) on the workstation.
2026-10-04 01:23:23 +02:00
|
|
|
# crafter-build is the Crafter.Build Flatpak: it carries its own clang, lld
|
|
|
|
|
# and libc++, and its SDK has glib, so nothing that compiles is installed
|
|
|
|
|
# here. `stable` is the branch Crafter.Build publishes from its release tags
|
|
|
|
|
# (`beta` follows every push to its master), so the toolchain of a release
|
|
|
|
|
# moves only with a release of the toolchain. The branch is overridable
|
|
|
|
|
# for a rehearsal against another one.
|
|
|
|
|
CRAFTER_REMOTE=${CRAFTER_REMOTE:-https://flatpak.catcrafts.net/catcrafts.flatpakrepo}
|
|
|
|
|
CRAFTER_REF=${CRAFTER_REF:-net.catcrafts.CrafterBuild//stable}
|
2026-09-01 23:31:27 +02:00
|
|
|
|
2026-09-01 23:20:04 +02:00
|
|
|
SRC=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)
|
|
|
|
|
|
packaging, ci: build the apks with the Crafter.Build Flatpak
Crafter.Build's CI publishes a Flatpak and nothing else since
2026-10-02: the rolling `latest` release's
`crafter-build-linux-x86_64-musl-v2.tar.gz` that build-package.sh
fetched is gone (404 since 2026-10-03), so a push of a release would
fail at `fetch crafter-build` and publish nothing.
Install the Flatpak (`net.catcrafts.CrafterBuild//stable` from
flatpak.catcrafts.net) in the job container and run it as crafter-build.
bubblewrap inside the container needs a privileged runner, so the job
runs on the `flatpak` label. The sysroot stays Alpine edge and gains
llvm-runtimes, the package with the std module source of its own libc++
(libc++-dev ships none). make-sysroot.sh adds its list with --upgrade:
run over a sysroot from before this change (libc++ 22.1.8, no std module
source) a plain add installed llvm-runtimes 23.1.2 alone, and its
std.cppm did not compile against the 22.1.8 headers (`'text_encoding'
file not found`); with --upgrade libc++, libc++-dev and llvm-runtimes
came out at 23.1.2 and it compiled.
AGENTS.md §4.1, §4.3, §8.3 and §9.4 describe the route as it runs, and
the README's Building section carries the install lines. Three comments
in the files this touches said what is not so and are corrected:
package.yml had fp6-img install the package by a pinned version and
sha256 (it takes the newest in the registry), build-package.sh had
fp6-img's image build run `make check` on the aarch64 binaries (it
builds no imsd: no suite runs on them), and make-sysroot.sh's usage line
lacked the --march without which the cross build fails on an x86 host.
Tested: build-package.sh run end to end on this commit in a privileged
alpine:edge container (podman) on the workstation.
2026-10-04 01:23:23 +02:00
|
|
|
retry() { # retry <description> <cmd...>
|
|
|
|
|
_desc=$1; shift
|
|
|
|
|
for _i in 1 2 3; do
|
|
|
|
|
"$@" && return 0
|
|
|
|
|
echo "$_desc failed (attempt $_i/3), retrying in 15s..." >&2
|
|
|
|
|
sleep 15
|
|
|
|
|
done
|
|
|
|
|
echo "$_desc failed after 3 attempts" >&2
|
|
|
|
|
return 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# llvm for llvm-strip (abuild in cross mode strips with $CHOST-strip); the
|
|
|
|
|
# compiler is the Flatpak's.
|
2026-09-01 23:20:04 +02:00
|
|
|
if [ "$(id -u)" = 0 ]; then
|
packaging, ci: build the apks with the Crafter.Build Flatpak
Crafter.Build's CI publishes a Flatpak and nothing else since
2026-10-02: the rolling `latest` release's
`crafter-build-linux-x86_64-musl-v2.tar.gz` that build-package.sh
fetched is gone (404 since 2026-10-03), so a push of a release would
fail at `fetch crafter-build` and publish nothing.
Install the Flatpak (`net.catcrafts.CrafterBuild//stable` from
flatpak.catcrafts.net) in the job container and run it as crafter-build.
bubblewrap inside the container needs a privileged runner, so the job
runs on the `flatpak` label. The sysroot stays Alpine edge and gains
llvm-runtimes, the package with the std module source of its own libc++
(libc++-dev ships none). make-sysroot.sh adds its list with --upgrade:
run over a sysroot from before this change (libc++ 22.1.8, no std module
source) a plain add installed llvm-runtimes 23.1.2 alone, and its
std.cppm did not compile against the 22.1.8 headers (`'text_encoding'
file not found`); with --upgrade libc++, libc++-dev and llvm-runtimes
came out at 23.1.2 and it compiled.
AGENTS.md §4.1, §4.3, §8.3 and §9.4 describe the route as it runs, and
the README's Building section carries the install lines. Three comments
in the files this touches said what is not so and are corrected:
package.yml had fp6-img install the package by a pinned version and
sha256 (it takes the newest in the registry), build-package.sh had
fp6-img's image build run `make check` on the aarch64 binaries (it
builds no imsd: no suite runs on them), and make-sysroot.sh's usage line
lacked the --march without which the cross build fails on an x86 host.
Tested: build-package.sh run end to end on this commit in a privileged
alpine:edge container (podman) on the workstation.
2026-10-04 01:23:23 +02:00
|
|
|
apk add -q git curl tar flatpak llvm abuild sudo
|
|
|
|
|
# the Flatpak as a system installation the build user runs; its SDK
|
|
|
|
|
# (org.freedesktop.Sdk) comes from Flathub
|
|
|
|
|
flatpak remote-add --if-not-exists catcrafts "$CRAFTER_REMOTE"
|
|
|
|
|
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
|
|
|
|
retry "install crafter-build" flatpak install -y --noninteractive catcrafts "$CRAFTER_REF"
|
2026-09-01 23:20:04 +02:00
|
|
|
id build >/dev/null 2>&1 || adduser -D build
|
2026-09-01 23:31:27 +02:00
|
|
|
addgroup build abuild 2>/dev/null || true
|
2026-09-01 23:20:04 +02:00
|
|
|
echo 'build ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/build
|
2026-09-01 23:31:27 +02:00
|
|
|
# abuild in cross mode strips with $CHOST-strip; llvm-strip handles any
|
|
|
|
|
# ELF arch, so give it that name
|
|
|
|
|
ln -sf "$(command -v llvm-strip)" /usr/local/bin/aarch64-alpine-linux-musl-strip
|
|
|
|
|
# the CI checkout arrives root-owned; crafter-build writes bin/ into it
|
|
|
|
|
chown -R build "$SRC"
|
|
|
|
|
# -l: a login shell, so HOME really is /home/build (abuild keys + output);
|
|
|
|
|
# it scrubs the environment, so carry the one knob that matters across
|
packaging, ci: build the apks with the Crafter.Build Flatpak
Crafter.Build's CI publishes a Flatpak and nothing else since
2026-10-02: the rolling `latest` release's
`crafter-build-linux-x86_64-musl-v2.tar.gz` that build-package.sh
fetched is gone (404 since 2026-10-03), so a push of a release would
fail at `fetch crafter-build` and publish nothing.
Install the Flatpak (`net.catcrafts.CrafterBuild//stable` from
flatpak.catcrafts.net) in the job container and run it as crafter-build.
bubblewrap inside the container needs a privileged runner, so the job
runs on the `flatpak` label. The sysroot stays Alpine edge and gains
llvm-runtimes, the package with the std module source of its own libc++
(libc++-dev ships none). make-sysroot.sh adds its list with --upgrade:
run over a sysroot from before this change (libc++ 22.1.8, no std module
source) a plain add installed llvm-runtimes 23.1.2 alone, and its
std.cppm did not compile against the 22.1.8 headers (`'text_encoding'
file not found`); with --upgrade libc++, libc++-dev and llvm-runtimes
came out at 23.1.2 and it compiled.
AGENTS.md §4.1, §4.3, §8.3 and §9.4 describe the route as it runs, and
the README's Building section carries the install lines. Three comments
in the files this touches said what is not so and are corrected:
package.yml had fp6-img install the package by a pinned version and
sha256 (it takes the newest in the registry), build-package.sh had
fp6-img's image build run `make check` on the aarch64 binaries (it
builds no imsd: no suite runs on them), and make-sysroot.sh's usage line
lacked the --march without which the cross build fails on an x86 host.
Tested: build-package.sh run end to end on this commit in a privileged
alpine:edge container (podman) on the workstation.
2026-10-04 01:23:23 +02:00
|
|
|
exec su -l build -c "CRAFTER_REF='$CRAFTER_REF' sh -eu '$SRC/packaging/build-package.sh'"
|
2026-09-01 23:20:04 +02:00
|
|
|
fi
|
|
|
|
|
|
2026-09-01 23:31:27 +02:00
|
|
|
# implementations/main.cpp is the version's single source of truth (same
|
|
|
|
|
# derivation as make-bin-tarball.sh)
|
|
|
|
|
VER=$(sed -n 's/.*char\* Version = "\(.*\)".*/\1/p' "$SRC/implementations/main.cpp")
|
|
|
|
|
[ -n "$VER" ] || { echo "cannot read Version from implementations/main.cpp" >&2; exit 1; }
|
|
|
|
|
echo ">> packaging imsd $VER"
|
|
|
|
|
|
packaging, ci: build the apks with the Crafter.Build Flatpak
Crafter.Build's CI publishes a Flatpak and nothing else since
2026-10-02: the rolling `latest` release's
`crafter-build-linux-x86_64-musl-v2.tar.gz` that build-package.sh
fetched is gone (404 since 2026-10-03), so a push of a release would
fail at `fetch crafter-build` and publish nothing.
Install the Flatpak (`net.catcrafts.CrafterBuild//stable` from
flatpak.catcrafts.net) in the job container and run it as crafter-build.
bubblewrap inside the container needs a privileged runner, so the job
runs on the `flatpak` label. The sysroot stays Alpine edge and gains
llvm-runtimes, the package with the std module source of its own libc++
(libc++-dev ships none). make-sysroot.sh adds its list with --upgrade:
run over a sysroot from before this change (libc++ 22.1.8, no std module
source) a plain add installed llvm-runtimes 23.1.2 alone, and its
std.cppm did not compile against the 22.1.8 headers (`'text_encoding'
file not found`); with --upgrade libc++, libc++-dev and llvm-runtimes
came out at 23.1.2 and it compiled.
AGENTS.md §4.1, §4.3, §8.3 and §9.4 describe the route as it runs, and
the README's Building section carries the install lines. Three comments
in the files this touches said what is not so and are corrected:
package.yml had fp6-img install the package by a pinned version and
sha256 (it takes the newest in the registry), build-package.sh had
fp6-img's image build run `make check` on the aarch64 binaries (it
builds no imsd: no suite runs on them), and make-sysroot.sh's usage line
lacked the --march without which the cross build fails on an x86 host.
Tested: build-package.sh run end to end on this commit in a privileged
alpine:edge container (podman) on the workstation.
2026-10-04 01:23:23 +02:00
|
|
|
# --- crafter-build: the Flatpak, under the name the rest of this file uses.
|
|
|
|
|
# The build log names the build it ran with.
|
|
|
|
|
mkdir -p "$HOME/bin"
|
|
|
|
|
printf '#!/bin/sh\nexec flatpak run %s "$@"\n' "$CRAFTER_REF" > "$HOME/bin/crafter-build"
|
|
|
|
|
chmod +x "$HOME/bin/crafter-build"
|
|
|
|
|
PATH="$HOME/bin:$PATH"
|
|
|
|
|
flatpak info "$CRAFTER_REF" | sed -n 's/^ *\(Version\|Commit\|Date\): */crafter-build \1: /p'
|
|
|
|
|
crafter-build --version
|
2026-09-01 23:20:04 +02:00
|
|
|
|
2026-09-01 23:31:27 +02:00
|
|
|
# --- aarch64 Alpine sysroot (unprivileged: apk.static --usermode)
|
|
|
|
|
SYSROOT="$HOME/.cache/imsd/sysroot-aarch64-alpine"
|
|
|
|
|
retry "make sysroot" "$SRC/packaging/make-sysroot.sh" "$SYSROOT"
|
2026-09-01 23:20:04 +02:00
|
|
|
|
packaging, ci: build the apks with the Crafter.Build Flatpak
Crafter.Build's CI publishes a Flatpak and nothing else since
2026-10-02: the rolling `latest` release's
`crafter-build-linux-x86_64-musl-v2.tar.gz` that build-package.sh
fetched is gone (404 since 2026-10-03), so a push of a release would
fail at `fetch crafter-build` and publish nothing.
Install the Flatpak (`net.catcrafts.CrafterBuild//stable` from
flatpak.catcrafts.net) in the job container and run it as crafter-build.
bubblewrap inside the container needs a privileged runner, so the job
runs on the `flatpak` label. The sysroot stays Alpine edge and gains
llvm-runtimes, the package with the std module source of its own libc++
(libc++-dev ships none). make-sysroot.sh adds its list with --upgrade:
run over a sysroot from before this change (libc++ 22.1.8, no std module
source) a plain add installed llvm-runtimes 23.1.2 alone, and its
std.cppm did not compile against the 22.1.8 headers (`'text_encoding'
file not found`); with --upgrade libc++, libc++-dev and llvm-runtimes
came out at 23.1.2 and it compiled.
AGENTS.md §4.1, §4.3, §8.3 and §9.4 describe the route as it runs, and
the README's Building section carries the install lines. Three comments
in the files this touches said what is not so and are corrected:
package.yml had fp6-img install the package by a pinned version and
sha256 (it takes the newest in the registry), build-package.sh had
fp6-img's image build run `make check` on the aarch64 binaries (it
builds no imsd: no suite runs on them), and make-sysroot.sh's usage line
lacked the --march without which the cross build fails on an x86 host.
Tested: build-package.sh run end to end on this commit in a privileged
alpine:edge container (podman) on the workstation.
2026-10-04 01:23:23 +02:00
|
|
|
# --- cross-compile the products; run the suites natively, inside the Flatpak
|
|
|
|
|
# (same sources, host arch: no suite runs on the aarch64 binaries)
|
2026-09-01 23:31:27 +02:00
|
|
|
cd "$SRC"
|
2026-09-05 23:06:57 +02:00
|
|
|
# The phone is one SoC, 4x Cortex-A520 + 4x Cortex-A720, so build for it.
|
|
|
|
|
# armv8.6-a is the highest level whose mandatory set it exposes (8.7 would
|
|
|
|
|
# assume WFxT, 9.x SVE2 - neither is in its hwcaps); +fp16fml+aes+sha3+sm4 are
|
|
|
|
|
# the optional extensions it has. Same string as the fp6-img aports.
|
|
|
|
|
XTARGET="--target=aarch64-alpine-linux-musl --sysroot=$SYSROOT --march=armv8.6-a+fp16fml+aes+sha3+sm4 --mtune=cortex-a720"
|
2026-09-01 23:31:27 +02:00
|
|
|
crafter-build -- $XTARGET
|
|
|
|
|
crafter-build -- --product=media $XTARGET
|
|
|
|
|
crafter-build -- --product=dialerd $XTARGET
|
ofonod: GNOME Calls backend over org.ofono for Phosh and GNOME Mobile
imsd-ofonod presents imsd on the system bus as an oFono modem — Manager at
/, Modem + VoiceCallManager at /imsd, a VoiceCall object per call — which
is what GNOME Calls' bundled ofono provider drives; Calls, Phosh and GNOME
Shell run unmodified. org.gnome.Calls is not a seam a third party can
provide (Calls exports it, nothing feeds it), and Calls' provider plugins
link private headers, so org.ofono is the only D-Bus contract available.
Pure GDBus translation of net.catcrafts.IMS1, no core, like imsd-dialerd.
Packaged as the opt-in imsd-ofono subpackage: the daemon, its unit
(Conflicts=ofono.service), the system-bus policy and a gschema override
that points Calls at the ofono provider instead of mm (the ModemManager
origin would offer the modem's CS voice path, which carries no audio on
these phones). The policy grants root send_destination=org.ofono: under
dbus-broker a broadcast is checked against the sender's send policy for
every name the receiver owns, so without it imsd's call signals never
reach the daemon.
Verified on a Fairphone 6 with GNOME Calls 50.0: outgoing and incoming
calls with audio both ways, answered and hung up through
org.gnome.Calls.Call. Known Calls-side gap documented in the README: after
the VoiceCallManager interface is withdrawn and re-added, Calls keeps the
old origin's CallAdded handler and eventually crashes.
2026-09-20 16:07:46 +02:00
|
|
|
crafter-build -- --product=ofonod $XTARGET
|
qmi, imsd-pcscf: read the ims PDN's P-CSCF list from the modem's runtime settings
The network hands the P-CSCF addresses to the modem in the PDN's Protocol
Configuration Options; ModemManager's bearer code does not ask the modem
for them, qmicli (libqmi 1.39) prints none of them, and libqmi has no TLV
for the IPv6 list (0x2E), which is why PCSCF= was a required setting. A
second QMI WDS client reads them once it is bound to the bearer's mux
data port (the binding ModemManager gives its own clients): Bind Mux
Data Port, Set IP Family 6, Get Current Settings, over one AF_QIPCRTR
socket. Imsd:Qmi holds the bytes and the readers (0x22 the flag, 0x23
IPv4, 0x24 FQDN, 0x2E IPv6 in Qualcomm's layout: a count, then 16 bytes
each); imsd-pcscf is the socket, the service lookup and the sequence, and
prints the list, one address per line; nothing runs it yet. It sends
no Start Network and no Stop Network; the bearer stayed connected and the
registration stood after its runs (the fp6 journal's probe capture 04,
benches 38 and 39). The
build, the CI cross-compile, the tarball and the apk gain the product;
linux-headers is named in the sysroot for <linux/qrtr.h>.
Tested: crafter-build test, 8 passed; the aarch64 build of this commit's
helper on the dev phone (KPN) against the live ims bearer.
2026-10-11 16:07:28 +02:00
|
|
|
crafter-build -- --product=pcscf $XTARGET
|
2026-09-01 23:31:27 +02:00
|
|
|
crafter-build test
|
2026-09-01 23:20:04 +02:00
|
|
|
|
2026-09-01 23:31:27 +02:00
|
|
|
# --- bundle + package
|
|
|
|
|
./packaging/make-bin-tarball.sh "$VER"
|
2026-09-01 23:20:04 +02:00
|
|
|
|
2026-09-01 23:31:27 +02:00
|
|
|
PKG="$HOME/pkg"
|
|
|
|
|
rm -rf "$PKG"
|
|
|
|
|
mkdir -p "$PKG"
|
|
|
|
|
cp "$SRC/packaging/APKBUILD.binary" "$PKG/APKBUILD"
|
2026-09-02 16:08:21 +02:00
|
|
|
cp "$SRC/packaging/org.kde.modem.daemon.desktop" \
|
packaging: restart imsd and imsd-ofonod on upgrade
An upgrade left the old imsd and imsd-ofonod running until they were
next restarted, while a changed bus policy is live the moment apk writes
it: dbus-broker-launch reloads on its own. A policy that relies on a
check inside the daemons would face the old daemons in between.
Mark imsd.service and imsd-ofonod.service needs-restart in post-upgrade
scripts; the systemd trigger restarts them once the transaction is done
(enqueue-marked). A call in progress ends. The same scripts run as
post-install: `apk del` removes a package's files and leaves its daemon
running, so a later `apk add` of the package is this upgrade for that
daemon — and apk runs the post-install script, not post-upgrade, for a
package it adds. GNOME Calls 50.0 dials nothing after imsd-ofonod
restarts under it until it restarts too, so imsd-ofonod's ExecStartPost
restarts the Calls daemon of each user running one — not at the unit's
first start since boot, when a Calls that runs already is left alone.
A daemon older than 0.3.10 kept its bring-up throttle wait in memory
only, so a restart lost it. imsd's post-upgrade records that daemon's
invocation, and imsd-handover.sh, an ExecStartPre after ims-pdn-up.sh,
reads the invocation's journal and, while the fresh-SA throttle's wait
it finds there still runs (`spi-s=0`; the old daemon's other deferrals
are not handed over), writes what is left of it to the holds file when
this start's LOCAL is the address the wait was earned on, or when that
address cannot be read; when LOCAL is another address, only the verdict
that the old registration is gone.
Tested on the dev phone (KPN) in builds of this series; not every path
has run there.
2026-10-04 00:09:37 +02:00
|
|
|
"$SRC/packaging/80-imsd.preset" "$SRC"/packaging/*.post-upgrade "$SRC"/packaging/*.post-install "$PKG/"
|
2026-09-01 23:31:27 +02:00
|
|
|
mv "imsd-$VER.tar.gz" "$PKG/"
|
|
|
|
|
sed -i "s/^pkgver=.*/pkgver=$VER/" "$PKG/APKBUILD"
|
|
|
|
|
# a throwaway signing key: phones trust the registry-signed APKINDEX, not
|
|
|
|
|
# per-package keys (same situation as fp6-img's pmbootstrap-built packages).
|
|
|
|
|
# abuild >= 3.18 keeps keys under ~/.config/abuild and output under
|
|
|
|
|
# ~/.local/share/abuild (REPODEST default).
|
|
|
|
|
abuild-keygen -a -n >/dev/null 2>&1
|
|
|
|
|
sudo cp "$HOME"/.config/abuild/*.rsa.pub /etc/apk/keys/
|
|
|
|
|
# CHOST puts abuild in cross mode so arch="aarch64" packages on this x86_64
|
|
|
|
|
# host. -d skips dependency handling entirely: nothing compiles under abuild
|
|
|
|
|
# (with -r, cross mode would try to install a nonexistent build-base-aarch64
|
|
|
|
|
# plus the runtime depends); !tracedeps in the APKBUILD keeps abuild from
|
|
|
|
|
# resolving the aarch64 ELF NEEDED entries against this x86_64 host.
|
|
|
|
|
cd "$PKG"
|
|
|
|
|
abuild checksum
|
|
|
|
|
CHOST=aarch64 abuild -d
|
2026-09-01 23:20:04 +02:00
|
|
|
|
|
|
|
|
echo "=== built packages ==="
|
2026-09-01 23:31:27 +02:00
|
|
|
ls -la "$HOME"/.local/share/abuild/*/aarch64/imsd*.apk
|