Skip to content

Create a Custom OS Image

To create your own system image, you can use the tool available in our pigeon-os repository.

Dependencies

Use a Debian-based system for compatibility. To install the required dependencies, run the following:

sudo apt-get update
sudo apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree zip \
dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc \
qemu-utils kpartx gpg pigz

Usage

Clone the repository on your build machine:

git clone git@gitlab.com:pigeoncomputers/pigeon-os.git
cd pigeon-os

Modify the config file and the stage2-pigeon directory if necessary. For details, see pi-gen.

Run build.sh to build all stages:

./init.sh
sudo ./build.sh

If everything went correctly, you will find a ready image file in the deploy directory.

Skipping stages to speed up development

To rebuild just the last stage (the "stage2-pigeon" directory), use:

./init-dev.sh
sudo ./build-dev.sh

Note: This rebuilds only the last stage, significantly reducing build time during development.

64 Bit Systems

To generate a 64-bit image, use ./init-64bit.sh instead of ./init.sh:

./init-64bit.sh
sudo ./build.sh

Note: Raspberry Pi OS 32-bit images are primarily based on Raspbian, whereas Raspberry Pi OS 64-bit images are primarily based on Debian.

pi-gen repository

The pi-gen repository contains the official Raspberry Pi OS image generation tool. Refer to its README file for setup instructions and usage details.