Implement 0012 72h standby battery optimizations and initramfs depmod hook

- Add patches/kernel/0012-msm8909-standby-wifi-wcd-panel-ldo-bms.patch, rebuild affected kernel/module artifacts and all six device DTS/DTB files (msm8916-wcd-analog s2/bias gating, wcn36xx offload_sync_work and healthy-RSSI screen_off_offload scan short-circuit, pm8916_bms_vm screen_off FORCE_S3 OCV mode, panel-mipi-dbi dc/reset low on blank, spi-qup runtime PM sleep pinctrl, PM8909 l1/l4 LDO seeding, and sdhci-msm vmmc/vqmmc set_load with regulator-allow-set-load on l8/l12), and switch msm8905-cam from direct APSS SPMI LDO6/LDO17 writes to RPM regulator consumer voting.

- Update standby power policy and compiled C daemons (WIFI_LISTEN_INTERVAL=8, WIFI_STANDBY_RAT=gsm with CS verification and fallback, 10-bananarchy-dpm.sh wifi-up/unpark-rat dispatch, 25 s boot QRTR wait and QMI DMS online recovery, pm8916_bms_vm screen_off sync, bananarchy-run-aligned dark-screen skip, bananarchy-dsds --sig-hysteresis, bananarchy-cover-idle wake_blank_timeout = 8, and scripts/test-standby-power-policy.py).

- Add overlay/rootfs/etc/boot-deploy/hooks/10-initramfs-depmod.sh to run depmod -b per staged initramfs cpio archive and eliminate Stage 2 udevd missing-module boot console errors, enforce .ko.zst-only module installs in apply-bananarchy-overlay.sh, stage Alpine 3.24 /usr/lib/{libz,libcrypto}.so* in rebuild-image.sh chroot with failure cleanup, and add initramfs cpio guards plus verified image hashes in scripts/check-rebuild.sh.

- Document all changes under Unreleased in CHANGELOG.md and synchronize AGENTS.md, MANUAL.md, and BATTERY-OPTIMIZATION-ANALYSIS.md.
This commit is contained in:
Luxferre committed 2026-11-15 14:46:50 +02:00
1 parent 9700949b28
commit fc5c4282f5
67 files changed
+67482 -65598

No files matched your search

+166
View File
@@ -0,0 +1,166 @@
#!/bin/sh
set -eu
# Rebuild modules.dep* and modules.alias* inside each initramfs cpio archive
# so udevd does not try to load modules absent from the initramfs image.
resolve_depmod() {
for cand in /tmp/hostbin/depmod /sbin/depmod /usr/sbin/depmod; do
if [ -x "$cand" ]; then
printf '%s\n' "$cand"
return 0
fi
done
if command -v depmod >/dev/null 2>&1; then
command -v depmod
return 0
fi
return 1
}
DEPMOD_BIN=$(resolve_depmod || true)
if [ -z "$DEPMOD_BIN" ]; then
echo "10-initramfs-depmod: depmod not found" >&2
exit 1
fi
collect_targets() {
if [ "$#" -gt 0 ]; then
for arg in "$@"; do
if [ -f "$arg" ]; then
printf '%s\n' "$arg"
fi
done
return 0
fi
if [ -n "${work_dir:-}" ] && [ -d "${work_dir:-}" ]; then
name="${initfs_filename:-initramfs}"
if [ -f "$work_dir/$name" ]; then
printf '%s\n' "$work_dir/$name"
fi
if [ -f "$work_dir/${name}-extra" ]; then
printf '%s\n' "$work_dir/${name}-extra"
fi
return 0
fi
for search_root in "${TMPDIR:-/tmp}" /tmp; do
[ -d "$search_root" ] || continue
for dir in "$search_root"/*; do
[ -d "$dir" ] && [ ! -L "$dir" ] || continue
case "$dir" in
*/hostbin|*/initramfs-depmod.*)
continue
;;
esac
[ -f "$dir/initramfs" ] || continue
has_vmlinuz=0
for kern in "$dir"/vmlinuz*; do
if [ -f "$kern" ]; then
has_vmlinuz=1
break
fi
done
[ "$has_vmlinuz" -eq 1 ] || continue
printf '%s\n' "$dir/initramfs"
if [ -f "$dir/initramfs-extra" ]; then
printf '%s\n' "$dir/initramfs-extra"
fi
done
[ "$search_root" = "/tmp" ] && break
done
}
verify_modules_dep() {
moddir="$1"
depfile="$moddir/modules.dep"
if [ ! -s "$depfile" ]; then
echo "10-initramfs-depmod: empty modules.dep in $moddir" >&2
return 1
fi
while IFS= read -r line; do
[ -n "$line" ] || continue
for tok in $line; do
tok="${tok%:}"
[ -n "$tok" ] || continue
if [ ! -e "$moddir/$tok" ]; then
echo "10-initramfs-depmod: missing module in initramfs: $tok" >&2
return 1
fi
done
done < "$depfile"
}
process_archive() {
case "$1" in
/*)
archive="$1"
;;
*)
archive="$(pwd)/$1"
;;
esac
[ -f "$archive" ] || return 0
work=$(mktemp -d /tmp/initramfs-depmod.XXXXXX)
stage="$work/stage"
out="$work/initramfs.new"
mkdir -p "$stage"
if ! (cd "$stage" && gzip -dc "$archive" | cpio -idm 2>/dev/null); then
rm -rf "$work"
echo "10-initramfs-depmod: failed to unpack $archive" >&2
return 1
fi
repacked=0
for base in "$stage/usr/lib/modules" "$stage/lib/modules"; do
[ -d "$base" ] && [ ! -L "$base" ] || continue
for moddir in "$base"/*; do
[ -d "$moddir/kernel" ] || continue
kver="${moddir##*/}"
if ! "$DEPMOD_BIN" -b "$stage" "$kver"; then
rm -rf "$work"
echo "10-initramfs-depmod: depmod failed for $kver in $archive" >&2
return 1
fi
if ! verify_modules_dep "$moddir"; then
rm -rf "$work"
return 1
fi
repacked=1
done
done
if [ "$repacked" -eq 1 ]; then
if ! (
cd "$stage" &&
find . | sed -e '/^\.$/d' -e 's|^\./||' | LC_ALL=C sort |
cpio -o -H newc 2>/dev/null | gzip -n -6 > "$out"
); then
rm -rf "$work"
echo "10-initramfs-depmod: failed to repack $archive" >&2
return 1
fi
chmod 0644 "$out"
mv -f "$out" "$archive"
fi
rm -rf "$work"
}
targets=$(collect_targets "$@")
if [ -z "$targets" ]; then
if [ "$#" -gt 0 ]; then
echo "10-initramfs-depmod: no readable target archive in arguments" >&2
exit 1
fi
echo "10-initramfs-depmod: no initramfs staging archive found" >&2
exit 1
fi
printf '%s\n' "$targets" | while IFS= read -r target; do
[ -n "$target" ] || continue
process_archive "$target"
done