Make device initramfs module lists reproducible from a clean clone

A clean clone of the repo bootstraps a rootfs without any device-* package
(none is in scripts/rootfs-packages.txt). mkinitfs therefore omitted the
per-device module list and produced an initramfs missing 7 modules:
panel-mipi-dbi, drm_mipi_dbi, drm_dma_helper, matrix_keypad,
matrix-keymap, pm8916_lbc and the new pm8916_bms_vm. The shipped image was
only correct because an existing rootfs happened to have device-nokia-argon
installed.

- scripts/apply-bananarchy-overlay.sh now installs the tracked
  devices/<device>/modules-initfs as
  /usr/share/mkinitfs/modules/00-device-<device>.modules plus its
  initramfs.load mapping, and removes stale lists from other devices.
  Verified for all five targets (argon/beatles/tough keep 5 modules,
  sparkler/leo keep 3).
- scripts/check-rebuild.sh guards the per-device lists and the overlay step.
- AGENTS.md / CHANGELOG.md document the package-list decision.

Verification from a fresh clone of origin/master at bc1c19a:
- scripts/check-rebuild.sh passes.
- scripts/build-kernel-audio.sh downloads the gitignored kernel tarball,
  applies all 7 patches (including 0007) and reproduces all 72 committed
  kernel artifacts byte-for-byte; the only zImage difference is the embedded
  build timestamp (42 bytes, verified by decompressing both vmlinux images).
- rebuild-image.sh nokia-argon --mkinitfs now produces an initramfs with the
  identical 27-module set, the fixed pm8916_bms_vm.ko.zst SHA-256 match and
  initramfs.load present.
- Main image rebuilt and verified: kernel + DTB byte-identical, 27 modules,
  BMS SHA-256 match.
This commit is contained in:
Luxferre committed 2026-11-07 21:21:15 +02:00
1 parent bc1c19a483
commit 38d54f10ff
4 files changed
+52 -1

No files matched your search

+11
View File
@@ -168,6 +168,17 @@ elif ! grep -qxF '.bantam.cfg' "$BASE_DIR/.gitignore"; then
fail ".bantam.cfg ignore rule is missing"
fi
echo "[check] Device initramfs module lists..."
for dev in nokia-argon nokia-beatles nokia-tough nokia-sparkler; do
if [ ! -f "$BASE_DIR/devices/$dev/modules-initfs" ]; then
fail "missing devices/$dev/modules-initfs"
fi
done
if ! grep -q 'MODULES_INITFS' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh" || \
! grep -q 'initramfs.load' "$BASE_DIR/scripts/apply-bananarchy-overlay.sh"; then
fail "apply-bananarchy-overlay.sh no longer installs the device initramfs module list"
fi
echo "[check] Docker availability..."
if ! command -v docker >/dev/null 2>&1; then
fail "docker is not installed"