Skip to content

Build flashable Raspberry Pi SD card image #1

@lxtzfr

Description

@lxtzfr

Goal

Build a ready-to-flash Raspberry Pi OS image with everything pre-installed. Flash the SD card, boot the Pi, and it connects to the server automatically — no manual setup.

How it works

The image is generic. Robot-specific config is set in /boot/veezbot.config.json (FAT32 partition, editable before flashing):

{
  "serverUrl": "https://api.veezbot.com",
  "robotToken": "xxx"
}

On first boot:

  1. robot.service (systemd) starts
  2. update.sh pulls the latest tarball from veezbot/robot releases
  3. Robot connects to the server

Repo structure

veezbot/image
├── config/
│   └── veezbot.config.json     # default config template
├── scripts/
│   ├── update.sh               # pull latest veezbot/robot tarball + restart
│   └── robot.service           # systemd unit
├── stage/                      # pi-gen customisation
│   └── 00-install/
│       └── 01-run.sh           # install Node.js, copy scripts, enable service
└── .github/workflows/
    └── build.yml               # build .img.gz → publish as GitHub release

Tasks

  • Set up pi-gen as base (official Raspberry Pi OS build tool)
  • Write 01-run.sh stage: install Node.js, copy scripts, enable systemd service
  • Write update.sh: download latest tarball from veezbot/robot releases via gh
  • Write robot.service: systemd unit with auto-restart
  • Handle /boot/veezbot.config.json config loading at boot
  • GitHub Actions workflow: build image → publish robot-pi-vX.X.X.img.gz as release
  • Test: flash image, verify robot connects automatically

Notes

  • Image is generic — token and server URL are set in /boot/veezbot.config.json before flashing
  • Robot client updates are independent: update.sh always pulls latest from veezbot/robot
  • Build tool: pi-gen (same tool used to build official Raspberry Pi OS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions