fp6-no-suspend -> fp6-device-tweaks: + the three IMU-critical /etc files

Full-system audit on the flashed phone found the IMU dead: the journal's
documented reinstall-loss trio (inv-icm42600-spi modules-load - fallback-only
SPI node never coldplugs; the accel poll udev rule for auto-rotate; the
iio-sensor-proxy libssc-crash restart drop-in). All device-critical, none
personal - now packaged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jorijn van der Graaf 2026-08-09 00:03:09 +02:00
commit ff69f4d913
6 changed files with 69 additions and 23 deletions

View file

@ -0,0 +1,15 @@
# FP6 / inv_icm42600: force iio-sensor-proxy onto its POLL accel backend.
#
# inv_icm42600 registers no IIO trigger (software kfifo buffer pushed from the
# INT1 handler), but it does expose scan_elements/, so 80-iio-sensor-proxy.rules
# tags the accel with BOTH "iio-poll-accel" and "iio-buffer-accel".
# iio-sensor-proxy 3.9 tries iio-buffer-accel first, fails the trigger lookup
# ("Could not find trigger name associated with ...") and does NOT fall back to
# polling -- it registers the device anyway, so HasAccelerometer is true while
# sensor_device stays NULL. Every ClaimAccelerometer then hits
# "driver_set_polling: assertion sensor_device failed", AccelerometerOrientation
# is stuck at "undefined" and Plasma auto-rotate is dead.
#
# Glob the name: the DTS carries an icm42630/icm42631 compatible pair, so the
# IIO name follows whichever the fallback binds (see journal/imu/status.md).
SUBSYSTEM=="iio", ATTR{name}=="icm426*-accel", ENV{IIO_SENSOR_PROXY_TYPE}="iio-poll-accel"

View file

@ -0,0 +1,44 @@
# Device-critical FP6 configuration that no upstream package ships yet —
# every piece here was once a hand-applied /etc file on the dev phone that a
# reinstall silently lost:
# - masked sleep targets: wifi and BT share the WCN combo chip; idle-suspend
# (and BT-off) resets the shared firmware and kills wifi for ~40 minutes
# - inv-icm42600-spi module-load: the IMU sits on bitbanged SPI with a
# fallback-only DT node, so udev coldplug never autoloads it
# - accel poll udev rule: inv_icm42600 exposes scan_elements without a
# trigger; iio-sensor-proxy must use its poll backend or auto-rotate is dead
# - iio-sensor-proxy restart drop-in: revives it after the known boot-time
# libssc crash on unconfigured SSC
maintainer="Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>"
pkgname=fp6-device-tweaks
pkgver=2
pkgrel=0
pkgdesc="Fairphone 6 device-critical system configuration"
url="https://forgejo.catcrafts.net/Catcrafts/fp6-img"
arch="noarch"
license="MIT"
options="!check"
source="
inv-icm42600.conf
81-fp6-accel-poll.rules
iio-sensor-proxy-restart.conf
"
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
install -Dm644 "$srcdir"/inv-icm42600.conf \
"$pkgdir"/etc/modules-load.d/inv-icm42600.conf
install -Dm644 "$srcdir"/81-fp6-accel-poll.rules \
"$pkgdir"/etc/udev/rules.d/81-fp6-accel-poll.rules
install -Dm644 "$srcdir"/iio-sensor-proxy-restart.conf \
"$pkgdir"/etc/systemd/system/iio-sensor-proxy.service.d/restart.conf
}
sha512sums="
5e60fef47cb09cec7cab73464183dfd9e9cb32cebd1d20a67922c10c5a747eca8d106b66737d06af5c5c162a6baf37ab62a82709cc20911044face100d482919 inv-icm42600.conf
cc13f6abc4538fef976c59893992dd2c193cd0eac5da37a9fb01ba421b3ba8ff303aa438ec2fe4d10f50165f90be211d4b2c39dc6ef58d0d320fba8182ccf287 81-fp6-accel-poll.rules
1800ad5c11b4e38c10b0c72b2392a6dc978a4e37bcd964182adb90d7d9aa7afc74acf102e2051dbf864021c05821f683af8943e2729e1eaa195856a0bd635e09 iio-sensor-proxy-restart.conf
"

View file

@ -0,0 +1,7 @@
# Revive after the known boot-time libssc crash (unconfigured SSC);
# recreated 2026-07-28 - the 2026-07-20 drop-in had gone missing.
[Unit]
StartLimitIntervalSec=0
[Service]
Restart=on-failure
RestartSec=5

View file

@ -0,0 +1 @@
inv-icm42600-spi

View file

@ -1,21 +0,0 @@
# 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 <jorijnvdgraaf@catcrafts.net>"
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=""

View file

@ -100,7 +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/device/fp6-device-tweaks "$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
@ -151,7 +151,7 @@ aports = $WORK/pmaports
device = fairphone-fp6
ui = plasma-mobile
systemd = always
extra_packages = soc-fairphone-fp6-audio,callaudioshim,imsd,fp6-no-suspend
extra_packages = soc-fairphone-fp6-audio,callaudioshim,imsd,fp6-device-tweaks
EOF
pmbootstrap checksum linux-postmarketos-qcom-milos