Kernel (source-only, ABI-preserving, patch 0007):
- pm8916_bms_vm.c: bound VADC raw samples to 8000..16000 (~2.34-4.69 V)
with a 3.7 V nominal fallback in raw_to_uv(); reject out-of-window FIFO
samples in the IRQ handler and probe pre-read. Fixes the 19.2 V /
"Over voltage" / 100% misreport from an uninitialised 0xffff sample after
a hard reset (also covers the OCV register reads on probe/resume).
- wcn36xx: listen_interval becomes a module parameter (1-10, default 5,
was hardcoded 3) so the beacon skip is configurable at module load.
Runtime power policy (/etc/bananarchy-power-policy.conf):
- WIFI_LISTEN_INTERVAL drives /etc/modprobe.d/10-bananarchy-power.conf.
- MODEM_DRX_MODE (0 or 6-9) applies Qualcomm AT$QCDRX at boot and on wake.
Standard AT+CPSMS / AT+CEDRXS are unsupported on this modem firmware.
- DSDS_SECONDARY_MODE=eco parks the secondary GW provisioning session after
DSDS_PARK_DELAY seconds of a dark panel and restores it on wake, capturing
the actual slot and AID. Uses QMI provisioning sessions, not SIM power-off
(which clears PIN verification). Default active keeps both SIMs reachable.
- New bananarchy-power-policy.sh, OpenRC default-runlevel service, doas rule,
and hooks in sxmo_wm.sh display off/on.
Live-verified on nokia-argon: DRX 6 readback, eco park/unpark round-trip,
Wi-Fi param 5, status output, module vermagic match, both SIMs registered.
Rebuilt image with --mkinitfs: initramfs and rootfs carry the new modules
(SHA-256 match), boot.img keeps the byte-identical known-good zImage + DTB.
Docs updated (BATTERY-OPTIMIZATION-ANALYSIS.md section 15, CHANGELOG,
MANUAL, README, AGENTS).
- Config -> Screen blank submenu (Off / 30 s / 1 / 5 / 10 / 30 min) backed by
~/.config/sxmo/idle_blank_timeout and the new bananarchy-idle-timeout.sh
get|label|set. Default changed from 60 s to 300 s. dwm reads the file live
and reloads it on SIGUSR1, so a menu change takes effect without a restart;
sxmo.noidle and SXMO_UNLOCK_IDLE_TIME still override/disable it.
- Power -> Lock now uses @plugin:locker:screenoff (like Lock (Screen off)), and
lock_phone_screenoff() resets dwm's idle state, so closing the slider/lid or
locking blanks the panel immediately instead of waiting for the timeout.
- New bananarchy-screen-wake.sh restores the panel via sxmo_wm.sh display on,
records /tmp/bananarchy_last_wake and signals dwm (SIGUSR1) to reset
idle_blanked / last_input_ms. Called from sxmo_hook_ring.sh (incoming call)
and sxmo_hook_notification.sh (SMS / notifications). dwm also self-heals if
an external hook turns the panel on without a signal.
Verified live on the connected phone (after deploying the rebuilt dwm/dmenu
and restarting dwm with a rollback backup): idle_locker job is gone, default
reads 300 / 5m, setting 10 s blanks the panel (br 14->0, bl 0->4, DPMS On->Off)
after ~14 s of no input, and bananarchy-screen-wake.sh restores it immediately.
Lock state and 5-minute default were restored afterwards. All scripts pass sh -n.
Rebuilt dwm/dmenu and images/bananarchy-nokia-argon.img with --mkinitfs;
boot.img still contains the known-good zImage + DTB byte-for-byte.
check-rebuild.sh passes and artifact drift is 0.
Docs: MANUAL.md, CHANGELOG.md, AGENTS.md, BATTERY-OPTIMIZATION-ANALYSIS.md (13).
Two issues reported after the recovery image booted:
1. Pressing the power key turned the screen on and immediately back off.
Root cause: U1 used sxmo_idle.sh + xprintidle, but dwm consumes keypad
events at the evdev level before X sees them, so the X idle counter never
reliably reset and the blank/resume commands raced. Replaced it with a
dwm-native idle timer (src/sxmo-dwm/dwm.c): last_input_ms is updated from
evdev and X key events, poll() is armed with the SXMO_UNLOCK_IDLE_TIME
deadline (default 60 s), bananarchy-idle-blank.sh off fires once, and
wake_phone() clears idle_blanked and resets the timer on the next real key.
sxmo.noidle still disables it; idle_locker was removed from
sxmo_hook_unlock.sh. Added a defensive wake-grace guard to
bananarchy-idle-blank.sh and a /tmp/bananarchy_last_wake timestamp in
sxmo_wm.sh display on so an already-flashed device is fixed too.
2. A PIN on one SIM prevented the other SIM from registering. provision_slot()
tried to bind the preferred slot to primary-gw-provisioning even when its
app was pin1/puk1 or PIN1 state enabled-not-verified, so no session came up
and neither subscription registered. It now detects a locked preferred slot
and falls back to the other ready slot for the primary GW; verify-pin/xmodem
re-run boot after unlock and provision both slots normally.
Verified on the connected phone: all three deployed scripts pass sh -n, all
5 embedded Python heredocs parse, SIM status still reports both slots
registered, and off -> on -> immediate off leaves the screen on (grace guard).
Rebuilt dwm/plugins and images/bananarchy-nokia-argon.img with --mkinitfs;
boot.img still contains the known-good zImage + DTB byte-for-byte.
check-rebuild.sh passes and artifact drift is 0.
Docs: CHANGELOG.md, MANUAL.md, BATTERY-OPTIMIZATION-ANALYSIS.md (section 12).
The previous battery pass rebuilt the kernel image from a retuned config and
produced an image stuck on the lk2nd logo. Two incompatibilities with the
linux-postmarketos-qcom-msm8916 module tree (which this repo does not rebuild)
were identified:
1. Vermagic: CONFIG_PREEMPT_VOLUNTARY removes CONFIG_PREEMPT_BUILD, so the
rebuilt kernel reported "6.12.1-msm8916 SMP mod_unload ARMv7 p2v8" while
every package module reports "6.12.1-msm8916 SMP preempt mod_unload ARMv7
p2v8". modprobe refuses all of them, including panel-mipi-dbi, so the
display never initialises.
2. Struct layout: CONFIG_SUSPEND selects CONFIG_PM_SLEEP, which adds fields to
struct dev_pm_info. Modules built without it use wrong dev->power offsets,
so matching vermagic alone is not enough.
Restored the known-good kernel config, the serial-console cmdline and the DTB
wakeup-source additions. The kernel image is still cross-compiled by
build-kernel-audio.sh but from the original config, so vermagic and struct
layouts match every module in the rootfs. Reverted the config-level items K1,
K6, K7, K8, K13 and K14; implementing them requires vendoring and rebuilding
the entire pmaports kernel module tree.
Kept: K2 clock-latency-ns, K3/K4/K5 via patch 0006 (rebuilt with the original
config), K10 IPv6 sysctl, and all U1-U14 userspace changes.
Rebuilt the kernel image/modules/DTBs and images/bananarchy-nokia-argon.img
with --mkinitfs. Verified: all modules (package + rebuilt) now report identical
vermagic, boot.img contains the new zImage + DTB byte-for-byte, the console
cmdline is restored, check-rebuild.sh passes and artifact drift is 0.
Docs: CHANGELOG.md (recovery section), MANUAL.md, README.md, AGENTS.md,
BATTERY-OPTIMIZATION-ANALYSIS.md (section 11).
Re-analyzed the running nokia-argon (a1105, 43 h uptime, DSDS + Wi-Fi on) and
implemented the corrected kernel/userspace optimization list. No sleep state
existed at all (/sys/power/state was 0 bytes) and cpuinfo_transition_latency
was UINT_MAX, while the CPU cores were already ~98% power-collapsed.
Kernel (K1-K14)
- Enable CONFIG_SUSPEND / SUSPEND_FREEZER / PM_WAKELOCKS / PM_AUTOSLEEP and
build the zImage from the tuned config; ship it as overlay/rootfs/boot/vmlinuz
plus config and System.map. Add wakeup-source to the WCNSS pronto remoteproc.
- Add clock-latency-ns to cpu-opp-table in all 5 device trees (fixes
CPUFREQ_ETERNAL at its source instead of a userspace rate_limit_us override).
- New patch 0006: wcn36xx keep-alive 30s->120s, listen_interval=3, VM-BMS
sample interval 10s->30s, power_supply_changed() only on real capacity
changes, GPU devfreq polling_ms 50->100.
- Retune the config for idle (HZ=100, PREEMPT_VOLUNTARY, TEO cpuidle governor,
no ftrace/perf/kprobes/BPF-JIT-always-on/debug options, no serial console,
DRM_FBDEV_OVERALLOC=0, lz4 zram, ENERGY_MODEL) and drop earlycon /
console=ttyMSM0 from every kernel cmdline.
- net.ipv6.conf.default.disable_ipv6=1 to stop ND/MLD multicast on new
interfaces; keep NETFILTER/IPV6/CGROUPS and FRAMEBUFFER_CONSOLE for
VPN/tethering, elogind and plymouth.
Userspace (U1-U14)
- Idle blanking without the passcode locker (bananarchy-idle-blank.sh +
idle_locker resume hook, SXMO_UNLOCK_IDLE_TIME=60, sxmo.noidle opts out).
- Guarded deep standby (bananarchy-suspend.sh / -deep-standby.sh /
sxmo_autosuspend.sh / sxmo_suspend.sh), AllowSuspend=yes, doas rule, no
infinite wakelock, no sxmo.nosuspend. Shipped disabled via
/etc/bananarchy-no-deep-standby until the new kernel is boot-tested; freeze
is preferred, mem is opt-in.
- statusbar_periodics 60s->300s, no mmcli/nmcli/rfkill polls, xsetroot only on
change; battery udev rule filtered and no 2 s recheck fork.
- On-demand QMI DPM port, longer DSDS/modemmonitor backoffs, chrony long polls,
NM wifi.scan-interval=600, bluetooth AutoEnable=false, tmpfs on /tmp,
zero-log superd, GPU devfreq governor on screen-off, longer SIP/Tox timers.
- Fix the cosmetic wpa_supplicant yesno typo; withdraw the disproven duplicate
wpa_supplicant and soundmonitor 5 s loop items.
Rebuilt images/bananarchy-nokia-argon.img with --mkinitfs: boot.img contains
the new zImage + DTB byte-for-byte and no serial-console cmdline. Deployed the
userspace overlay to the connected phone and verified shell/Python syntax, the
idle-blank round trip, the statusbar hook and the deep-standby guard.
check-rebuild.sh and sync-prebuilt-overlay.sh --check both pass.
Docs: BATTERY-OPTIMIZATION-ANALYSIS.md (measurement-corrected, with
implementation status), CHANGELOG.md, MANUAL.md, README.md, AGENTS.md.
- Cross-compile bantam-cpp master (c168955, "Scope /clear to the current
project's session and drop cross-implementation references") for armv7 and
refresh prebuilt/, overlay/rootfs/, and the target rootfs; the update brings
validated write edit modes, verbatim content writes, safer read/bash tool
handling, and a project-scoped /clear.
- Rebuild images/bananarchy-nokia-argon.img (release a1105) and verify both
/usr/bin/bantam and /usr/local/bin/bantam inside the ext4 image by hash.
- Document the update in CHANGELOG.md.
Enable the X11 DPMS extension and force the DRM connector off/on on blank
and wake, including the lid-close and lockscreen paths that write backlight
sysfs directly (driven by a backlight change udev rule and a small sync
helper). DPMS timeouts stay at zero so unlocked auto-blanking remains off.
Re-apply schedutil rate_limit_us=40000 after every powersave to schedutil
governor switch, which recreates the kobject with the 6.44 s default, and
drop the writes to nonexistent up_rate_limit_us / down_rate_limit_us files.
Remove the dead iw power-save call: NetworkManager wifi.powersave=3 and the
wcn36xx WIPHY_FLAG_PS_ON_BY_DEFAULT patch already report "Power save: on".
The expanded xsms conversation view handed the whole message body to
pango_xft_render_layout() as one multiline layout; on the target Pango/Xft
stack that call only paints the first line, so long concatenated/UCS-2
messages (e.g. the Ukrainian 'Мелорінг дарує хіти!' example) stopped right
before the first non-ASCII character. Verified on the connected phone with an
instrumented sms.so (530-byte body, 13 measured lines, one painted line) and
a standalone ARM reproducer; the QMI WMS reassembly and sms.txt parser are
correct.
- Draw message bodies and long drafts line by line via a shared
renderLayoutLines() helper with an Xft clip, so nothing overflows the
bubble or softkey bar; use the same layout width for measuring and drawing.
- Make the selected message scrollable with Up/Down (one line per press plus
a right-edge scrollbar), stepping to the previous/next message only at the
top/bottom of an overflowing message.
- Replace the byte-based compose counter with smsTextMetrics(), which decodes
UTF-8, detects the GSM 7-bit alphabet/extension table and reports GSM-7
septets (160/153) or UCS-2 UTF-16 units (70/67) with the right part count.
- Strip [SIM n] tags from QMI/local SMS log headers and stop writing them in
the offline-send fallback; log units instead of bytes.
- Add a check-rebuild.sh guard against reintroducing the bulk layout render.
- Rebuild prebuilt/overlay sms.so and engmenu.so, sync docs, and regenerate
images/bananarchy-nokia-argon.img.
- Cross-compile bantam-cpp master (0cd1a67, "Send stable x-opencode-session
header based on project_id") for armv7 and refresh prebuilt/, overlay/rootfs/,
and the target rootfs; the new binary carries the x-opencode-session header.
- Rebuild images/bananarchy-nokia-argon.img with the updated agent (1.84 GiB,
down from 2.01 GiB) and verify the binary inside the ext4 image by hash.
- Fix a prune regression seen in the rebuild log: apk install_if re-adds
imv-wayland, gstreamer-ptp-helper and libheif-rav1e, so apk del alone leaves
the Wayland viewer and two Rust helpers installed. Pin them with negative
!pkg world constraints and run apk fix after each purge.
- Verify the constraints in check-rebuild.sh and document the fix.
A fresh clone can now bootstrap a complete armv7 rootfs, apply the Bananarchy overlay, regenerate boot artifacts, and produce a flashable image without local build artifacts.
- Add a shared package list and Docker-based rootfs bootstrap, wired into rebuild-image.sh and chroot-shell.sh.
- Add offline rebuild preflight checks and prebuilt-to-overlay artifact synchronization.
- Vendor the patched EDL client and provision host flashing dependencies.
- Remove the hardcoded credential from the power menu helper.
- Refresh documentation and changelog for the autonomous workflow.
- Enable GPIO 38 active-low card detect (cd-gpios) with bias-pull-up on
sdhci@7864000 across all MSM8905/MSM8909 device trees and DTBs
- Add sxmo_sdcard.sh and 88-bananarchy-sdcard.rules udev rules for
automatic mounting at /media/sdcard on insertion and cleanup on
removal
- Integrate SD card mount, unmount/eject, and navigation into the GUI
File Manager (files.so) and built-in dmenu SD Card menu (@menu:sdcard)