mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 04:16:24 -05:00
* Bake the app build into images; rebuild on-device only when stale Previously the Raspberry Pi image shipped without app/build/ and compiled the React bundle on first boot via repair.sh -- a multi-minute, memory-hungry step that can OOM a 2GB Pi. The Debian Live ISO already baked the build in, so the two paths had drifted. Add scripts/build_app.sh as the single source of truth: it hashes the build inputs (src/, public/, package.json, package-lock.json, tsconfig.json) and runs `npm run build` (with GENERATE_SOURCEMAP=false) only when build/ is missing or those inputs changed, then writes build/.build-stamp. Wire all three call sites to it: - pi-gen 03-run-chroot.sh now builds after npm install, baking build/ into the Pi image like the Debian hook already does. - debian-live 9999-wrolpi.hook.chroot uses it so the baked build is stamped. - repair.sh uses it, so first-boot/manual-repair/install/upgrade all become no-ops when the shipped build is current. Result: fresh images ship a stamped build/, so a weak Pi never compiles on boot or repair; an on-device rebuild happens only when an upgrade actually changes app/. build_app.sh never runs npm install, so repair.sh keeps its offline guarantee. * build_app.sh: rebuild when built output is incomplete, not just missing Addresses review feedback: a matching stamp only proves the inputs are unchanged, not that the output survived. repair.sh exists to fix corruption, so a build/ with index.html + stamp but a missing JS/CSS asset must still rebuild. Verify every file referenced by build/asset-manifest.json exists (and that the manifest itself parses); rebuild otherwise. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| stage2/04-wrolpi | ||
| build.sh | ||
| config.txt | ||
| README.md | ||
Pi-Gen
This directory exists to facilitate the creation of WROLPI Raspberry Pi OS images.
See https://github.com/RPI-Distro/pi-gen
Generate 64bit Raspberry Pi WROLPi image
-
Convert a map PBF file to your initial map DB dump:
docker run --rm -v /home/user/district-of-columbia-230111.osm.pbf:/data/region.osm.pbf lrnselfreliance/osm-map-dumper > pi-gen/stage2/04-wrolpi/files/map-db-gis.dumpThe output is already compressed (PostgreSQL custom format with
--compress 9).Verify the dump format is correct:
file pi-gen/stage2/04-wrolpi/files/map-db-gis.dump # Should show: "PostgreSQL custom database dump" -
Run the build (or, with a specific git branch)
-
Build release branch (default)
sudo ./build.sh -
Build specific branch
sudo ./build.sh -b master
-
-
The images are now in the
pi-gendirectory.