Files
pi-pm3/QUICK_BUILD.md
michael 4f35df1781 Initial commit - Phase 3/4
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 13:46:22 -08:00

3.1 KiB

Quick Build Reference

TL;DR for building your Dangerous Pi image.

Prerequisites

# 1. Install Docker
brew install docker  # macOS
# OR
sudo apt-get install docker.io  # Linux

# 2. Clone pi-gen
git clone https://github.com/RPi-Distro/pi-gen.git
cd pi-gen
git checkout arm64

Build Commands

First Time (Full Build)

# Copy your stage to pi-gen
cp -r /path/to/dangerous-pi/pi-gen/stageDTPM3 /path/to/pi-gen/
cp /path/to/dangerous-pi/pi-gen/config /path/to/pi-gen/config

# Build
cd /path/to/pi-gen
sudo ./build.sh

# OR with Docker (recommended)
./docker-build.sh

⏱️ Time: 1-2 hours 📦 Output: deploy/image_2025-11-26-Proxmark3.img

Quick Iteration (After Code Changes)

cd /path/to/pi-gen

# Copy updated code
cp -r /path/to/dangerous-pi/pi-gen/stageDTPM3 .

# Rebuild only your stage
CONTINUE=1 STAGE=stageDTPM3 sudo ./build.sh

⏱️ Time: 5-10 minutes 💡 Use: Testing Dangerous Pi changes only

Flash & Test

Flash Image

# Using Balena Etcher (easiest)
# https://etcher.balena.io/

# OR using dd
sudo dd if=deploy/image.img of=/dev/sdX bs=4M status=progress

Connect & Test

  1. Boot Pi with SD card
  2. Connect to WiFi:
    • SSID: raspi-webgui
    • Password: ChangeMe
  3. Run tests:
    ./test-image.sh 10.3.141.1
    

Verify Manually

# SSH
ssh dt@10.3.141.1  # password: proxmark3

# Check service
sudo systemctl status dangerous-pi.service

# Test API
curl http://10.3.141.1:8000/api/health

What Was Built

Your image includes:

  • Stage 01: Proxmark3 firmware & client
  • Stage 02: RaspAP (WiFi access point)
  • Stage 03: ttyd (web terminal)
  • Stage 04: Dangerous Pi backend at /opt/dangerous-pi

Key Config Values

From pi-gen/config:

IMG_NAME="Proxmark3"
TARGET_HOSTNAME="Proxmark3"
FIRST_USER_NAME="dt"
FIRST_USER_PASS="proxmark3"

Troubleshooting

Build fails?

# Check disk space
df -h  # Need 20GB+

# Clean and retry
sudo rm -rf work/ deploy/
sudo ./build.sh

Service not starting?

# Check logs
ssh dt@10.3.141.1
sudo journalctl -u dangerous-pi.service -n 50

# Common issue: Port conflict with ttyd
# See PORT_CONFLICT.md

Image too large? Already optimized! Your scripts include:

  • Package cache cleanup
  • Pip cache removal
  • Auto-remove unused packages

Files Created

  1. Initial setup: Full build with ./build.sh
  2. Development: Make code changes
  3. Quick rebuild: CONTINUE=1 STAGE=stageDTPM3 ./build.sh
  4. Flash: Use Balena Etcher
  5. Test: Run ./test-image.sh
  6. Iterate: Repeat steps 2-5

Full Documentation

See BUILD_GUIDE.md for:

  • Detailed configuration options
  • Advanced customization
  • Stage architecture
  • Optimization tips
  • Complete troubleshooting guide

Quick Start: ./docker-build.sh → Flash → Test 🎉