Project Overview
Raspberry Pi Image Builder
Section titled “Raspberry Pi Image Builder”Build, customize, and maintain production-ready Raspberry Pi images with ease.
A modular automated build system for creating custom Raspberry Pi OS images with full hardware support, automatic updates, and service composition.
Why This Project?
Section titled “Why This Project?”Building and maintaining custom Raspberry Pi images is traditionally complex and error-prone. This project solves that by providing:
- Easy Image Creation - Build custom images with a single command
- Modular Service System - Compose images from reusable service components
- Automatic Hardware Support - Full Raspberry Pi hardware compatibility maintained automatically
- CI/CD Integration - Automated builds and releases via GitHub Actions
- Auto-Detection - Network interfaces, WiFi adapters, and USB devices automatically configured
- Safe Updates -
apt upgradeworks without breaking hardware support - Share & Maintain - Version control your image configurations, share with your team
Key Features
Section titled “Key Features”Modular Service Composition
Section titled “Modular Service Composition”Build images by combining service modules:
# Base Debian image./bin/autobuild --image debian
# Debian + Incus + Docker./bin/autobuild --image debian/qemu+docker
# Full stack: Incus + Docker + OpenWrt + Home Assistant + WiFi Hotspot./bin/autobuild --image debian/qemu+docker+openwrt+hotspot+haosAvailable services:
- qemu - Incus container/VM platform with KVM acceleration
- docker - Docker Engine with Portainer and Watchtower
- haos - Home Assistant OS in an Incus VM
- openwrt - OpenWrt router in an Incus container
- hotspot - WiFi access point (2.4GHz/5GHz)
Automatic Hardware Detection
Section titled “Automatic Hardware Detection”- Network Interfaces - Dual NIC? Automatic bridge configuration (br-wan + br-lan)
- WiFi Adapters - Dual-band WiFi? Auto-configures 2.4GHz + 5GHz access points
- Zigbee Dongles - USB Zigbee coordinators auto-passed to Home Assistant VM
- Adaptive Configuration - Services adapt to available hardware
GitHub Actions CI/CD
Section titled “GitHub Actions CI/CD”- Automated Builds - Daily builds or on-demand via GitHub Actions
- Multi-Stage Pipeline - Parallel builds for faster releases
- Automatic Releases - Compressed images uploaded to GitHub Releases
- Branch Strategy - Stable releases on main, pre-releases on test/preview branches
Safe System Updates
Section titled “Safe System Updates”RaspiOS kernel and firmware packages are integrated via APT with pinning:
# Update everything safelysudo apt update && sudo apt upgrade -yKernel, firmware, and WiFi/Bluetooth drivers update from RaspiOS repositories while all other packages update from Debian - no manual intervention required.
Quick Start
Section titled “Quick Start”Prerequisites
Section titled “Prerequisites”sudo apt install -y parted e2fsprogs dosfstools qemu-utils rsync \ xz-utils genisoimage qemu-system-aarch64Build Your First Image
Section titled “Build Your First Image”# Clone the repositorygit clone https://github.com/Pikatsuto/raspberry-builds.gitcd raspberry-builds
# Build a base Debian image./bin/autobuild --image debian
# Or build with services./bin/autobuild --image debian/qemu+docker
# Flash to SD cardsudo dd if=debian-*.img of=/dev/sdX bs=4M status=progress conv=fsyncCreate a Custom Image
Section titled “Create a Custom Image”# Copy the base configurationcp -r images/debian images/myproject
# Edit configurationvim images/myproject/config.sh# Set OUTPUT_IMAGE, IMAGE_SIZE, SERVICES, etc.
# Customize setupvim images/myproject/services/base/setup.sh# Add your package installations
# Build./bin/autobuild --image myprojectDocumentation
Section titled “Documentation”- Getting Started - Installation, first build, flashing
- Architecture - How the build system works
- Build System - Autobuild options, multi-stage pipeline
- Service System - Creating and using service modules
- GitHub Actions - CI/CD setup and workflows
- Hardware Detection - Auto-configuration features
- FAQ - Common questions and troubleshooting
Use Cases
Section titled “Use Cases”Home Server
Section titled “Home Server”Build a Raspberry Pi home server with Docker, Portainer, and automatic hardware support.
IoT Gateway
Section titled “IoT Gateway”Create an IoT gateway with Home Assistant, Zigbee coordinator auto-detection, and dual WiFi AP.
Network Router
Section titled “Network Router”Build a custom router with OpenWrt in a container, dual NIC bridge configuration, and WiFi hotspot.
Development Platform
Section titled “Development Platform”Create reproducible development environments with Incus containers/VMs and Docker.
Team Deployment
Section titled “Team Deployment”Version control image configurations, build via CI/CD, deploy identical images across multiple devices.
How It Works
Section titled “How It Works”- Base Images - Downloads Raspberry Pi OS (boot/firmware) + Debian ARM64 (rootfs)
- Service Composition - Combines setup scripts from selected services
- QEMU Build - Installs packages in ARM64 QEMU VM, including RaspiOS kernel/firmware
- Merge - Keeps RaspiOS boot partition, replaces root with configured Debian
- Compress - PiShrink + xz compression for minimal image size
The result is a Debian ARM64 userspace with full Raspberry Pi hardware support and automatic updates.
Project Status
Section titled “Project Status”Current Support:
- Raspberry Pi 4/5 (ARM64)
- Debian 13 (Trixie) ARM64
- Automatic hardware detection (network, WiFi, USB Zigbee)
In Development:
- Additional distribution support (Ubuntu, Fedora, Alpine)
- Expanded hardware detection (storage, audio, camera)
Contributing
Section titled “Contributing”Contributions welcome! See CONTRIBUTING.md for guidelines.
License
Section titled “License”This project is licensed under the MIT License - see LICENSE for details.
Support
Section titled “Support”- Issues - GitHub Issues
- Discussions - GitHub Discussions
- Wiki - Documentation Wiki
Built with Raspberry Pi OS + Debian ARM64 + QEMU + GitHub Actions