Fix unbootable image: restore kernel/module ABI compatibility
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).
This commit is contained in:
1 parent
ad3461babf
commit
0dbb37fba3
127 files changed
+190712
-136883
No files matched your search
@@ -377,3 +377,31 @@ few places where the regression checks mandated by the analysis changed the impl
|
||||
the kernel patch 0006 require a reflash + reboot. The userspace changes were deployed and
|
||||
syntax/runtime-checked on the connected phone (charging over USB, so no discharge-current
|
||||
measurement was possible). Deep standby stays opt-in until that boot test is done.
|
||||
|
||||
---
|
||||
|
||||
## 11. Recovery: why the kernel-config items cannot ship as-is
|
||||
|
||||
The first implementation pass rebuilt the kernel image from a retuned config and produced an
|
||||
image that stays on the lk2nd logo. Two ABI incompatibilities with the
|
||||
`linux-postmarketos-qcom-msm8916` module tree (which this repo does **not** rebuild) were found:
|
||||
|
||||
1. **Vermagic** — `CONFIG_PREEMPT_VOLUNTARY` removes `CONFIG_PREEMPT_BUILD`, so the rebuilt
|
||||
kernel reports `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` and `msm`, so the display never initialises. Verified on-device before the
|
||||
reflash and on the built artifacts with `modinfo`.
|
||||
2. **Struct layout** — `CONFIG_SUSPEND=y` selects `CONFIG_PM_SLEEP`, which adds
|
||||
`entry`, `completion`, `wakeup`, `wakeup_path`, `syscore`, `no_pm_callbacks`,
|
||||
`async_in_progress`, `must_resume`, `may_skip_resume` to `struct dev_pm_info`. Modules built
|
||||
without it use wrong `dev->power.*` offsets; matching vermagic would not be sufficient.
|
||||
|
||||
**Consequence:** K1 (`CONFIG_SUSPEND` + wakelocks), K6 (preempt/HZ/hrtick), K7 (debug/tracing
|
||||
config), K8 (no serial console), K13 (`ZRAM_DEF_COMP`) and K14 (`ENERGY_MODEL`) are reverted to
|
||||
the known-good config. Implementing them properly requires either (a) vendoring and rebuilding
|
||||
the *entire* pmaports kernel module tree so every module matches the new kernel, or (b) shipping
|
||||
a kernel with the original ABI and accepting that those config-level savings are unavailable.
|
||||
|
||||
Kept because they do not depend on the kernel config: K2 (`clock-latency-ns` in the DTB),
|
||||
K3/K4/K5 (patch 0006, rebuilt with the original config), K10 (IPv6 sysctl), and all U1-U14
|
||||
userspace changes. Deep standby (U2) stays disabled and inert.
|
||||
Reference in new issue
Block a user