Repository navigation
Conversation
The stock pi-gen output for our use case is fat with stuff we don't need: stage2's "comfort" CLI tooling (vim, less, raspi-config, build-essential, python3-pip, network-manager-gnome, fonts-*, htop) adds ~700 MB of rootfs the dashboard never touches. The Docker convenience script pulls in another ~300 MB of rootless-extras, buildx, and model-plugin we have no use for. Three coordinated changes: 1. Drop stage2 from STAGE_LIST. pi-gen now runs stage0 + stage1 + stage-42w only. SKIP + SKIP_IMAGES files dropped on stage2-5 in build.sh so pi-gen doesn't touch them. 2. Pull the stage2 packages we actually need into stage-42w's own 00-packages list — `network-manager` (wifi-connect depends on it; we already disable dhcpcd in 02-wifi-onboarding) and `raspberrypi-sys-mods` (provides /usr/lib/raspberrypi-sys-mods/ firstboot which does partition-resize + ssh-enable on first boot — same job stage2/01-sys-tweaks would have done). 3. Replace `curl get.docker.com | sh` with explicit Docker apt repo + `apt-get install --no-install-recommends docker-ce docker-ce-cli containerd.io docker-compose-plugin`. We're not running rootless, not building images on the Pi, and have no AI workloads — the four packages above are what `docker compose up -d` against a pulled image actually needs. 01-ftw-setup also explicitly enables NetworkManager.service + injects `init=/usr/lib/raspberrypi-sys-mods/firstboot` into cmdline.txt so the first-boot resize still happens — both jobs stage2 used to do. Expected impact: image ~3.0 GB → ~2.0 GB uncompressed, ~561 MB → ~350 MB compressed. CI on this PR is the validation. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Stock pi-gen output for our use case carries ~1 GB of rootfs the dashboard never touches. We boot, run docker-compose, serve a web UI — none of stage2's "comfort" CLI tooling (`vim`, `less`, `raspi-config`, `build-essential`, `python3-pip`, `network-manager-gnome`, `fonts-*`, `htop`) is on the critical path. The Docker convenience script also pulls `docker-ce-rootless-extras`, `docker-buildx-plugin`, and `docker-model-plugin` (~300 MB combined) that we have no use for.
Stacked on #186. Merge target: `183-rpi-sd-image` (so the trim sits on top of the three earlier image-pipeline fixes).
What
Three coordinated changes:
Drop stage2 from STAGE_LIST. pi-gen now runs only `stage0 + stage1 + stage-42w`. SKIP + SKIP_IMAGES files dropped on stage2-5 in `build.sh`.
Pull the stage2 packages we actually need into stage-42w. Added to `00-install-packages/00-packages`:
Replace `curl get.docker.com | sh` with explicit Docker apt repo + minimal package list: `docker-ce`, `docker-ce-cli`, `containerd.io`, `docker-compose-plugin`. Same Docker apt URL the convenience script uses, just without the bloat we don't run.
`01-ftw-setup/00-run.sh` also explicitly enables `NetworkManager.service` + injects `init=/usr/lib/raspberrypi-sys-mods/firstboot` into `cmdline.txt` so the first-boot resize still happens — both jobs stage2 used to do.
Expected impact
Image: 3.0 GB → ~2.0 GB uncompressed, 561 MB → ~350 MB compressed.
Test plan
🤖 Generated with Claude Code