Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A tool to generate highly customised software images for Raspberry Pi devices.

License

NotificationsYou must be signed in to change notification settings

raspberrypi/rpi-image-gen

Repository files navigation

rpi-image-gen is a tool for creating custom software images for Raspberry Pi devices. It runs best on a Raspberry Pi Host running up-to-date 64-bit Raspberry Pi OS.

For the tool used to create the Raspberry Pi OS distribution, please go tohttps://github.com/RPi-Distro/pi-gen

NOTE rpi-image-gen is under active development. Please report issues athttps://github.com/raspberrypi/rpi-image-gen. Feature suggestions are welcome.

Quick Start

From Source

git clone https://github.com/raspberrypi/rpi-image-gen.gitcd rpi-image-gensudo ./install_deps.sh./rpi-image-gen build -c ./config/bookworm-minbase.yaml

The device image will be in./work/image-deb12-arm64-min/deb12-arm64-min.img

Install it onto an SD card using Raspberry Pi Imager (https://www.raspberrypi.com/software/). Select "Use Custom" if using the GUI, or use the command line:

sudo rpi-imager --cli ./work/image-deb12-arm64-min/deb12-arm64-min.img /dev/mmcblk0

Note: This image intentionally has login passwords disabled.

To install via other means, for example usingrpiboot withpi-gen-micro's usb mass-storage or fastboot gadget, or provisioning withrpi-sb-provisioner, take a look at the documentation in those repositories.

The rpi-image-gentechnical documentation andexamples directory provide customisation and usage guidance.

Why use this?

  • Fast builds - Uses pre-built packages instead of building from source

  • Production-ready - Same binaries used by millions in production worldwide

  • Compatible - Use the same library versions as Raspberry Pi OS

  • Customisable - Configure your filesystem exactly as needed

  • Secure - Integrate withrpi-sb-provisioner (https://github.com/raspberrypi/rpi-sb-provisioner) to automatically set up signed boot and encrypted filesystems

  • Auditable - Generate Software Bill of Materials and CVE reports to give consumers of your image confidence

rpi-image-gen is a versatile image generation and build automation tool designed to create reproducible operating system artefacts. It supports producing bootable disk images, partitioned media layouts, and device-agnostic filesystem tarballs from declarative configurations. The tool integrates package management, filesystem assembly, and image layout definition, enabling consistent builds for embedded devices, virtual machines, and general-purpose systems. By separating build logic from target hardware specifics, it simplifies cross-platform image creation, CI workflows, and distribution packaging.

Core Concepts

  • Configuration - Declare variables and build attributes in simple, easy to read files

  • Layers - Modular, composable components with automatic variable checking, validation policies and comprehensive documentation

  • Hooks - Shell scripts that run at defined points in the build process

Architecture

rpi-image-gen uses:

The tool runs as a regular user and does not require root privileges.

rpi-image-gen overview

Dependencies

Install required base dependencies:

sudo ./install_deps.sh

See thedepends file for the complete list of required packages.

Important

rpi-image-gen has been developed on Raspberry Pi OS which, at the time of writing, is Debian Bookworm arm64. It heavily favours Debian-based systems and will run on non-arm64 platforms (such as x86_64) via QEMU emulation or inside container environments. However, there is currently no formal support for these non-native environments.

If utilising sparse images in your workflow, e.g. withrpi-sb-provisioner (https://github.com/raspberrypi/rpi-sb-provisioner), please refer to theprovisioning documentation for important advice.

Documentation

Technical Information

  • Index - Comprehensive reference for the configuration system, layer management, metadata, variable validation, provisioning, execution flow, etc.

Examples

See theexamples/ directory for tips and help

Directory Structure:

  • bin/ - Common executable files and utilities

  • config/ - Configuration files

  • device/ - Device specific assets

  • docs/ - Technical documentation

  • examples/ - Examples and howto

  • image/ - Disk layout specific assets

  • keydir/ - Cryptographic assets

  • layer/ - Layer library

  • layer-hooks/ - Common hooks used by layer library

  • lib/ - Execution helpers and macros, eg CLI handling, reusable constructs

  • scripts/ - Dedicated functional hooks, eg for bdebstrap

  • site/ - Core Python engine classes

  • templates/ - Templating assets, eg doc generation

  • test/ - Test harness

Basic Usage

# Buildingrpi-image-gen build -c config/my-system.yaml# Specify the source directoryrpi-image-gen build -S /path/to/my/assets -c /path/to/my/config.yaml# List all available layersrpi-image-gen layer --list# Describe a layerrpi-image-gen layer --describe my-layer# Lint a layer file when developing a custom solutionrpi-image-gen metadata --lint /path/to/my/layer.yaml# See all optionsrpi-image-gen --help

Integration

rpi-image-gen is designed for integration with external build systems:

  • External directories can provide custom configs and layers

  • Reusable components allow developers to easily apply their customisations on top of built-in defaults

  • Hooks provide integration points throughout the build process

  • SBOM generation for security and compliance workflows

Getting Help

About

A tool to generate highly customised software images for Raspberry Pi devices.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors88


[8]ページ先頭

©2009-2025 Movatter.jp