While the modem has worked for quite a while on mainline, for some
reason some dependencies were never added to the device package.
And add the firmware for the audio amplifier on Fairphone 3 since it's
also supposed to work now.
And install qbootctl (and enable it by default) to mark the current slot
as successful to not get stuck in the bootloader after a couple of
reboots.
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7010>
Flashing is enabled because of lplk and no longer requiring an uniLoader
dependency.
SD Card was incorrectly set as unavailable before, this device has an SD
card slot, fix the property.
This device now supports display via simpledrmfb, so enable
deviceinfo_drm. Device can start Phosh, albeit with some graphical
glitches, and obviously no GPU (yet...).
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7018>
Apparently the eval trick doesn't work for passing vars if the var to
set is the same as the var for the value, in this case the caller of
this function was using `added_paths` and `removed_paths`. Shell scripts
suck.
This was missed in the tests because the unit tests call
trigger_unit_presets directly.
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7025>
Apparently this fails on other archs when cross compiling, not just
riscv64. I hit it locally when building x86_64 on aarch64. bpo is
hitting it when trying to build aarch64 on x86_64. This is kinda of a
big hammer, but I think we'll be able to drop this cups fork when abuild
systemd split func support is upstreamed, and bpo is currently blocked
trying to build changes to support our effort to upstream that abuild
patch.
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7023>
This trigger has a lot going on, so let's make sure it always passes
shellcheck. It's not picked up by the normal search for triggers in this
script because the actual logic for the trigger is broken out from the
.trigger file.
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6892
This reworks the preset, reload/restart, and cleanup handling and moves
it from a (proposed [1]) abuild patch that would generate install
scripts for every -systemd package to a series of commit hooks and
a trigger that would exist in this package. This was made
possible by using `treescan`, which quickly[2] recursively scans
/usr/lib/systemd and allows the commit hook and trigger to diff units
before and after an install or uninstall transaction.
I chose to put the trigger and commit hook in pmos-base-systemd instead
of the systemd package because:
1) It's annoying to have to rebuild systemd just to update the logic in
this script. Rebuilding this package is MUCH faster (nothing to
compile)
2) IF the systemd package moves elsewhere (i.e. out of pmaports), it's
unclear if this preset stuff would follow it, and it's safer for us to
keep it separate so know it's always being included in pmOS+systemd
installs. It can always be moved later if we decide to.
More info on how the three situations are handled by this patch:
Presets: Pre-commit hook captures current unit file list (using
treescan) before changes, then the trigger on /usr/lib/systemd/system
captures (using treescan) the state after changes and diffs them. It
picks out only unit files that were added, and runs systemctl preset to
apply any preset config that might exist for them.
Reload/restart: This relies on manual post-upgrade scripts in packages
that need it. post-upgrade scripts should mark units with systemctl
set-property ... Markers=+needs-reload/restart. Actual reload/restart
handled by the existing systemd.trigger that queries these markers...
This is going to be a bit annoying for package maintainers[3], but I
don't think many packages will *need* this. As of today, there are 0
packages explicitly requesting reload/restart on upgrade. This also
means there will be no automatic detection of whether a unit should be
reloaded/restarted. AFAIK Fedora doesn't support this, packages have to
explicitly request a reload or restart.
Cleanup: The pre-commit hook uses treescan to capture systemd unit
directory state before transactions and the trigger identifies removed
units (using treescan + diff). It then finds broken symlinks in
/etc/systemd/ that point to any newly removed unit files from the
transaction, and removes only them.
Benefits:
- Simple abuild patch for -systemd split func
- Uses existing APK mechanisms (commit hooks, triggers). Hooks can see
before/after transaction state for cleanup.
- Logic updates don't require rebuilding all packages.
Tradeoffs:
- Requires additional per-package complexity to support
reload/restart functionality.
- Moves unit discovery/parsing for preset and cleanup from build-time to
runtime (every device does this work vs. once at build)
- Package behavior varies based on installed trigger/hook
versions rather than being deterministic per package version.
- There's a (tiny) risk of some operations being race-y, e.g. if the
user is actively enabling/disabling/adding unit files between apk
running the pre-commit hook and the trigger firing... It seems
unlikely this will cause issues, but 🤷♂️
1. https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/394
2. I used hyperfine to measure performance of treescan on my laptop,
with lots of units installed, and it was ~20ms without disk caching
3. A post-upgrade that would mark a unit for reload might look like
this:
```
if [ -d "/run/systemd/system" ]; then
echo "Marking sshd.service for reload..."
systemctl set-property sshd.service Markers=+needs-reload
fi
```
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6892