Git Product home page Git Product logo

raspbian-image-repository's Introduction

raspbian-image-repository

Custom-built Raspberry Pi OS images

Table of contents

Features

  • Custom Raspberry Pi OS images
  • Custom APT sources (with GPG key and key server support)
  • Custom pre-installed packages (from APT repositories, GitHub releases, and direct URLs)
  • Custom boot command line options
  • Custom boot configuration options
  • Custom target build stage (default is 2 which results in the lite image)

Generate your custom images

  1. Fork this repository

    image

  2. Clone your fork

    git clone https://github.com/<your-username>/raspbian-image-repository.git
  3. Change config/target-config.json as per your requirements (See Configure your custom images section)

  4. Commit and push the changes

  5. Go to Actions tab in your forked repository and select Generate image workflow

    image

  6. Click on Run workflow button, set Image target name to the target name in config/target-config.json

    image

  7. Click on Run workflow button and wait for the workflow to complete

  8. Go to the Releases page

    image

  9. Download the generated image

    image

  10. Install your custom images to an SD card (See Install your custom images to an SD card section)

Configure your custom images

The configuration file is located at config/target-config.json. It contains a list of target configurations.

Target configuration properties

Each configuration has the following properties:

  • name: The name of the configuration to use as a reference
  • version: The version of the configuration to distinguish between different versions of the same configuration
  • reference: The reference (tag or commit hash) of the official Raspberry Pi OS pi-gen repository to be used as a base
  • stage: The number of the target build stage to reach (optional, default is 2 which results in the lite image)
  • sources: A list of custom APT sources to be added to the image (optional)
    • name: The name of the source to use as a reference
    • source: The source entry
    • key_id: The GPG key ID
    • key_file: The GPG key file URL (optional)
    • key_server: The GPG key server (optional)
  • packages: A list of custom packages to be installed on the image
    • package: The name of the package
    • version: The version of the package (optional)
    • file_url: The URL of the package file (optional)
    • release: The release information of the package (optional)
      • owner: The owner of the repository
      • repo: The name of the repository
      • tag: The tag of the release
      • matcher: The matcher to filter the package file
      • token: The GitHub token to access a private repository, supports environment variable reference when $ is used like $GITHUB_TOKEN to avoid putting the access token directly in the configuration file (optional)
  • boot_cmdline: A list of boot command line parameters to be added to the cmdline.txt file (optional)
  • boot_config: A list of boot configuration parameters to be added to the config.txt file (optional)

Example configuration

A minimalist configuration to add an extra package to your image:

{
  "name": "bookworm-lite-with-dns-server",
  "version": "1.0.0",
  "reference": "2024-07-04-raspios-bookworm-arm64",
  "packages": [
    {
      "package": "dnsmasq"
    }
  ]
}

A more complex configuration to add custom packages, APT sources, and boot configuration:

{
  "name": "edge-pi-zero",
  "version": "1.0.0",
  "reference": "2024-03-12-raspios-bullseye",
  "sources": [
    {
      "name": "effective-range",
      "source": "deb http://aptrepo.effective-range.com stable main",
      "key_id": "C1AEE2EDBAEC37595801DDFAE15BC62117A4E0F3",
      "key_file": "http://aptrepo.effective-range.com/dists/stable/public.key",
      "key_server": "keyserver.ubuntu.com"
    }
  ],
  "packages": [
    {
      "package": "wifi-manager",
      "release": {
        "owner": "EffectiveRange",
        "repo": "wifi-manager",
        "tag": "latest",
        "matcher": "*armhf.deb"
      }
    },
    {
      "package": "picprogrammer",
      "release": {
        "owner": "EffectiveRange",
        "repo": "pic18-q20-programmer",
        "tag": "v0.3.0",
        "matcher": "*armhf.deb"
      }
    },
    {
      "package": "filebeat",
      "version": "8.12.2",
      "file_url": "https://github.com/EffectiveRange/elastic-beats-armhf-deb/releases/download/v8.12.2/filebeat-8.12.2-armv7l.deb"
    }
  ],
  "boot_cmdline": [
    "modules-load=dwc2,g_ether"
  ],
  "boot_config": [
    "enable_uart=1",
    "dtoverlay=dwc2"
  ]
}

Install your custom images to an SD card

Flash the image to an SD card using Raspberry Pi Imager

  1. Download and install the Raspberry Pi Imager

    image

  2. Open the Raspberry Pi Imager

    image

  3. Choose your Raspberry Pi Device type and Storage volume

  4. Click Choose OS and select Use custom option

    image

  5. Select the custom image file you downloaded

    image

  6. Click NEXT and EDIT SETTINGS to configure the Wi-Fi, SSH and other settings

    image

  7. Click SAVE to apply the configuration

    image

  8. Click YES to flash the image to the SD card

    image

  9. After the flashing process is completed, insert the SD card into your Raspberry Pi and power it on

    image

raspbian-image-repository's People

Contributors

attilagomboser avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.